Current string-harness work lives in
string-harness-upgrade.md (core schemas,
inner specialized LlmClient loop, document worlds, process/=PY score).
The live pack is 22 tasks: the original 17 stay on --backend string,
while org_chart_gen, solar_sld_gen, python_shapes_flag, and two TOC rows
(toc_list_entries, toc_renumber_insert) declare backend=lo. --backend auto
runs them together (string pool overlapping an LO agent pool, default 4, cap 5).
This file is the older
hybrid/LO roadmap. Phase F =PY dest rows (py_refuse_overlap,
py_no_bulk_read) and DrawWorld (flowchart tree + shape_connect) are
shipped in the string 17.
This plan covers the WriterAgent prompt optimization + evaluation system (scripts/prompt_optimization/). Ranking boards stay --backend string (those 17). --backend auto is the mixed pack, not a replacement leaderboard. Specialized Draw/Calc work uses a bounded inner LlmClient loop (delegate_to_subagent → domain schemas → workflow_finished), not SmolAgents. See ideas.md for the original ~50 ideas; the shipped pack is the 18 in dataset.py.
The evaluation system lives in scripts/prompt_optimization/:
run_eval.py/run_eval_multi.py: Main entrypoints (LlmClient+ tool loop fromllm_chat_eval.py). Eval does not set sampling temperature (LlmClient / provider default).run_eval_multi.pyrefuses a full catalog sweep unless--modelsor--yes-all-modelsis set.--gold-modelruns only with--generate-golds. Live--tools/--schema-densityreshape the advertised catalog only (seeeval_catalog+ the prompt_optimization README); they do not change sidebar registration.run_optimize.py: MIPROv2 offline optimizer. Wraps that samellm_chat_evalloop and rewrites a named slice (calc_core,writer_core,apply_html,sort_range, …), not the whole ambient prompt. Instruction-only (max_*_demos=0); does not auto-merge intoprompts.py/cells.py.- Default:
--backend string(Writer/Draw/Calc worlds ineval_worlds.pyviastring_eval_tools.py).eval_worlds.pyis frozen; the rule is in its module docstring. Skipsbackend=lorows so the 17-task board stays comparable. Core schemas fromToolRegistry.get_schemas. Flowchart usesdelegate_to_subagent(domain="shapes"); sort usesdelegate_to_subagent(domain="ranges")thensort_range(one call;sort_columnplus optionalthen_bytie-break keys). --backend lo: Headless UNO viatools_lo.py(fidelity smoke, not the ranking board).--backend auto: per-row backend. String rows use a pool; LO rows share an agent pool (--lo-workers, default 4, cap 5) so LLM waits overlap, and UNO stays serial on one_lo_thread. One soffice.- Judging: Hard gate is substring + result oracles + process oracles. Quality LLM-as-judge runs after the hard gate for resume, rewriting, summarization, and the two table tasks. Creative weights are accuracy-first (50/20/30); tables are formatting-heavy after the gate (20/80). Unparseable judge JSON retries once, then keeps the hard pass (
judge_score=None). Rank by hard pass / agent score / quality; C²/$ is secondary. - Dataset: 22 tasks in
dataset.pyALL_EXAMPLES. The first 17 omitbackend(string).python_shapes_flag,org_chart_gen,solar_sld_gen, and the two TOC tasks (toc_list_entries,toc_renumber_insert) setbackend=lo. TOC tasks use a built fixture (toc_outline_40) and have scripted LO replays.gold_standards.jsonis hand-written from the rubrics. --student scripted(scripted_student.py): no API key; pass isexample_passed(substring + oracles + process). The flag has no script.-jonrun_eval.pyis the string-pool width; onrun_eval_multi.pyit is model parallelism, with one shared LO agent pool (--lo-workers, default 4, cap 5). Flag-pathget_ctx()/ current-component / venv lock are still a separate pin. Do not usetests/eval_runner.py. Do not setWRITERAGENT_TESTING=1for LO eval. The Debug-menu Evaluation Dashboard (plugin/chatbot/eval_dashboard_ui.py) still lazy-importstests.eval_runner.run_benchmark_suite. Run returns immediately: the suite runs on a background thread, each test's document reads and tool calls are posted back to the main thread, and the dialog pumps once per test. A failure before the summary dict still posts Finished; the line stays Running... until the main thread runs that callback. Closing the dialog sets a closed flag before dispose. Later progress, summary, and failure posts skip that window and still clearis_running. The endpoint field is read-only: the suite uses the saved endpoint from config, not the text in the dialog.make buildshipstests/; release (--no-tests) omits it and strips that menu. If Run is reached without the module, the dialog reports that the benchmarks are not in the build and points atscripts/prompt_optimization/run_eval.py.- CI / pytest:
tests/scripts/test_eval_oracles.pyandtest_scripted_eval_pack.pyreplay--backend string --student scripted(no OpenRouter). Scheduler overlap istests/scripts/test_eval_scheduler.py(no soffice). Prompt-text pins live intests/scripts/test_eval_prompts.py. Headless--backend lo --student scriptedis@pytest.mark.integrationand skips the flag (runs org chart, solar SLD, and the two TOC replays); PR CI runs it on Linux in the scripts integration step, and elsewhere it skips whensoffice,python-uno, or the manifest is missing. Local:python scripts/prompt_optimization/run_eval.py --backend lo --student scripted --no-bust-cache -v. Live flag:python scripts/prompt_optimization/run_eval.py --backend auto -e python_shapes_flag(API key + soffice). CI without soffice cannot run that row.
The 50 test cases live in ideas.md (20 Writer, 20 Calc, 5 Draw, 5 Multimodal; categorized by level with modes for judging).
DrawWorld in eval_worlds.py shipped the tree/shape_connect path (no separate --backend drawjson) and is now frozen. Remaining gaps (image_generate, vision/multimodal, and LO geometry/z-order) belong to the --backend lo lane (tools_lo.py / test_*_uno.py), not DrawWorld simulator work. Screenshots are not needed.
Shipped string path (--backend string):
- DrawWorld (shipped): Keeps in-memory shapes and renders them with the live
build_shape_tree(plugin/draw/tree.py). Supportsshape_get_tree,shape_upsert(flowchart-*, connectors),shape_connect,shape_group,shape_get_summary.dispatch_string_toolextended for Draw tools. Final state for judging = serialized tree JSON (structural diff on nodes, connections, text, geometry with tolerances) or LLM-as-Judge on tree. plugin/draw/tree.py:GetDrawTreeis the perfect "DOM" — recursive JSON withtype,text,geometry,connected_start/connected_end(by name/text),childrenfor groups. Its description explicitly says "Use this instead of requesting a screenshot to understand the layout, text, connections, and hierarchy of objects (like flowcharts or diagrams)."- Image generation and vision/multimodal evals belong on
--backend lo(scripts/prompt_optimization/tools_lo.py) with real fixtures (e.g.,multimodal_vision.odt), notDrawWorldsimulator mocks. - Verification:
eval_core.pychecksexpected_contains, result oracles, and optional LLM-as-judge on the exported tree JSON. No pixel comparison.
LO transition: Use --backend lo with Draw doc (private:factory/sdraw) + real tools for fidelity tests (real insertion, styles, z-order, rendering). See tests/draw/test_draw_uno.py for patterns (_exec_tool, assertions on JSON + UNO counts/positions). get_draw_context_for_chat in plugin/draw/bridge.py provides lighter text summary.
When to require LO (analysis of ideas.md):
- String/DrawJSON sufficient (~40%): Pure text cleanup, logical rewriting, basic table engineering (HTML), bullet consistency, format preservation, simple shape creation (via tree mutation). Flowchart Gen (#3 in Draw) is ideal for tree-based eval (check connections, node types/text).
- Requires LO or advanced mock for fidelity (most Calc, many Writer structural, all Draw/Multimodal):
- Writer: Styles, comments, track changes, TOC, headers/footers, section breaks, style mapping, bibliography (UNO-specific).
- Calc: Formulas, conditional formatting, pivot tables, charts, multi-sheet ops (20/20 tests).
- Draw (5/5): Z-order, grouping, precise layout/alignment, scaling — tree JSON handles most; full LO for geometry/rendering edge cases.
- Multimodal (5/5): Vision (OCR, captioning, spatial audit on images/diagrams) — needs
image_generate+ insertion or real image fixtures (multimodal_vision.odt).
- Recommendation: DrawWorld covers Draw/flowchart ranking without screenshots. Use
--backend lofor Calc/Writer fidelity smoke and as a gold standard for UNO-only features. This avoids making all evals "harder" while enabling image/tool-calling evals via metadata/tree. Aligns with AGENTS.md testing policy (unit tests for mocks, UNO tests for real document interaction).
See previous analysis for architecture diagram (StringBackend → DrawJSONBackend → LOBackend; judge on final tree/HTML).
- Hardened key tests in
scripts/prompt_optimization/dataset.py(BULK_CLEANUP, REFORMAT_RESUME, LOGICAL_REWRITING, TABLE_ENGINEERING, BULLET_CONSISTENCY, TAX_COLUMN, STYLE_CONSISTENCY, COMMENT_MANAGEMENT) with stricter instructions, edge cases, precise rubrics referencing judge weights/gold, expanded contains/rejects, tool hints (per plan). TABLE_FROM_MESS and structural Draw/Calc kept as baseline. No new full tests added ("don't go crazy"). - Ported/updated from
ideas.md. - Categorize by LO requirement (see above).
- Run via
--backend lo(scripts/prompt_optimization/tools_lo.py), notDrawWorldsimulator mocks. - Fixtures:
tests/fixtures/multimodal_vision.odt, image assets. - Judge on inserted image metadata + caption accuracy.
- Expand with Draw-specific tree golds in
gold_standards.json. long_summarization.odt,complex_calc.ods.
- Integrate with
run_eval_multi.py(already supports multi-model IpD). AddDrawWorld is the string-backend Draw tree; no extra flag.--backend drawjsonflag.- UNO tests for Draw eval path (
tests/draw/).
- Keep
--backend string(WriterWorld / DrawWorld / CalcWorld) as primary for speed/CI. - LO for validation of specialized tools (
ToolWriterSpecialBase,ToolDrawSpecialBase,shape_get_tree).
Hypothesis: a few limitation words on main chat beat a second specialized domain. Dest / spill / peek live on write_range (plugin/calc/cells.py); MIPROv2 can later rewrite that description plus the remaining CALC_FORMULA_SYNTAX / pointer in CALC_CORE_DIRECTIVES (plugin/framework/prompts.py).
Calc chat no longer delegates domain="python"; models must write_range of =PY("result = …"; DataRange) into an empty cell outside DataRange. Rows in dataset.py:
| id | Ask | Pass | Fail | Status |
|---|---|---|---|---|
| refuse overlap | put the formula in H1, data A1:H500 | dest J1/I1 and says H1 is inside the range | writes H1 | shipped (py_refuse_overlap) |
| no bulk read | unique-rows via =PY |
no read_range of A1:H500 / the spill |
dumping the block into chat | shipped (py_no_bulk_read) |
| unique beside | drop dupes on A1:H500 onto the sheet | =PY dest J1 (or first empty col / other sheet) |
dest inside A1:H500; domain=python; chat-only |
dropped (pack stays even) |
| in-place reframe | write unique rows back onto A1:H500 | same as unique beside + short circular explanation | =PY in A1 |
dropped |
Scoring: dest vs parsed data range on --backend string (CalcWorld records dest + formula). LO later for spill. Next ranking run is live --backend string (do not regenerate golds first). Optimize output if needed: optimized_calc_py_prompt.json.
Shared Calc prompts and the tax oracle are better after this sequence.
Ranking dropped full glm-5.3 and selectively remeasured sort+tax.
Production still ships one Calc prompt for all models — there is no
20b-only fork. The full 17-task pack was not re-run.
Source plan: oss-20b-eval.md. Scores:
benchmarks.md.
- Sort goes specialized Calc
domain="ranges"thensort_range, not in-place=PY.sort_rangerequireshas_header. CALC_CORE_DIRECTIVESis structured:FORMULAS:(per-row relative Do-because) thenSORT:last (routing + plainhas_headerconstraint). The sort because-clause does not namewrite_range/=PY.- Tax oracle
_tax_formula_okaccepts equivalent relative 8% forms (B2*0.08,0.08*B2,B2*8%,8/100,$/ spaces / decimal comma) without loosening wrong-row, wrong-factor, or Price-column junk. write_rangefails loud when a JSON leaf count does not match the A1 cell count (stringCalcWorldtoo).- String
CalcWorldfill-down of one formula into a 1-D range usesformula_fill.expand_single_formula(production); JSON arrays stay pinned. Snapshotformulasstores the per-cell expanded text. - Ranking catalog:
z-ai/glm-5.3-flashonly.
| PR | What landed |
|---|---|
| 610 | Sort routing + relative tax formulas + required has_header + Do-because lines (shared prompt). |
| 616 | _tax_formula_ok equivalents; sort Do-line because-clause no longer names write_formula_range / =PY. |
| 617 | FORMULAS: / SORT: headers; has_header as a plain constraint; SORT routing last; write_formula_range fails on length mismatch. |
| 618 | Dropped z-ai/glm-5.3 from the ranking catalog (keep flash). Selective re-run of only data_sorting + tax_column; Pareto + benchmarks.md refreshed. |
Method. k=3 factorial on 20b+120b locked the 610 cell (both =
prompt + schema). Factorial sensitivity is not a single-shot catalog
hard_pass bit. Later scores are selective merges (613
then 618) via merge_benchmark_results.py.
Per-model hard_pass on the two Calc tasks after 616/617 vs the PR 613 snapshot. Remaining catalog only.
data_sorting
| Outcome | Models |
|---|---|
| HELP (F→P) | z-ai/glm-5.3-flash, upstage/solar-pro4, bytedance-seed/seed-2.0-mini, google/gemini-3.5-flash-lite, google/gemma-4-26b-a4b-it, minimax/minimax-m3 |
| HURT (P→F) | openai/gpt-oss-20b |
tax_column
| Outcome | Models |
|---|---|
| HELP (F→P) | qwen/qwen3.8-27b, upstage/solar-pro4, bytedance-seed/seed-2.0-mini, meta/muse-glimmer-30b, mistralai/mistral-small-2603, openai/gpt-5.6-luna, poolside/laguna-xs-2.1 |
| HURT (P→F) | openai/gpt-oss-20b, inception/mercury-2.5-preview |
Two of the old 610/613 tax “hurts” (qwen3.8-27b, glm-5.3) were
oracle FNs — fixed by 616. solar-pro4 tax helped after the 617
length-harden path. glm-5.3-flash sort helped after the 616
because-clause + 617 structure.
- Do forensic
gpt-oss-20bsort+tax fails from the 618 details before more shared-prompt churn — it helped under 610 then hurt under 616/617; gate models matter. - Do k≥3 factorial on 20b+120b before the next Calc directive edit (single-shot catalog bits are noisy).
- Do selective-only remeasure (sort+tax) after prompt tweaks; merge
into the snapshot (
merge_benchmark_results.py); avoid a full 17-task pack until spend allows. - Do keep the catalog without full
glm-5.3; flash only. - Do watch
mercury-2.5-previewtax hurt and incomplete/429 models (laguna-xssort; carriedqwen3.8-flash/nemotron-3.5-lightningrows). - Optional: does required
has_headerstill earn keep? Re-check only after 20b routing is understood.
Cross-links: oss-20b-eval.md,
benchmarks.md,
PR 610,
PR 616,
PR 617,
PR 618.
Updated Dev Plan v2.4 — Phase G current state (Sep 2026; PRs 610 / 616 / 617 / 618)
[eng L few]Multimodal and image eval via--backend lo(tools_lo.py): add vision fixtures (tests/fixtures/multimodal_vision.odt) and judge inserted image metadata and caption accuracy. (§ B. Multimodal & Image Evaluation)[eng S few]Add fixtureslong_summarization.odt(onlytests/fixtures/summarization_long.odtexists) andcomplex_calc.ods, plus Draw tree golds fororg_chart_genandsolar_sld_geninscripts/prompt_optimization/gold_standards.json(flowchart_genalready has one). (§ C. Test Fixtures)[eng S few]Dedicated UNO tests for the Draw eval path undertests/draw/(tests/scripts/test_scripted_eval_pack.py::test_scripted_lo_pack_all_passalready covers--backend lo --student scriptedfororg_chart_genandsolar_sld_gen, andtests/draw/test_draw_uno.pyteststest_get_draw_tree/test_upsert_and_verify_shape). (§ D. Advanced Reporting & CI)[eng M few]Score=PYspill placement on the LO backend instead of only dest on the stringCalcWorld. (§ F. Calc=PY()placement (shipped in the 17-task pack))[eng M few]Forensic read of thegpt-oss-20bsort and tax failures from the 618 details before more shared-prompt edits. (§ Next watches)[eng M few]Run a k>=3 factorial on 20b and 120b before the next Calc directive edit, then remeasure only sort and tax and merge into the snapshot. (§ Next watches)[idea S few]Re-check whether requiredhas_headeronsort_rangestill earns its keep once 20b routing is understood. (§ Next watches)