dsh-lean-router 0.2.5 → 0.2.6

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/cordis.patch.yml CHANGED
@@ -108,7 +108,9 @@
108
108
  from files with grep/scripts instead of re-reading them into context. Keep NOTES short and
109
109
  factual (<=60 lines).
110
110
  9. Author incrementally: create a file once (skeleton), then extend it with edit. Never re-emit an
111
- unchanged file. After two failed shell patches, switch to the editor.
111
+ unchanged file. After two failed shell patches, switch to the editor. Tool-call arguments are
112
+ ~42% of this history and are re-read every turn: prefer edit over a whole-file write, never paste
113
+ back content you already have on disk, and keep subagent briefs short - they are history forever.
112
114
 
113
115
  SAFETY
114
116
  10. Honour scope literally (a new project means do not read or copy old-project files). Use
@@ -647,7 +649,9 @@
647
649
  from files with grep/scripts instead of re-reading them into context. Keep NOTES short and
648
650
  factual (<=60 lines).
649
651
  9. Author incrementally: create a file once (skeleton), then extend it with edit. Never re-emit an
650
- unchanged file. After two failed shell patches, switch to the editor.
652
+ unchanged file. After two failed shell patches, switch to the editor. Tool-call arguments are
653
+ ~42% of this history and are re-read every turn: prefer edit over a whole-file write, never paste
654
+ back content you already have on disk, and keep subagent briefs short - they are history forever.
651
655
 
652
656
  SAFETY
653
657
  10. Honour scope literally (a new project means do not read or copy old-project files). Use
@@ -1,6 +1,17 @@
1
1
  # Changelog
2
2
 
3
- > English version of [changelog.md](./changelog.md). Versions follow package.json (currently 0.2.5).
3
+ > English version of [changelog.md](./changelog.md). Versions follow package.json (currently 0.2.6).
4
+
5
+ ## 0.2.6 (2026-11-30)
6
+
7
+ ### Changed
8
+
9
+ - **The authoring cost is now measured and turned into a persona rule**: on the current session surface of 452,094 characters, **tool-call arguments account for 42.4%** (`pwsh` 79,081, `edit` 44,987, `write` 41,782, `subagent` 14,837), while tool results are only 17.9%, injected reminders 22.4% and assistant prose 7.4%. The most expensive part of the history is what the model itself typed into arguments, not what the tools returned — there is no cheap code fix for that, only discipline.
10
+ - Rule 9 grew from "author incrementally" into an executable constraint: prefer `edit` over rewriting a whole file, never paste back content that is already on disk, and keep subagent briefs short because they stay in history forever. The persona suffix moves from 4130 to 4356 characters and the test ceiling is relaxed to 4450.
11
+
12
+ ### Tests
13
+
14
+ - Fragment indentation was corrected so it matches the module character for character again; the full suite is 279 tests, 278 passing, 0 failing, 1 skipped, and `build --check` passes.
4
15
 
5
16
  ## 0.2.5 (2026-11-30)
6
17
 
package/docs/changelog.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # 变更记录(changelog)
2
2
 
3
- > 中文为主,英文版:[changelog.en.md](./changelog.en.md)。版本号遵循 package.json(当前 0.2.5)。
3
+ > 中文为主,英文版:[changelog.en.md](./changelog.en.md)。版本号遵循 package.json(当前 0.2.6)。
4
+
5
+ ## 0.2.6 (2026-11-30)
6
+
7
+ ### 变更
8
+
9
+ - **量化了「作者成本」并写进 persona 规则**:实测当前会话表面 452,094 字符里,**工具调用参数占 42.4%**(`pwsh` 79,081、`edit` 44,987、`write` 41,782、`subagent` 14,837),工具结果只占 17.9%,注入提醒 22.4%,助手正文 7.4%。也就是说历史里最贵的是模型自己敲进去的内容,而不是工具返回的东西——这类成本没有便宜的代码解法,只能靠约束写作习惯。
10
+ - 规则 9 从「增量写作」扩成可执行约束:能 `edit` 就不要整篇 `write`、不重复贴已有文件内容、子代理提示要短(它们会永久留在历史里)。persona suffix 4130 → 4356 字符,测试上限相应放宽到 4450。
11
+
12
+ ### 测试
13
+
14
+ - 同步修正分片缩进后与模块重新逐字一致;全量 279 项、278 通过、0 失败、1 skip,`build --check` PASS。
4
15
 
5
16
  ## 0.2.5 (2026-11-30)
6
17
 
@@ -71,7 +71,9 @@ export const LEAN_PERSONA_SUFFIX = [
71
71
  ' from files with grep/scripts instead of re-reading them into context. Keep NOTES short and',
72
72
  ' factual (<=60 lines).',
73
73
  '9. Author incrementally: create a file once (skeleton), then extend it with edit. Never re-emit an',
74
- ' unchanged file. After two failed shell patches, switch to the editor.',
74
+ ' unchanged file. After two failed shell patches, switch to the editor. Tool-call arguments are',
75
+ ' ~42% of this history and are re-read every turn: prefer edit over a whole-file write, never paste',
76
+ ' back content you already have on disk, and keep subagent briefs short - they are history forever.',
75
77
  '',
76
78
  'SAFETY',
77
79
  '10. Honour scope literally (a new project means do not read or copy old-project files). Use',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-lean-router",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "lean 省 token × 思考链路由 × code_run 工具遮蔽的 DSH cordis 插件(单 bundle:预设)",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -61,7 +61,9 @@
61
61
  from files with grep/scripts instead of re-reading them into context. Keep NOTES short and
62
62
  factual (<=60 lines).
63
63
  9. Author incrementally: create a file once (skeleton), then extend it with edit. Never re-emit an
64
- unchanged file. After two failed shell patches, switch to the editor.
64
+ unchanged file. After two failed shell patches, switch to the editor. Tool-call arguments are
65
+ ~42% of this history and are re-read every turn: prefer edit over a whole-file write, never paste
66
+ back content you already have on disk, and keep subagent briefs short - they are history forever.
65
67
 
66
68
  SAFETY
67
69
  10. Honour scope literally (a new project means do not read or copy old-project files). Use
@@ -51,7 +51,9 @@
51
51
  from files with grep/scripts instead of re-reading them into context. Keep NOTES short and
52
52
  factual (<=60 lines).
53
53
  9. Author incrementally: create a file once (skeleton), then extend it with edit. Never re-emit an
54
- unchanged file. After two failed shell patches, switch to the editor.
54
+ unchanged file. After two failed shell patches, switch to the editor. Tool-call arguments are
55
+ ~42% of this history and are re-read every turn: prefer edit over a whole-file write, never paste
56
+ back content you already have on disk, and keep subagent briefs short - they are history forever.
55
57
 
56
58
  SAFETY
57
59
  10. Honour scope literally (a new project means do not read or copy old-project files). Use
@@ -50,7 +50,7 @@ test('persona-text.js 独立加载:lean 13 条 + 2 软门 + 自检题钩子 +
50
50
  assert.equal(m.PERSONA_PREFIX, 'You are a coding agent powered by the {{model}} model.');
51
51
  });
52
52
 
53
- test('persona 并行调用引导:只读并发 + 写向同批省往返 + 遮挡整批拒绝(块 <=320,suffix <=4200)', async () => {
53
+ test('persona 并行调用引导:只读并发 + 写向同批省往返 + 遮挡整批拒绝(块 <=320,suffix <=4450)', async () => {
54
54
  const m = await mod('persona-text.js');
55
55
  const s = m.LEAN_PERSONA_SUFFIX;
56
56
  // 事实 1:只读工具可真正重叠执行(tool-concurrency.js 给 glob/grep 打了 isConcurrencySafe)
@@ -70,7 +70,7 @@ test('persona 并行调用引导:只读并发 + 写向同批省往返 + 遮挡
70
70
  assert.ok(end > start, '并行引导块须位于规则 6 与规则 7 之间');
71
71
  const block = s.slice(start, end).replace(/\n+$/, '');
72
72
  assert.ok(block.length <= 320, '并行引导块须 <=320 字符,实为 ' + block.length);
73
- assert.ok(s.length <= 4200, 'persona suffix 总长须 <=4200,实为 ' + s.length);
73
+ assert.ok(s.length <= 4450, 'persona suffix 总长须 <=4450,实为 ' + s.length);
74
74
  });
75
75
 
76
76
  test('plan-mode.js 独立加载:v1 政策段原文要点', async () => {