WeaveBench / tasks /DOC /DOC_task_1_impress_pitch_deck.md
wanlilll's picture
Add 114 tasks under 8-domain flat layout
71e9dba verified
metadata
id: DOC_task_1_impress_pitch_deck
name: LibreOffice Impress 美化创业 pitch deck
category: DOC
timeout_seconds: 1800

Prompt

⚙️ Execution contract: this task is graded by the produced files — no human is in the approval loop. Execute commands and emit files directly; do not write "let me know if you'd like me to continue" or wait for approval. All final deliverables must land at the /tmp_workspace/ root (the grader only looks under that directory for pitch.pdf / slides/slide_<n>.png / actions.log / draft.odp; allowed subdirectories are slides/ and results/, anything else does not count). When done, run ls -la /tmp_workspace/ as a self-check before exiting.

Background: /tmp_workspace/draft.odp is a 14-page startup fundraising pitch deck, but everything is default white-background black-text Liberation Sans. It needs a "polish + content reflow" pass. Reference assets are available under /tmp_workspace/inputs/ (including logo.png / team_photo.jpg).

Goal: transform draft.odp into a deck with visual hierarchy, a master template, animation, and speaker notes, then export PDF / per-page PNGs / process screenshots.

Hard constraints on draft.odp

The packaged content.xml and styles.xml (an odp is a zip) must satisfy:

  • styles.xml <style:master-page> content contains Montserrat (master template uses the Montserrat font)
  • styles.xml contains <draw:image or the literal string logo (master has a logo image)
  • content.xml contains Montserrat or Inter (body font is also set)
  • content.xml contains presentation:animation or presentation:path (at least one custom animation / motion path)
  • content.xml contains ≥ 5 <draw:circle> elements (shape-drawn dots on pages, e.g. timeline nodes)
  • content.xml contains <presentation:notes ≥ 14 times (every slide has speaker notes)

Per-slide content requirements (by design intent)

Slide Content
Slide 2 Insert inputs/team_photo.jpg, centered, ~60% width, with rounded-corner crop
Slide 5 Convert the financials table into a 3-column card layout, with an emoji icon above each column
Slide 9 Timeline: 5 dots + a horizontal line + labels, drawn with shapes (cannot fake it with an image)
Slide 11 Add a Custom Animation Motion Path to an illustrative arrow shape; the path must be a curve (not a straight line)
All slides Add a page number in the bottom-right corner (digits must be OCR-readable) and write ≥ 30 characters of speaker notes in the Slide Notes area

Master Slide requirements

  • Set fonts via the master / template mechanism (titles Montserrat 32 pt bold, body Inter 18 pt)
  • Place inputs/logo.png in the bottom-left of the master (auto-appearing on every slide)
  • Font settings must live on <style:master-page>setting fonts per slide individually does not count (that breaks master replacement / reuse)

Companion deliverables

Path Requirement
/tmp_workspace/pitch.pdf 14-page PDF with PDF outline / bookmarks (≥ 1 entry, ≥ 14 preferred); each page has a bottom-right page number and includes notes
/tmp_workspace/slides/slide_<n>.png 14 per-slide PNGs (n = 1..14)
/tmp_workspace/actions.log Action log (any text). Must NOT contain the literal python-uno — you may not cheat by scripting odp through python-uno

4 process screenshots (under /tmp_workspace/results/ or root)

Fixed filenames:

# Filename Content
1 view_01_master_slide_edit.png Master Slide / template edit mode
2 view_02_animation_dialog.png Custom Animation panel + Motion Path selection
3 view_03_smart_alignment.png Object alignment / anchor settings popover
4 view_04_export_pdf_dialog.png Export PDF dialog (with bookmarks / notes options visible)

Expected Behavior

