Skip to content

polish: refine ROLE_BLOCK to preserve user intent#410

Merged
appergb merged 1 commit into
betafrom
pr/polish-role-block-refine
May 11, 2026
Merged

polish: refine ROLE_BLOCK to preserve user intent#410
appergb merged 1 commit into
betafrom
pr/polish-role-block-refine

Conversation

@appergb
Copy link
Copy Markdown
Collaborator

@appergb appergb commented May 11, 2026

User description

Summary

  • 把 polish 提示词的 ROLE_BLOCK 从 "严苛不允许" 语气改回贴近用户原意的整理姿态
  • 先分析用户意图,再贴合用户原本句子做语法整理与必要的结构化,让最终结果就是用户真正想表达的内容
  • 措辞优先用原句字面词;理解到的意图用来贴近原话,而不是替用户重写或扩写
  • 转写里有未解决的问题或待确认事项,全部列为条目保留,不省略也不替用户判断
  • 用户意图难以判断时不强行推断,改为只做句子层面的整理(标点 / 断句 / 口癖去除)

行为差异

相对于已发布版本,新增 "列出未解决问题" 规则;将 "补充功能清单" 那条合并到新的 "列为条目保留" 语义里。

Test plan

  • `cargo check` pass(纯字符串改动)
  • 真机回归:raw / light / structured / formal 四个 mode 在以下 case 各跑一遍:
    • 用户口述一个带未解决问题的需求 → 验证问题被列为条目
    • 用户口述含口癖 + 半截句子 → 验证只做必要语法整理,不扩写
    • 用户口述意图模糊的零碎想法 → 验证不强行推断,只做句子整理

PR Type

Enhancement


Description

  • Prioritize user intent before polishing

  • Preserve questions and unresolved items

  • Avoid inventing extra details

  • Fallback to sentence-level cleanup


Diagram Walkthrough

flowchart LR
  A["ROLE_BLOCK prompt"]
  B["Understand user intent"]
  C["Preserve original wording"]
  D["Keep unresolved items as bullets"]
  E["Sentence-level cleanup only"]
  A -- "revised guidance" --> B
  B -- "then polish" --> C
  A -- "retain" --> D
  A -- "if unclear" --> E
Loading

File Walkthrough

Relevant files
Enhancement
polish.rs
Rework polishing prompt to preserve intent                             

openless-all/app/src-tauri/src/polish.rs

  • Rewrites ROLE_BLOCK to first understand user intent, then polish the
    original wording.
  • Adds explicit rules to keep questions, tasks, and unresolved issues as
    preserved items.
  • Strengthens guardrails against inventing facts, fields, implementation
    details, or feature lists.
  • Clarifies fallback behavior: when intent is unclear, only do
    sentence-level cleanup.
+9/-4     

把 polish 提示词从"严苛不允许"语气改回贴近用户原意的整理姿态:

- 先分析用户意图,再贴合原本句子做语法整理与必要的结构化
- 措辞优先用原句字面词;理解到的意图用来贴近原话,而不是替用户重写或扩写
- 不创作 / 不补充用户没说过的内容
- 转写里若有未解决问题或待确认事项,全部列为条目保留,不省略也不替用户判断
- 用户意图难以判断时不强行推断,改为只做句子层面整理(标点 / 断句 / 口癖去除)
- 不引用任何会话历史 / 外部知识 / 模型记忆,每次请求独立任务

行为差异:相对于已发布版本,新增"列出未解决问题"规则;移除"补充功能清单"
那一条(与新的"列为条目保留"语义已经覆盖)。
@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@appergb appergb merged commit 051e058 into beta May 11, 2026
4 checks passed
@appergb appergb deleted the pr/polish-role-block-refine branch May 11, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant