File size: 19,405 Bytes
71e9dba | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | ---
id: DOC_task_3_xmind_brainstorm
name: Xmind 思维导图视觉脑暴
category: DOC
timeout_seconds: 1200
---
<!--
resources:
- name: topic.md
source: hand-written brainstorm scaffold ("如何把开源项目做成 SaaS 商业化")
license: CC0
downloaded: exec/topic.md
description: 38-line topic outline — 1 central + 6 first-level branches × 4 sub-items each, expandable to >=50 nodes / 4 layers. See exec/README.md.
- name: inputs/*.md
source: self-written placeholder reference notes (pricing/compliance/community/docs)
license: self-written
downloaded: exec/inputs/
description: 4 placeholder markdown files used as hyperlink targets in the mind map.
- name: inputs/diagram.png
source: self-written placeholder PNG
license: self-written
downloaded: exec/inputs/diagram.png
description: placeholder PNG used as XMind attachment target.
- name: inputs/data.csv
source: self-written placeholder CSV
license: self-written
downloaded: exec/inputs/data.csv
description: placeholder CSV used as XMind attachment target.
-->
## Prompt
> ⚙️ **Execution contract**: this task is graded on deliverable files — **no human is reviewing**. Execute directly, produce the files, do not write "let me know if you'd like me to continue" style follow-up questions, and **do not run git commit** (git is not inspected). All deliverables must land in the **`/tmp_workspace/` root**: `mindmap.xmind` / `mindmap.png` / `mindmap.md` / `view_01_main.png` / `view_02_notes.png` / `view_03_icons.png` / `view_04_format.png` / `view_05_relationship.png`. When done, self-check with `ls -la /tmp_workspace/` before exiting.
Background: `/tmp_workspace/topic.md` provides the topic "How to commercialize an open-source project as SaaS". Reference materials are under `/tmp_workspace/inputs/` (4 `.md` reference docs + `diagram.png` + `data.csv`).
Goal: based on that topic, build a mind map with icons / notes / cross-branch relationships / hyperlinks / attachments / custom styles, and export it as `.xmind` / `.png` / `.md` plus 5 working-process screenshots.
### Hard constraints for `mindmap.xmind`
An `.xmind` file is essentially a zip containing `content.json` (topology) + an optional `attachments/` directory. After unzipping, the following must be detectable in `content.json`:
- Total nodes ≥ **50**
- First-level branches (direct children of the central node) ≥ **6**, e.g.: Pricing / Customer Success / Compliance / Community / Documentation / Sales
- Tree depth ≥ **4** layers
- **Icons**: each of three categories must appear on at least one node:
- "Risk" type: `⚠️` or the literal `warning`
- "Opportunity" type: `💡` or the literal `lightbulb`
- "Validated" type: `✅` or the literal `check`
- **Notes**: ≥ 8 nodes carry Notes, each ≥ 30 characters, total length ≥ 240 characters
- **Cross-branch Relationships**: ≥ 5 curved relationships, each carrying `end1Id` / `end2Id` pointing to two existing topic ids, plus a text label (e.g. "Pricing↔Compliance", "Sales↔Customer Success")
- **Hyperlinks**: ≥ 4 nodes carry an `xlink:href` or `href` attribute pointing at the reference docs under `/tmp_workspace/inputs/<topic>.md`
- **Attachments**: ≥ 2 nodes have attachments (recommend attaching `inputs/diagram.png` and `inputs/data.csv`), and the zip must contain real binary entries under `attachments/`
- **Custom styling**: ≥ 6 first-level branches use distinct fill colors / border styles; at least 2 styling-related fields must be detectable in content.json (e.g. `boundary` / `branch` / `customSvgPath` / `shape-class` / `fill`)
- Reopening the `.xmind` must render correctly (nodes / relationships / attachments must not be corrupted)
### Companion deliverables (in `/tmp_workspace/`)
| File | Requirement |
|---|---|
| `mindmap.png` | Full-map PNG export, resolution **≥ 2400 × 1600**, file size ≥ 20 KB |
| `mindmap.md` | Outline-style markdown export, indentation depth ≥ 4 levels (2 spaces per level) |
### 5 working-process screenshots (in `/tmp_workspace/`)
Fixed file names:
| # | File name | Content |
|---|---|---|
| 1 | `view_01_main.png` | Mind map main canvas |
| 2 | `view_02_notes.png` | Notes panel |
| 3 | `view_03_icons.png` | Icons / icon picker |
| 4 | `view_04_format.png` | Format / styling panel |
| 5 | `view_05_relationship.png` | Drawing a relationship line |
Each screenshot must:
- be ≥ 5 KB and have resolution ≥ 1280 × 720
- all 5 must have distinct md5 hashes
- visually show a real, readable mind-map tool UI (OCR checks are applied)
## Expected Behavior
设计意图与典型解题路径(仅供出题人参考,不发给 agent):
1. 推荐用 Xmind GUI(容器内 `/opt/Xmind/Xmind`)打开主题 → 建中心节点 → 拓出 6+ 一级分支(定价 / 客户成功 / 合规 / 社区维护 / 文档 / 销售)→ 每个一级分支下展开 ≥ 2 层子节点,总数 ≥ 50。
2. 关键节点上图标用 Xmind 内置 icon picker 选 ⚠️ / 💡 / ✅;如果走 CLI 拼 .xmind,可直接在 content.json 里塞 `warning` / `lightbulb` / `check` 字面量。
3. 选 8 个节点用 Notes 面板写备注,每条 ≥ 30 字,总长 ≥ 240 字。
4. 用 XMind 的 "Add Relationship"(右键菜单)在跨主分支的两节点间画曲线,例如"定价↔合规"、"销售↔客户成功",至少 5 条。CLI 拼 zip 时记得在 content.json 里加 `relationships` 数组,每条含 `end1Id` / `end2Id` 指向真实 topic id + 文字标签。
5. Insert → Hyperlink 给 4 个节点链 `/tmp_workspace/inputs/<topic>.md`(4 篇参考)。XMind 把这些存成 `xlink:href` 属性。
6. Insert → Attachment 给 2 个节点挂 `inputs/diagram.png` / `inputs/data.csv`;附件二进制会进 .xmind zip 的 `attachments/` 目录。
7. Format Panel 给 6 个一级分支配不同颜色 + 边框样式。XMind 的样式定义会写到 content.json 的 `boundary` / `branch` 等字段。
8. File → Export 把图导成 PNG(分辨率 ≥ 2400×1600)+ Markdown 大纲(缩进 ≥ 4 级)。
9. 截 5 张工作过程截图:主界面 / Notes 面板 / Icon picker / Format panel / Relationship 绘制动作。
约束说明:
- 重新打开 .xmind 能正常渲染 —— relationships 的 `end1Id`/`end2Id` 必须指向已存在的 topic id,错指会让 XMind 崩溃
- 图标用 emoji 字符或 XMind 内置 icon 都行(grader 检 emoji 字符与 `warning`/`lightbulb`/`check` 字面量),不要用自定义贴图
评分要点(hard gates):
- `mindmap.xmind` 不存在 / 解析失败 → 总分 cap 0.30
- 节点数 < 30(即 < 50 × 60%)→ cap 0.40
- relationships 数 < 3(即 < 5 × 60%)→ cap 0.45
- hyperlinks 数 < 2(即 < 4 × 50%)→ cap 0.50
- 没有 attachments → cap 0.55
- 截图 OCR 命中 "Xmind/XMind" 数 < 2(即 < 5 × 40%)→ cap 0.35
- 5 张截图 md5 不唯一率 < 60% → cap 0.45
- 截图分辨率 < 1280×720 比例 < 40% → cap 0.50
- mindmap.png 分辨率不达 2400×1600 → cap 0.60
- VLM 视觉评分 < 0.4 → cap 0.45
- VLM 不可用 → cap 0.60
## Source
- Reddit: https://www.reddit.com/r/productivity/comments/1bxxxxx/llm_mindmap_visual/
- 原文引用:「LLM gives me bullet outlines but a real mind map needs canvas-level drag, icons, cross-links. Xmind GUI is essential.」
- 对应 benchmark case: 创意整理 / DOC 新增
## Grading Criteria
加权聚合:**core 60% / gui 30% / aux 10%**,再与 VLM 视觉评分 65/35 混合(VLM 不可用时整体上限 0.60)。
**Core(结构 60%)**
- [ ] `mindmap.xmind` 存在且 ≥ 2KB,content.json 可解析
- [ ] 节点总数 ≥ 50(hard gate:< 30 → cap 0.40)
- [ ] 一级分支 ≥ 6
- [ ] 树深 ≥ 4 层
- [ ] ⚠️/💡/✅ 三种图标各 ≥ 1 次(warning/lightbulb/check 同义)
- [ ] Notes:总长度 ≥ 240 字 **且** 至少 8 条独立 notes
- [ ] Relationships ≥ 5 条,含 `end1Id`+`end2Id` 配对(hard gate:< 3 条 → cap 0.45)
- [ ] Hyperlinks ≥ 4 个,优先匹配 `inputs/*.md`(hard gate:< 2 → cap 0.50)
- [ ] Attachments:.xmind 内含非空 `attachments/` 条目(hard gate:缺失 → cap 0.55)
- [ ] 自定义样式关键词(boundary / branch / customSvgPath / shape-class / fill)至少命中 2 类
**GUI 真实证据(30%)**
- [ ] 5 张截图 `view_01..view_05` 文件 ≥ 5KB(hard gate:< 40% 大小达标 → cap 0.50)
- [ ] OCR 命中 "Xmind/XMind" 比例(hard gate:< 40% → cap 0.35)
- [ ] 分辨率 ≥ 1280×720 比例
- [ ] md5 唯一比例(hard gate:< 60% 唯一 → cap 0.45,防同图复用)
**Aux(10%)**
- [ ] `mindmap.png` 分辨率 ≥ 2400×1600(不达标 → cap 0.60)
- [ ] `mindmap.md` 至少 4 级缩进
**VLM 视觉评分(rubric 6 项)**:辐射布局 / ≥6 主分支 / 子层 ≥3 / 图标装饰 / 视觉清晰 / 非占位(VLM < 0.4 → cap 0.45)
## Automated Checks
```python
from pathlib import Path
import zipfile, json, re, hashlib
try:
import pytesseract
except Exception:
pytesseract = None
from PIL import Image
def grade(workspace_path=None, **kwargs):
workspace = Path(workspace_path) if workspace_path else Path("/tmp_workspace")
r = {"checks": {}, "overall_score": 0.0}
core = {} # 核心交付:xmind 结构 / 产物文件
gui = {} # GUI 真实证据:截图 OCR / 唯一性 / 分辨率 / 大小
aux = {} # 辅助:md 大纲 / png 大图
xm = workspace / "mindmap.xmind"
nodes_total = 0; l1_count = 0; rel_entries = 0; link_entries = 0
has_attach = False; notes_total_len = 0; notes_count = 0
icons_hit = 0; styling_hits = 0
if xm.exists() and xm.stat().st_size >= 2048:
try:
with zipfile.ZipFile(xm) as z:
cj = json.loads(z.read("content.json").decode())
names = z.namelist()
has_attach = any(n.startswith("attachments/") and not n.endswith("/") for n in names)
def walk(n, d=0, acc=None):
if acc is None: acc = []
acc.append((n.get("title", ""), d))
for c in (n.get("children", {}).get("attached") or []):
walk(c, d + 1, acc)
return acc
nodes = walk(cj[0]["rootTopic"])
nodes_total = len(nodes)
l1_count = sum(1 for _, d in nodes if d == 1)
max_depth = max((d for _, d in nodes), default=0)
txt = json.dumps(cj, ensure_ascii=False)
core["nodes>=50"] = 1.0 if nodes_total >= 50 else nodes_total / 50.0
core["l1>=6"] = 1.0 if l1_count >= 6 else l1_count / 6.0
core["depth>=4"] = 1.0 if max_depth >= 3 else max_depth / 3.0 # depth index 0..3 == 4 layers
for grp in (["warning", "lightbulb", "check"], ["⚠", "💡", "✅"]):
if all(em in txt for em in grp):
icons_hit = 1; break
core["icons_3_kinds"] = float(icons_hit)
notes = re.findall(r'"notes":\s*\{[^}]*?"plain":\s*\{[^}]*?"content":\s*"([^"]+)"', txt)
notes_count = len(notes)
notes_total_len = sum(len(n) for n in notes)
# Stricter: need both length AND count
core["notes_quality"] = 1.0 if (notes_total_len >= 240 and notes_count >= 8) else \
min(notes_total_len / 240.0, notes_count / 8.0)
rel_entries = len(re.findall(r'"end1Id"\s*:\s*"[^"]+"\s*,\s*"end2Id"\s*:\s*"[^"]+"', txt))
if rel_entries == 0:
rel_entries = len(re.findall(r'"id"\s*:\s*"[A-Za-z0-9_\-]+"[^}]*"end1Id"', txt))
core["relationships>=5"] = 1.0 if rel_entries >= 5 else rel_entries / 5.0
link_entries = len(re.findall(r'"(?:xlink:)?href"\s*:\s*"[^"]*inputs/[^"]*\.md"', txt))
if link_entries == 0:
link_entries = len(re.findall(r'"(?:xlink:)?href"\s*:\s*"[^"]+"', txt))
core["hyperlinks>=4"] = 1.0 if link_entries >= 4 else link_entries / 4.0
core["attachments>=1"] = 1.0 if has_attach else 0.0
for kw in ('"boundary"', '"branch"', '"customSvgPath"', '"shape-class"', '"fill"'):
if kw in txt: styling_hits += 1
core["custom_styling"] = 1.0 if styling_hits >= 2 else styling_hits / 2.0
except Exception as e:
r["checks"]["xmind_err"] = str(e)[:200]
core["xmind_parse"] = 0.0
else:
core["xmind_present"] = 0.0
# mindmap.png 分辨率
png = workspace / "mindmap.png"
if png.exists() and png.stat().st_size >= 20 * 1024:
try:
w, h = Image.open(png).size
aux["png_res>=2400x1600"] = 1.0 if (w >= 2400 and h >= 1600) else \
min(w / 2400.0, h / 1600.0)
except Exception:
aux["png_res>=2400x1600"] = 0.0
else:
aux["png_res>=2400x1600"] = 0.0
# mindmap.md 大纲缩进深度
md = workspace / "mindmap.md"
if md.exists() and md.stat().st_size >= 256:
try:
c = md.read_text(errors="ignore")
depths = set()
for line in c.splitlines():
m = re.match(r"^( *)[-*]", line)
if m: depths.add(len(m.group(1)) // 2)
max_md_depth = max(depths, default=0)
aux["md_depth>=4"] = 1.0 if max_md_depth >= 3 else max_md_depth / 3.0
except Exception:
aux["md_depth>=4"] = 0.0
else:
aux["md_depth>=4"] = 0.0
# GUI 截图:OCR + md5 唯一 + 分辨率 + 文件大小(防 cheat)
screen_names = ["view_01_main.png", "view_02_notes.png", "view_03_icons.png",
"view_04_format.png", "view_05_relationship.png"]
ocr_ok = 0; res_ok = 0; size_ok = 0
md5s = []
for n in screen_names:
p = workspace / n
if not p.exists(): continue
sz = p.stat().st_size
if sz < 5 * 1024: continue # < 5KB 视为占位
size_ok += 1
try:
md5s.append(hashlib.md5(p.read_bytes()).hexdigest())
except Exception:
pass
try:
im = Image.open(p)
w, h = im.size
if w >= 1280 and h >= 720: res_ok += 1
tx = pytesseract.image_to_string(im) if pytesseract else ""
if any(k in tx for k in ("Xmind", "XMind")) or "xmind" in tx.lower():
ocr_ok += 1
except Exception:
pass
uniq = len(set(md5s))
gui["screens_ocr"] = ocr_ok / 5.0
gui["screens_size_ok"] = size_ok / 5.0
gui["screens_res>=720p"] = res_ok / 5.0
gui["screens_md5_unique"] = uniq / 5.0
# 写回 checks
r["checks"].update({f"core.{k}": v for k, v in core.items()})
r["checks"].update({f"gui.{k}": v for k, v in gui.items()})
r["checks"].update({f"aux.{k}": v for k, v in aux.items()})
r["checks"]["_meta"] = {
"nodes": nodes_total, "l1": l1_count, "rels": rel_entries,
"links": link_entries, "attach": has_attach,
"notes_len": notes_total_len, "notes_n": notes_count,
"screens_md5_unique": uniq, "screens_ocr_ok": ocr_ok,
}
# 加权聚合:core 60% / gui 30% / aux 10%
def avg(d): return sum(d.values()) / len(d) if d else 0.0
core_avg = avg(core); gui_avg = avg(gui); aux_avg = avg(aux)
base = 0.6 * core_avg + 0.3 * gui_avg + 0.1 * aux_avg
# VLM 评分
try:
from _judge_helper import vlm_score_rubric
except Exception:
vlm_score_rubric = None
vlm_avg = None
if vlm_score_rubric and png.exists() and png.stat().st_size >= 20 * 1024:
rubric = {
"vlm_radial_layout": "图像呈中心节点向外辐射的思维导图布局,非线性列表",
"vlm_branch_count": "中心至少向外伸展 6 条主分支",
"vlm_subtopic_depth": "至少有部分分支展开到 ≥3 层子主题(非全部止于一级)",
"vlm_icon_decorations": "节点上含图标装饰(⚠/💡/✅ 等),用以表示属性",
"vlm_visual_clarity": "整体连线清晰、文字不重叠、可一眼读懂结构",
"vlm_no_placeholder": "图片不是 1×1 占位、不是纯白/纯黑、不是无内容截屏",
}
try:
vlm = vlm_score_rubric([str(png)], rubric,
instruction="严格评估 XMind 思维导图的结构质量;占位/空白图给 0。")
except Exception:
vlm = {}
for k in rubric: r["checks"][f"vlm.{k}"] = vlm.get(k, 0.0)
r["judge_method"] = vlm.get("judge_method", "failed")
if r["judge_method"] != "failed":
vlm_avg = sum(vlm.get(k, 0.0) for k in rubric) / len(rubric)
if vlm_avg is not None:
score = 0.65 * base + 0.35 * vlm_avg
else:
# VLM 不可用:上限封顶 0.6(不能让无 VLM 也满分)
score = min(base, 0.60)
r["checks"]["vlm_unavailable_cap"] = 0.60
# —— 多层 hard gate(越严越好)——
# 1. 核心 xmind 文件不存在或解析失败 → cap 0.30
if not xm.exists() or core.get("xmind_parse", 1.0) == 0.0 or core.get("xmind_present") == 0.0:
score = min(score, 0.30)
# 2. 节点数严重不足 → cap 0.40
if core.get("nodes>=50", 0) < 0.6:
score = min(score, 0.40)
# 3. relationships 严重不足 → cap 0.45
if core.get("relationships>=5", 0) < 0.6:
score = min(score, 0.45)
# 4. hyperlinks 不达标 → cap 0.50
if core.get("hyperlinks>=4", 0) < 0.5:
score = min(score, 0.50)
# 5. attachments 不达标 → cap 0.55
if core.get("attachments>=1", 0) < 1.0:
score = min(score, 0.55)
# 6. GUI 截图 OCR 严重缺失 → cap 0.35(agent 没真用 Xmind GUI)
if gui.get("screens_ocr", 0) < 0.4:
score = min(score, 0.35)
# 7. 截图 md5 重复(同一张图复用)→ cap 0.45
if gui.get("screens_md5_unique", 0) < 0.6:
score = min(score, 0.45)
# 8. 截图分辨率全是缩略图(占位)→ cap 0.50
if gui.get("screens_res>=720p", 0) < 0.4:
score = min(score, 0.50)
# 9. mindmap.png 分辨率不达标 → cap 0.60
if aux.get("png_res>=2400x1600", 0) < 1.0:
score = min(score, 0.60)
# 10. VLM 视觉评分极低 → cap 0.45(即使有截图也判画面不像 mindmap)
if vlm_avg is not None and vlm_avg < 0.4:
score = min(score, 0.45)
r["overall_score"] = round(max(0.0, min(1.0, score)), 3)
r["weights"] = {"core": 0.6, "gui": 0.3, "aux": 0.1, "vlm_blend": 0.35 if vlm_avg is not None else None}
return r
```
## Workspace Path
`workspace/DOC/task_3_xmind_brainstorm/`
## Skills
```
```
## Env
```
```
## Warmup
```bash
which xmind >/dev/null 2>&1 || [ -x /opt/Xmind/Xmind ] || apt-get install -y -qq xmind || true
[ -x /opt/Xmind/Xmind ] || { curl -fsSL -o /tmp/xmind.deb 'https://xmind.app/zen/download/linux_deb/' && [ "$(stat -c%s /tmp/xmind.deb 2>/dev/null || echo 0)" -gt 50000000 ] && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq /tmp/xmind.deb || echo "WARN: xmind install failed"; } || true
which xmind >/dev/null 2>&1 || ln -sf /opt/Xmind/Xmind /usr/local/bin/xmind 2>/dev/null || true
which tesseract >/dev/null 2>&1 || apt-get install -y -qq tesseract-ocr || true
python3 -c "import pytesseract, PIL" 2>/dev/null || pip install -q pytesseract pillow || true
```
|