Skip to content

fix(prompts): preserve scoped instruction context#194

Open
RerankerGuo wants to merge 1 commit into
TencentCloud:mainfrom
RerankerGuo:fix/scoped-instruction-prompts
Open

fix(prompts): preserve scoped instruction context#194
RerankerGuo wants to merge 1 commit into
TencentCloud:mainfrom
RerankerGuo:fix/scoped-instruction-prompts

Conversation

@RerankerGuo

Copy link
Copy Markdown

Description | 描述

Preserve explicit scene/context limits when L1 extracts or deduplicates instruction memories.

This is a conservative first step for scoped instructions:

  • Tells L1 extraction to keep explicit applicability conditions in content instead of generalizing them into unconditional global rules.
  • Tells conflict detection to compare instruction scope during merge/update and preserve all still-valid scope qualifiers in merged_content.
  • Adds focused prompt tests so these guardrails stay in place.

This avoids a schema/storage migration while addressing the over-generalization path described in the issue.

Related Issue | 关联 Issue

Fix #48

Change Type | 修改类型

  • Bug fix | Bug 修复
  • New feature | 新功能
  • Documentation update | 文档更新
  • Code optimization | 代码优化

Self-test Checklist | 自测清单

  • Verified locally | 本地验证通过
  • No existing features affected | 无影响现有功能

Additional Notes | 其他说明

Verified with npm test and npm run build using Node v24.15.0.

Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Nice to see a careful approach to handling scoped instructions. Preserving applicability conditions on extraction is a smart way to avoid over-generalization without a migration. We'll review it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] L1 指令提取缺少场景限定机制,用户的场景受限偏好被泛化为全局规则

2 participants