@feng0531/dsh-code-review 0.24.0 → 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # 变更记录
2
2
 
3
+ ## 0.24.1
4
+
5
+ - 历史上下文关系分别对基线/目标文本推断,标记contextSide/contextVersion;缺少oldText不回退目标正文。
6
+ - 避免旧import绑定新definition;263测试通过,不增读取调用。
7
+
3
8
  ## 0.24.0
4
9
 
5
10
  - 历史旧侧import/include导航未修改上下文,保留oldText/oldRevision/目标revision,context-old检索身份分离并校验来源。
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 当前状态
6
6
 
7
- 当前代码版本为 0.24.0
7
+ 当前代码版本为 0.24.1
8
8
 
9
9
  历史自动上下文也导航旧侧import/include,仅未修改且两侧普通blob;上下文oldText/oldRevision和目标revision明确,检索context-old单独身份,仍共用20文件总量及4MiB快照。旧侧独有/删除上下文暂不捕获,调用者覆盖仍不保证。
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feng0531/dsh-code-review",
3
- "version": "0.24.0",
3
+ "version": "0.24.1",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
@@ -4,6 +4,19 @@ import { inferImportRelations } from './import-relations.mjs';
4
4
  // Context entries are already sent with every primary. These annotations add
5
5
  // explanations only, never reads, group members, or reviewed coverage.
6
6
  export function inferContextRelations(input, file) {
7
+ if (input.history) {
8
+ const relations=[];
9
+ for (const side of ['old','new']) {
10
+ const contexts=(input.context ?? []).filter(c=>side==='new'||typeof c.oldText==='string').map(c=>({...c,text:side==='old'?c.oldText:c.text}));
11
+ const text=side==='old'?file.left.text:file.right.text;
12
+ // Infer each version independently: never bind an old import to target definitions.
13
+ const one={...file,left:{...file.left,text:''},right:{...file.right,text}};
14
+ const version=side==='old'?input.history.base:input.history.target;
15
+ const scoped={...input,history:undefined,context:contexts};
16
+ relations.push(...inferContextRelations(scoped,one).filter(e=>e.side!=='old').map(e=>({...e,side:e.fromPath===file.path?side:side==='old'?'context-old':'context',contextVersion:version,contextSide:side})));
17
+ }
18
+ return relations.slice(0,2000);
19
+ }
7
20
  const paths = new Set(input.files.map(f => f.path));
8
21
  const contexts = (input.context ?? []).filter(c => !paths.has(c.path));
9
22
  const primary = { ...file, id: 'primary' };