feat(style-pack): 清晰结构 v3.0 Beta 提示词 + 内置包版本对账(推向所有用户) - #885
Merged
Conversation
added 2 commits
August 3, 2026 11:54
- STRUCTURED_BUILTIN_PROMPT 替换为 Beta 版:语修人格(性格/身体/习惯/梦想/职责/能力/规则) + 场景优先级分型(操作指引/编程任务/模型资讯)+ ASR 术语纠错词表 + 反 AI 自述式表达约束 - 内置包版本 2.0.0 → 3.0.0;默认风格包由 light 改为 structured(与 UI 层一致) - 同步 TS mock 的 structured prompt;polish 契约测试更新为新 Beta 锚点
- load 时对内置包做版本对账:代码内置包 version 更高则用官方副本覆盖本地 (保留用户 enabled 设置),本地缺失的内置包自动补入 - 老用户的「清晰结构」包在升级后自动拿到 v3.0 Beta 提示词,无需手动重置
Contributor
PR Reviewer Guide 🔍(Review updated until commit 3318eb2)Here are some key observations to aid the review process:
|
- reconcile 不再整包替换:只推进官方 prompt 与 version,用户的名称/描述/示例/ tags/enabled 全部保留(审核意见) - pack_version_newer 正确处理 pre-release 后缀(-beta 视为与正式版同级) - 补 3 个单测:版本比较 / prompt-only 推进保留用户字段 / 等版本跳过 + 缺失补入 - 默认包 fallback(get_or_default_active)改为优先清晰结构;更新过期注释
Contributor
|
Persistent review updated to latest commit 3318eb2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
目标(一个 PR,两个按职责拆分的 commit)
STRUCTURED_BUILTIN_PROMPT替换为 Beta 版——人格化「语修」角色(性格/身体/习惯/梦想/职责/能力/规则)+ 场景优先级分型(操作指引 / 编程任务 / 模型资讯)+ ASR 术语纠错词表 + 反 AI 自述式表达约束兼容性影响
{{HOTWORDS}}占位符,与既有 compose_system_prompt 热词注入机制兼容测试命令与结果
cargo test --manifest-path src-tauri/Cargo.toml --lib✅ 846 passed / 0 failed(含更新后的 polish 契约测试 + style_pack 测试)npx tsc --noEmit✅证据
reconcile_builtin_packs版本比较 + 覆盖(保留 enabled)链接
PR Type
Enhancement, Tests
Description
上线「清晰结构」v3.0 Beta 提示词:人格化「语修」角色 + 场景优先级分型
新增内置包版本对账:官方高版本仅推进 prompt/version,保留用户自定义
默认风格包由 light 改为 structured,TS mock 与契约测试同步
补充版本比较与对账单元测试,更新 polish 契约锚点
Diagram Walkthrough
File Walkthrough
style_pack.rs
内置包版本对账与默认包回退openless-all/app/src-tauri/src/persistence/style_pack.rs
reconcile_builtin_packs,load 时对内置包做版本对账prompt与version,保留用户字段与enabledpack_version_newer,按数值分段比较并忽略 pre-release 后缀default_active_style_pack_id()types.rs
上线清晰结构 v3.0 Beta 内置提示词openless-all/app/src-tauri/src/types.rs
light改为structured(清晰结构)STRUCTURED_BUILTIN_PROMPT整体替换为 v3.0 Beta:语修人格、场景优先级、ASR 词表、反 AI自述约束、新示例
mock-data.ts
同步前端 mock structured 提示词openless-all/app/src/lib/ipc/mock-data.ts
style_pack_tests.rs
补充版本对账相关单元测试openless-all/app/src-tauri/src/persistence/style_pack_tests.rs
pack_version_newer数值比较单测,覆盖 pre-release 场景enabledpolish.rs
更新结构化提示词契约测试锚点openless-all/app/src-tauri/src/polish.rs