diff --git a/paperforge/skills/paperforge/SKILL.md b/paperforge/skills/paperforge/SKILL.md index b4dab353..d26e759c 100644 --- a/paperforge/skills/paperforge/SKILL.md +++ b/paperforge/skills/paperforge/SKILL.md @@ -8,6 +8,7 @@ description: > "讨论" "记录阅读" "记录工作" "总结会话" "提取方法论" "记一下" "保存这次" "找证据" "找75 Hz" "找支持" "collection" "库里". source: paperforge +version: 1.5.9 --- # PaperForge — Research Memory Runtime @@ -45,6 +46,7 @@ bootstrap 现在也返回一个 `capabilities` 块(rg, semantic, metadata 等 **进入任何 molecule 之前,必须完成以下检查。标记为 `[x]` 后才可前进。** - [ ] **bootstrap completed**:`$VAULT`、`$PYTHON`、`$LIT_DIR`、`$SKILL_DIR` 已定义 +- [ ] **version match**:`$PYTHON -m paperforge --version` 输出的版本号与 SKILL.md frontmatter 的 `version` 字段一致;不一致时提示用户运行 `paperforge update` - [ ] **capabilities**:已读取 `capabilities` 块中的 `rg`、`metadata_search`、`paper_context`、`semantic_enabled`、`semantic_ready` - [ ] **runtime-health passed**:`safe_read`、`safe_write` 已知,vector 状态已知 - [ ] **intent identified**:用户意图已映射到一个顶层 research intent diff --git a/paperforge/skills/paperforge/scripts/pf_bootstrap.py b/paperforge/skills/paperforge/scripts/pf_bootstrap.py index 4b4ab46b..85dec80e 100644 --- a/paperforge/skills/paperforge/scripts/pf_bootstrap.py +++ b/paperforge/skills/paperforge/scripts/pf_bootstrap.py @@ -35,6 +35,12 @@ import subprocess import sys from pathlib import Path +try: + import paperforge + SKILL_VERSION = paperforge.__version__ +except Exception: + SKILL_VERSION = "unknown" + def _find_paperforge_json(start: Path) -> Path | None: current = start.resolve() @@ -288,6 +294,7 @@ def main() -> None: } result["ok"] = True + result["skill_version"] = SKILL_VERSION json.dump(result, sys.stdout, ensure_ascii=False, indent=2) diff --git a/tests/test_pf_bootstrap_capabilities.py b/tests/test_pf_bootstrap_capabilities.py index b3a403ff..c3a165bc 100644 --- a/tests/test_pf_bootstrap_capabilities.py +++ b/tests/test_pf_bootstrap_capabilities.py @@ -75,3 +75,8 @@ def test_bootstrap_capabilities_contract(tmp_path: Path) -> None: assert "semantic_ready" in caps, "capabilities.semantic_ready missing" assert isinstance(caps["semantic_ready"], bool), "capabilities.semantic_ready must be bool" + + # Skill version + sv = output.get("skill_version") + assert sv is not None, "skill_version missing from bootstrap output" + assert isinstance(sv, str) and sv != "unknown", f"skill_version invalid: {sv}"