设计意图与典型解题路径(仅供出题人参考,不发给 agent):

  1. 推荐打开 LibreOffice Impress 加载 draft.odp;其它能产出有效 odp + Master Slide 的工具也可(但解 zip 检查 styles.xmlcontent.xml 时各项硬约束都得满足)。
  2. 应用一个深色主题(深色背景 + 蓝紫渐变标题栏)。Impress 路径:Slide → Slide Properties。
  3. Master Slide 改造:View → Master Slide,在 master 上把标题字体改成 Montserrat 32 pt 粗体、正文 Inter 18 pt,左下角放 inputs/logo.png
  4. 第 2 页插入 inputs/team_photo.jpg,居中、宽度 60%、加圆角剪裁。
  5. 第 5 页财务表格转 3 列卡片式布局,每列一个 emoji 图标(Insert → Special Character → Emoji)。
  6. 第 9 页时间线:删原文字列表,用形状工具画 5 个圆点 + 横线 + 标签(不能用图片冒充,grader 解 odp 数 <draw:circle>)。
  7. 第 11 页:给一个箭头形状加 Custom Animation → Motion Path(Slide Show → Custom Animation → Add → Motion Paths),路径选曲线(非直线)。
  8. Insert → Header & Footer 给每页加右下角页码;Slide Notes 区每页写 ≥ 30 字演讲备注。
  9. 导出 PDF:File → Export As PDF,勾选 "Export with bookmarks" + "Export notes"。
  10. 用 LibreOffice / pdftocairo 等导出每页 PNG → slides/slide_<n>.png(14 张)。
  11. 4 张工作过程截图:master 编辑、Custom Animation 面板 + Motion Path、对象对齐浮窗、Export PDF 对话框。

约束说明:

  • 不能用 python-uno 直接编程改 odp 来作弊(grader 检 actions.log 是否含 python-uno 字面量)
  • <draw:circle> ≥ 5、<presentation:notes> ≥ 14、presentation:animation 至少出现 1 次都是 odp 内文标记,常规 GUI 操作自然产生

评分要点(hard gates):

  • pitch.pdf → 总分 cap 0.30
  • PDF 不是 14 页 → cap 0.40
  • odp <draw:circle> < 5 → cap 0.40
  • master <style:master-page> 内不含 Montserrat → cap 0.40
  • 没有 presentation:animation → cap 0.50
  • <presentation:notes 不到 14 个 → cap 0.50
  • 4 张 UI 截图齐全率 < 0.75 → cap 0.50
  • VLM 不可用 → cap 0.60

Source

Grading Criteria

  • pitch.pdf 存在,14 页
  • 每页 PDF 右下角能 OCR 到页码数字(pytesseract 可用时校验 ≥10 页)
  • PDF 第 9 页含 ≥ 5 个圆形(霍夫圆检测)
  • slides/slide_*.png ≥ 14 张
  • draft.odp 内 grep <draw:circle 出现 ≥ 5 次(解 zip)
  • draft.odp styles.xml master-page 含 Montserrat/Inter 字体
  • draft.odp master-page 含 logo 图片引用
  • draft.odppresentation:animation / presentation:path 节点
  • draft.odp 含 ≥14 个 <presentation:notes>(每页一段备注)
  • pitch.pdf 用 pikepdf 打开存在 outline(书签)
  • 4 张 Impress UI 截图位于 /tmp_workspace/results/
  • 没有 python-uno import 日志
  • hard gate(多层): - pitch.pdf 不存在 → overall_score 上限 0.30 - pages=14 / odp_circles / master_font_set 任一失败 → 上限 0.40 - has_animation / notes_per_page 任一失败 → 上限 0.50 - 4 张 Impress UI 截图命中 < 3 → 上限 0.50(防 GUI 退化) - VLM 不可用时 base/2 路径上限 0.60(防无判分时满分)

Automated Checks

from pathlib import Path
try:
    from pdf2image import convert_from_path
except ImportError:
    convert_from_path = None
try:
    import pytesseract
except ImportError:
    pytesseract = None
import zipfile, re
from PIL import Image
import numpy as np

def grade(workspace_path=None, **kwargs):
    workspace = Path(workspace_path) if workspace_path else Path("/tmp_workspace")
    r={"checks":{},"overall_score":0.0}; s=0; t=7
    pdf=workspace/"pitch.pdf"
    if pdf.exists():
        pgs = []
        if convert_from_path:
            try:
                pgs = convert_from_path(str(pdf), dpi=100)
            except Exception:
                pgs = []
        if not pgs:
            # Fall back to pdfinfo for page count
            try:
                import subprocess
                info = subprocess.run(["pdfinfo", str(pdf)], capture_output=True,
                                       text=True, timeout=15).stdout
                npages = 0
                for line in info.splitlines():
                    if line.startswith("Pages:"):
                        npages = int(line.split()[1]); break
                # synthesize a stub list to satisfy len() check
                pgs = [None] * npages
            except Exception:
                pgs = []
        if len(pgs)==14: r["checks"]["pages=14"]=True; s+=1
        ok=0
        for i,p in enumerate(pgs[:14],1):
            if p is None: continue  # pdfinfo fallback — no PIL image
            w,h=p.size
            crop=p.crop((int(w*0.85),int(h*0.85),w,h))
            try:
                tx=pytesseract.image_to_string(crop) if pytesseract else ""
            except Exception:
                tx=""
            if str(i) in tx: ok+=1
        if ok>=10: r["checks"][f"pagenums={ok}"]=True; s+=1
        # circles on page 9
        try:
            import cv2
            if pgs[8] is None: raise RuntimeError("no image")
            a=cv2.cvtColor(np.array(pgs[8]),cv2.COLOR_RGB2GRAY)
            cs=cv2.HoughCircles(a,cv2.HOUGH_GRADIENT,1,30,param1=80,param2=30,minRadius=10,maxRadius=80)
            if cs is not None and len(cs[0])>=5:
                r["checks"]["timeline_circles"]=True; s+=1
        except: pass
    sd=workspace/"slides"
    if sd.exists() and len(list(sd.glob("slide_*.png")))>=14:
        r["checks"]["per_slide_png"]=True; s+=1
    odp=workspace/"draft.odp"
    if odp.exists():
        try:
            with zipfile.ZipFile(odp) as z:
                content=z.read("content.xml").decode("utf-8",errors="ignore")
            if len(re.findall(r"<draw:circle", content))>=5:
                r["checks"]["odp_circles"]=True; s+=1
            if "Montserrat" in content or "Inter" in content:
                r["checks"]["fonts"]=True; s+=1
        except: pass
    log=workspace/"actions.log"
    if not log.exists() or "python-uno" not in log.read_text(errors="ignore"):
        r["checks"]["no_uno"]=True; s+=1

    # New: Master Slide check (master-page style with font + logo)
    if odp.exists():
        try:
            with zipfile.ZipFile(odp) as z:
                styles_xml = z.read("styles.xml").decode("utf-8", errors="ignore")
            if re.search(r"<style:master-page[^>]+>.+?Montserrat.+?</style:master-page>", styles_xml, re.DOTALL):
                r["checks"]["master_font_set"] = True; s += 1; t += 1
            if "<draw:image" in styles_xml or "logo" in styles_xml.lower():
                r["checks"]["master_logo"] = True; s += 1; t += 1
            # Animation paths
            if "presentation:animation" in content or "presentation:path" in content:
                r["checks"]["has_animation"] = True; s += 1; t += 1
            # Notes
            if content.count("<presentation:notes") >= 14:
                r["checks"]["notes_per_page"] = True; s += 1; t += 1
        except Exception: pass

    # PDF outline (bookmarks) check — only credit when outline actually exists
    if pdf.exists():
        try:
            n_outline = 0
            try:
                import pikepdf
                with pikepdf.open(str(pdf)) as pp:
                    n_outline = len(list(pp.open_outline().root))
            except Exception:
                n_outline = 0
            t += 1
            if n_outline >= 1:
                r["checks"]["pdf_outline"] = True; s += 1
            if n_outline >= 14:
                r["checks"]["pdf_outline_count"] = n_outline
        except Exception: pass

    # New: 4 Impress UI screenshots — check both workspace/ and workspace/results/
    rd_results = workspace
    rd_alt = workspace / "results"
    ui_shots = ["view_01_master_slide_edit.png","view_02_animation_dialog.png",
                "view_03_smart_alignment.png","view_04_export_pdf_dialog.png"]
    ui_present = sum(1 for n in ui_shots
                     if (rd_results/n).exists() or (rd_alt/n).exists())
    r["checks"]["impress_ui_shots"] = ui_present / len(ui_shots)
    s += ui_present / len(ui_shots); t += 1
    base = s/t
    try:
        from _judge_helper import vlm_score_rubric
    except Exception:
        vlm_score_rubric = None
    sd=workspace/"slides"
    slide_imgs = sorted(sd.glob("slide_*.png"))[:6] if sd.exists() else []
    if vlm_score_rubric and slide_imgs:
        rubric = {
            "vlm_consistent_style": "多张幻灯片在配色、字体、版式上保持一致的视觉风格",
            "vlm_no_overflow": "正文文本无明显溢出 / 截断 / 重叠图形的现象",
            "vlm_meaningful_visuals": "至少 2 张幻灯片含有有意义的图表/图标/插图(非空白页或纯文字堆砌)",
            "vlm_title_hierarchy": "每页标题字号明显大于正文,建立清晰的视觉层级",
        }
        vlm = vlm_score_rubric([str(p) for p in slide_imgs], rubric, instruction="评估 LibreOffice Impress pitch deck 的设计质量。")
        for k in rubric: r["checks"][k] = vlm.get(k, 0.0)
        r["judge_method"] = vlm.get("judge_method", "failed")
        vlm_avg = sum(vlm.get(k, 0.0) for k in rubric)/len(rubric)
        final = (base + vlm_avg) / 2
    else:
        # No VLM available → cap at 0.6 to prevent silent full-score on degraded judging
        final = min(base, 0.6)
        r["judge_method"] = r.get("judge_method", "no_vlm_capped")

    # Weighted re-aggregation: core (60%) + gui (30%) + aux (10%)
    core_keys = ["pages=14", "odp_circles", "fonts", "master_font_set",
                 "master_logo", "has_animation", "notes_per_page", "per_slide_png"]
    gui_keys  = ["impress_ui_shots", "no_uno"]
    aux_keys  = ["pdf_outline", "timeline_circles"]
    def _v(k):
        v = r["checks"].get(k, 0.0)
        return float(v) if isinstance(v, (int, float, bool)) else 0.0
    core = sum(_v(k) for k in core_keys) / len(core_keys)
    gui  = sum(_v(k) for k in gui_keys)  / len(gui_keys)
    aux  = sum(_v(k) for k in aux_keys)  / len(aux_keys)
    weighted = 0.6 * core + 0.3 * gui + 0.1 * aux
    final = min(final, max(weighted, 0.0) * 0.5 + final * 0.5)

    # Multi-layer hard gates
    if not (workspace / "pitch.pdf").exists():
        final = min(final, 0.30)
    if not r["checks"].get("pages=14"):
        final = min(final, 0.40)
    if not r["checks"].get("odp_circles"):
        final = min(final, 0.40)
    if not r["checks"].get("master_font_set"):
        final = min(final, 0.40)
    if not r["checks"].get("has_animation"):
        final = min(final, 0.50)
    if not r["checks"].get("notes_per_page"):
        final = min(final, 0.50)
    # GUI evidence gate: agent must have produced ≥ 3 of 4 UI screenshots
    if float(r["checks"].get("impress_ui_shots", 0.0)) < 0.75:
        final = min(final, 0.50)

    r["overall_score"] = round(float(max(0.0, final)), 3)
    return r

Workspace Path

workspace/DOC/task_1_impress_pitch_deck/

Skills


Env


Warmup

# 镜像 v3_eyeson_apps 已 baked: libreoffice-impress, poppler-utils, tesseract-ocr,
# fonts-liberation, python pdf2image/pytesseract/pikepdf/opencv-python-headless/Pillow/numpy
# 仅在 Montserrat / Inter 缺失时按需补字体(apt 行整体 || true,不阻塞 Warmup)
fc-list | grep -qi Montserrat || DEBIAN_FRONTEND=noninteractive apt-get install -y -qq fonts-montserrat || true
fc-list | grep -qi Inter || DEBIAN_FRONTEND=noninteractive apt-get install -y -qq fonts-inter || true
fc-cache -f >/dev/null 2>&1 || true