dsh-charter 0.2.2 → 0.3.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +59 -1
  2. package/CHANGELOG.zh.md +54 -1
  3. package/README.md +75 -51
  4. package/README.zh.md +68 -45
  5. package/docs/README.md +5 -4
  6. package/docs/README.zh.md +6 -3
  7. package/docs/assets/charter-graph-0.3.0.zh.png +0 -0
  8. package/docs/assets/charter-graph-0.3.1.png +0 -0
  9. package/docs/assets/charter-graph-0.3.1.zh.png +0 -0
  10. package/docs/assets/charter-pane-0.3.0.png +0 -0
  11. package/docs/assets/charter-pane-0.3.0.zh.png +0 -0
  12. package/docs/assets/charter-pane-0.3.1.png +0 -0
  13. package/docs/assets/charter-pane-0.3.1.zh.png +0 -0
  14. package/docs/assets/dependency-example.svg +90 -0
  15. package/docs/assets/dependency-example.zh.svg +90 -0
  16. package/docs/design/charter-dependency-graph-v1.zh.md +26 -21
  17. package/docs/design/charter-design-v1.md +2 -2
  18. package/docs/design/charter-design-v1.zh.md +2 -2
  19. package/docs/design/charter-gui-v1.zh.md +873 -0
  20. package/docs/design/charter-workspace-v2.zh.md +13 -1
  21. package/docs/design/compatibility.md +23 -6
  22. package/docs/design/compatibility.zh.md +22 -6
  23. package/docs/design/mockups/README.md +29 -0
  24. package/docs/design/mockups/mockup-graph.html +154 -0
  25. package/docs/design/mockups/mockup-home-clean.html +146 -0
  26. package/docs/design/mockups/mockup-home-dirty.html +191 -0
  27. package/docs/design/mockups/mockup.css +429 -0
  28. package/docs/design/mockups/style-tile.html +146 -0
  29. package/docs/design/mockups/tokens.css +670 -0
  30. package/docs/design/version-roadmap.md +30 -10
  31. package/docs/design/version-roadmap.zh.md +43 -8
  32. package/docs/release-notes/0.2.2.md +5 -5
  33. package/docs/release-notes/0.3.0.md +70 -0
  34. package/docs/release-notes/0.3.1.md +38 -0
  35. package/docs/release-notes/README.md +1 -1
  36. package/docs/releasing.md +5 -4
  37. package/docs/releasing.zh.md +5 -4
  38. package/docs/user-guide.md +9 -10
  39. package/docs/user-guide.zh.md +8 -10
  40. package/docs/verification.md +114 -10
  41. package/docs/verification.zh.md +98 -9
  42. package/lib/client/ChangeSetPanel.d.ts +24 -0
  43. package/lib/client/DependencyGraph.d.ts +1 -1
  44. package/lib/client/DiagnosticsPage.d.ts +5 -0
  45. package/lib/client/ReviewCenterPage.d.ts +5 -0
  46. package/lib/client/SectionNav.d.ts +14 -0
  47. package/lib/client/WorkspacePage.d.ts +5 -0
  48. package/lib/client/change-set-model.d.ts +55 -0
  49. package/lib/client/draft-store.d.ts +1 -1
  50. package/lib/client/locales.d.ts +49 -1
  51. package/lib/client/page-order.d.ts +26 -0
  52. package/lib/client/pane-format.d.ts +48 -0
  53. package/lib/client/pane-scope.d.ts +382 -0
  54. package/lib/client/pane-ui.d.ts +39 -0
  55. package/lib/client/relation-graph.d.ts +0 -1
  56. package/lib/client/section-routing.d.ts +12 -0
  57. package/lib/client/use-change-set-sheet.d.ts +13 -0
  58. package/lib/client.js +3931 -3118
  59. package/lib/core/standing-envelope.d.ts +31 -0
  60. package/lib/host/types.d.ts +6 -1
  61. package/lib/index.js +1 -1
  62. package/lib/remote.js +1 -1
  63. package/lib/{service-MsIACddZ.js → service-BSrE7Kbu.js} +42 -24
  64. package/lib/version.d.ts +1 -1
  65. package/package.json +24 -18
@@ -0,0 +1,90 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="960" height="320" viewBox="0 0 960 320" role="img" aria-labelledby="title desc">
2
+ <title id="title">Dependency relationships: Tests and Migration are prerequisites of Release</title>
3
+ <desc id="desc">Three deliverable cards. Tests D1 and Migration D2 are prerequisites of Release D3, with directional dependency arrows.</desc>
4
+ <style>
5
+ .surface { fill: #151820; }
6
+ .frame { fill: none; stroke: #2c333e; }
7
+ .kicker { fill: #8e98a8; font: 600 11px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .12em; }
8
+ .lane { fill: #6f7989; font: 500 11px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .04em; }
9
+ .node { fill: #1b1f27; stroke: #343c49; stroke-width: 1; }
10
+ .node-selected { stroke: #4ea1ff; }
11
+ .accent-done { fill: #3fb950; }
12
+ .accent-progress { fill: #4ea1ff; }
13
+ .accent-waiting { fill: #d29922; }
14
+ .node-key { fill: #7fb7ff; font: 600 12px/1.2 "SFMono-Regular", Consolas, monospace; }
15
+ .node-title { fill: #e8ebf1; font: 600 15px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; }
16
+ .node-meta { fill: #8f99a9; font: 400 11px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; }
17
+ .chip { fill: #242a34; stroke: #343c49; }
18
+ .chip-text { fill: #b9c2d0; font: 500 10px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
19
+ .status-done { fill: #3fb950; }
20
+ .status-progress { fill: #4ea1ff; }
21
+ .status-waiting { fill: #d29922; }
22
+ .edge { fill: none; stroke: #7d8798; stroke-width: 1.5; }
23
+ .edge-label { fill: #8e98a8; font: 400 10px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
24
+ .hint { fill: #7e8898; font: 400 11px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
25
+ .legend-line { fill: none; stroke: #7d8798; stroke-width: 1.5; }
26
+ .legend-dot { fill: #3fb950; }
27
+ </style>
28
+ <defs>
29
+ <marker id="arrow" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="7" markerHeight="7" orient="auto">
30
+ <path d="M0,0 L8,4 L0,8 z" fill="#7d8798"/>
31
+ </marker>
32
+ </defs>
33
+
34
+ <rect class="surface" x="0.5" y="0.5" width="959" height="319" rx="14"/>
35
+ <rect class="frame" x="0.5" y="0.5" width="959" height="319" rx="14"/>
36
+
37
+ <text class="kicker" x="32" y="36">EXECUTION PATH</text>
38
+ <text class="lane" x="32" y="64">Prerequisites are visible before dependents</text>
39
+
40
+ <!-- lane guide -->
41
+ <line x1="32" y1="80" x2="928" y2="80" stroke="#252c36" stroke-width="1"/>
42
+ <text class="lane" x="32" y="100">EXECUTION</text>
43
+ <text class="lane" x="520" y="100">DEPENDENT</text>
44
+
45
+ <!-- D1 Tests -->
46
+ <g>
47
+ <rect class="node" x="32" y="118" width="236" height="82" rx="8"/>
48
+ <rect class="accent-done" x="32" y="118" width="3" height="82" rx="1.5"/>
49
+ <circle class="status-done" cx="52" cy="140" r="3"/>
50
+ <text class="node-key" x="62" y="144">D1</text>
51
+ <rect class="chip" x="190" y="128" width="62" height="20" rx="10"/>
52
+ <text class="chip-text" x="221" y="142" text-anchor="middle">done</text>
53
+ <text class="node-title" x="52" y="169">Tests</text>
54
+ <text class="node-meta" x="52" y="188">No prerequisites</text>
55
+ </g>
56
+
57
+ <!-- D2 Migration -->
58
+ <g>
59
+ <rect class="node" x="32" y="218" width="236" height="82" rx="8"/>
60
+ <rect class="accent-progress" x="32" y="218" width="3" height="82" rx="1.5"/>
61
+ <circle class="status-progress" cx="52" cy="240" r="3"/>
62
+ <text class="node-key" x="62" y="244">D2</text>
63
+ <rect class="chip" x="174" y="228" width="78" height="20" rx="10"/>
64
+ <text class="chip-text" x="213" y="242" text-anchor="middle">in progress</text>
65
+ <text class="node-title" x="52" y="269">Migration</text>
66
+ <text class="node-meta" x="52" y="288">No prerequisites</text>
67
+ </g>
68
+
69
+ <!-- D3 Release -->
70
+ <g>
71
+ <rect class="node node-selected" x="520" y="160" width="260" height="98" rx="8"/>
72
+ <rect class="accent-waiting" x="520" y="160" width="3" height="98" rx="1.5"/>
73
+ <circle class="status-waiting" cx="540" cy="184" r="3"/>
74
+ <text class="node-key" x="550" y="188">D3</text>
75
+ <rect class="chip" x="700" y="174" width="66" height="20" rx="10"/>
76
+ <text class="chip-text" x="733" y="188" text-anchor="middle">waiting</text>
77
+ <text class="node-title" x="540" y="217" fill="#e8ebf1">Release</text>
78
+ <text class="node-meta" x="540" y="237" fill="#8f99a9">2 prerequisites · waiting on D1, D2</text>
79
+ </g>
80
+
81
+ <!-- edges: D1 -> D3 and D2 -> D3 -->
82
+ <path class="edge" d="M 268 158 C 340 158, 400 185, 516 196" marker-end="url(#arrow)"/>
83
+ <path class="edge" d="M 268 258 C 340 258, 400 225, 516 218" marker-end="url(#arrow)"/>
84
+ <text class="edge-label" x="338" y="142">requires D1</text>
85
+ <text class="edge-label" x="338" y="286">requires D2</text>
86
+
87
+ <!-- legend / note -->
88
+ <line class="legend-line" x1="32" y1="306" x2="62" y2="306"/>
89
+ <text class="hint" x="72" y="310">solid = active dependency · D3 enters the prompt after D1 and D2</text>
90
+ </svg>
@@ -0,0 +1,90 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="960" height="320" viewBox="0 0 960 320" role="img" aria-labelledby="title desc">
2
+ <title id="title">依赖关系:测试与迁移是发布的前置条件</title>
3
+ <desc id="desc">三张交付物卡片。测试 D1 与迁移 D2 是发布 D3 的前置条件,带方向依赖箭头。</desc>
4
+ <style>
5
+ .surface { fill: #151820; }
6
+ .frame { fill: none; stroke: #2c333e; }
7
+ .kicker { fill: #8e98a8; font: 600 11px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .12em; }
8
+ .lane { fill: #6f7989; font: 500 11px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .04em; }
9
+ .node { fill: #1b1f27; stroke: #343c49; stroke-width: 1; }
10
+ .node-selected { stroke: #4ea1ff; }
11
+ .accent-done { fill: #3fb950; }
12
+ .accent-progress { fill: #4ea1ff; }
13
+ .accent-waiting { fill: #d29922; }
14
+ .node-key { fill: #7fb7ff; font: 600 12px/1.2 "SFMono-Regular", Consolas, monospace; }
15
+ .node-title { fill: #e8ebf1; font: 600 15px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
16
+ .node-meta { fill: #8f99a9; font: 400 11px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; }
17
+ .chip { fill: #242a34; stroke: #343c49; }
18
+ .chip-text { fill: #b9c2d0; font: 500 10px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
19
+ .status-done { fill: #3fb950; }
20
+ .status-progress { fill: #4ea1ff; }
21
+ .status-waiting { fill: #d29922; }
22
+ .edge { fill: none; stroke: #7d8798; stroke-width: 1.5; }
23
+ .edge-label { fill: #8e98a8; font: 400 10px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
24
+ .hint { fill: #7e8898; font: 400 11px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
25
+ .legend-line { fill: none; stroke: #7d8798; stroke-width: 1.5; }
26
+ .legend-dot { fill: #3fb950; }
27
+ </style>
28
+ <defs>
29
+ <marker id="arrow" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="7" markerHeight="7" orient="auto">
30
+ <path d="M0,0 L8,4 L0,8 z" fill="#7d8798"/>
31
+ </marker>
32
+ </defs>
33
+
34
+ <rect class="surface" x="0.5" y="0.5" width="959" height="319" rx="14"/>
35
+ <rect class="frame" x="0.5" y="0.5" width="959" height="319" rx="14"/>
36
+
37
+ <text class="kicker" x="32" y="36">执行路径</text>
38
+ <text class="lane" x="32" y="64">前置条件先于依赖项可见</text>
39
+
40
+ <!-- lane guide -->
41
+ <line x1="32" y1="80" x2="928" y2="80" stroke="#252c36" stroke-width="1"/>
42
+ <text class="lane" x="32" y="100">执行</text>
43
+ <text class="lane" x="520" y="100">依赖项</text>
44
+
45
+ <!-- D1 Tests -->
46
+ <g>
47
+ <rect class="node" x="32" y="118" width="236" height="82" rx="8"/>
48
+ <rect class="accent-done" x="32" y="118" width="3" height="82" rx="1.5"/>
49
+ <circle class="status-done" cx="52" cy="140" r="3"/>
50
+ <text class="node-key" x="62" y="144">D1</text>
51
+ <rect class="chip" x="190" y="128" width="62" height="20" rx="10"/>
52
+ <text class="chip-text" x="221" y="142" text-anchor="middle">已完成</text>
53
+ <text class="node-title" x="52" y="169">测试</text>
54
+ <text class="node-meta" x="52" y="188">无前置</text>
55
+ </g>
56
+
57
+ <!-- D2 Migration -->
58
+ <g>
59
+ <rect class="node" x="32" y="218" width="236" height="82" rx="8"/>
60
+ <rect class="accent-progress" x="32" y="218" width="3" height="82" rx="1.5"/>
61
+ <circle class="status-progress" cx="52" cy="240" r="3"/>
62
+ <text class="node-key" x="62" y="244">D2</text>
63
+ <rect class="chip" x="174" y="228" width="78" height="20" rx="10"/>
64
+ <text class="chip-text" x="213" y="242" text-anchor="middle">进行中</text>
65
+ <text class="node-title" x="52" y="269">迁移</text>
66
+ <text class="node-meta" x="52" y="288">无前置</text>
67
+ </g>
68
+
69
+ <!-- D3 Release -->
70
+ <g>
71
+ <rect class="node node-selected" x="520" y="160" width="260" height="98" rx="8"/>
72
+ <rect class="accent-waiting" x="520" y="160" width="3" height="98" rx="1.5"/>
73
+ <circle class="status-waiting" cx="540" cy="184" r="3"/>
74
+ <text class="node-key" x="550" y="188">D3</text>
75
+ <rect class="chip" x="700" y="174" width="66" height="20" rx="10"/>
76
+ <text class="chip-text" x="733" y="188" text-anchor="middle">等待</text>
77
+ <text class="node-title" x="540" y="217" fill="#e8ebf1">发布</text>
78
+ <text class="node-meta" x="540" y="237" fill="#8f99a9">2 个前置 · 等待 D1、D2</text>
79
+ </g>
80
+
81
+ <!-- edges: D1 -> D3 and D2 -> D3 -->
82
+ <path class="edge" d="M 268 158 C 340 158, 400 185, 516 196" marker-end="url(#arrow)"/>
83
+ <path class="edge" d="M 268 258 C 340 258, 400 225, 516 218" marker-end="url(#arrow)"/>
84
+ <text class="edge-label" x="338" y="142">依赖 D1</text>
85
+ <text class="edge-label" x="338" y="286">依赖 D2</text>
86
+
87
+ <!-- legend / note -->
88
+ <line class="legend-line" x1="32" y1="306" x2="62" y2="306"/>
89
+ <text class="hint" x="72" y="310">实线 = 生效依赖 · D1、D2 完成后 D3 才进入 prompt</text>
90
+ </svg>
@@ -1,9 +1,9 @@
1
1
  # `dsh-charter` 依赖关系图形化视图设计(提案)
2
2
 
3
- > **状态:** `Implemented — pending release acceptance`——源码已实现并通过 source gates;真实浏览器/AT
4
- > 与 W0-1/2/3 人工门禁仍待完成,本文不描述已发布行为。进入发布前仍以[版本路线](version-roadmap.zh.md)为准
3
+ > **状态:** `Implemented — pending release acceptance`——0.3.1 已完成方向箭头、泳道标题、沿边 44px 命中路径和历史线型;
4
+ > 真实浏览器自动化已记录,真实 AT/VoiceOver 人工门禁仍待完成。进入发布前仍以[版本路线](version-roadmap.zh.md)为准
5
5
  > ([charter-workspace-v2.zh.md](charter-workspace-v2.zh.md) §1.1)。
6
- > **版本范围:** `0.2.2`(已确认,纯客户端)。源码实现已完成;发布前仍需完成真实浏览器/AT 门禁(§3.10)。
6
+ > **版本范围:** `0.2.2` / `0.3.1`(纯客户端)。源码实现已完成;发布前仍需完成真实 AT 人工门禁(§3.10)。
7
7
  > **形态:** **A —— 图形增强,语义列表常驻且为权威操作面**(已确认,§0.2)。
8
8
  > **基准:** 2026-11-09,基于已发布 `0.2.1` 之后的开发树。
9
9
  > **权威边界:** 版本范围由[版本路线](version-roadmap.zh.md)决定;不变量由 [v1 核心设计](charter-design-v1.zh.md)
@@ -12,6 +12,10 @@
12
12
  > **替代/被替代:** 无 / 无。
13
13
  > **实现就绪度:** 所有未尽事项的做法都在 **§10**,每项都有决定或"兜底值 + 测量方法 + 决策规则"。
14
14
  > 因此实现可按兜底值开工,W0 实测后**只调参数、不改结构**(§10.10)。
15
+ >
16
+ > **0.3.1 几何决策:** 实现已采用固定 px 几何(184px 节点、`PX_PER_EM=18.4`、`PX_PER_EM_Y=22`)。
17
+ > 本文 D19 与 §3.7 的 em 契约保留为历史分析;当前权威几何规格是 [charter-gui-v1.zh.md](charter-gui-v1.zh.md) §5.7。
18
+ > 200% **根字号文本缩放**尚未由 W0-2 覆盖;W0-2 现有证据是字号 10/14/22 + 200% page scale。
15
19
 
16
20
  ## 0. 目标与形态取舍
17
21
 
@@ -54,8 +58,9 @@
54
58
  候选边虚线**只读但可被方向键到达**(D9、D10、§3.4)。**替代关系同样在 v1 画出**:`supersedes` 边走第三条
55
59
  `history` 泳道,端点是只读**幽灵节点**(点线、无 `D<n>`、无 rank、可被 `[`/`]` 与 `Enter` 到达),因此执行泳道
56
60
  "rank = 执行序"的语义不受影响;本次 staged 的替代两端仍留在执行泳道并标"新增/删除"(D11、§10.1)。
57
- 8. **200% 文本缩放**:全部几何以 **em** 表达,布局输出无量纲单位,缩放/平移只对单一 wrapper 施加一个
58
- transform;节点高度取离散档位、由字符数纯函数决定,**不做运行时测量**(D19、§3.7)。
61
+ 8. **缩放**:实现采用 **固定 px 几何**;布局仍输出确定性 layout units,渲染层按 `PX_PER_EM=18.4` /
62
+ `PX_PER_EM_Y=22` 转 px,单一 wrapper transform;节点高度由字符数纯函数决定。200% **根字号文本缩放**尚未
63
+ 由 W0-2 覆盖,W0-2 证据是字号 10/14/22 + 200% page scale(D19 的历史 em 推导已被 0.3.1 决策取代)。
59
64
  9. **兼容性**:图形视图本身不动 record schema、迁移、fork、Host、Remote、wire、prompt。(§8 的 §6.5 冲突确认是
60
65
  独立事项,它确实改了 core/Host/wire/client,但 wire 上是 optional 字段、不参与任何 digest 输入。)
61
66
  **但兼容矩阵不豁免**:发布门禁仍要求对全部已声明版本与当前 untracked 版本重跑矩阵并重新绑定证据。
@@ -124,7 +129,7 @@
124
129
  | --- | --- | --- |
125
130
  | 屏幕阅读器读不到 canvas 像素;forced colors / 200% 文本缩放对位图无效;焦点需要 DOM 或手写 ARIA overlay | **外部事实** | 不能,只能适配 |
126
131
  | SVG 内 ARIA role 与焦点行为跨浏览器/AT 差异大(`role="listitem"` 在 SVG 内不等于 HTML list item) | **外部事实** | 不能,按 §3.5 规避 |
127
- | 200% 文本缩放只放大文本,不放大写死的 px 盒子 | **外部事实** | 不能,按 D19 用 em 规避 |
132
+ | 200% 文本缩放只放大文本,不放大写死的 px 盒子 | **外部事实** | 0.3.1 已接受固定 px 几何;字号 10/14/22 + page scale 已有证据,根字号 32px 尚未验证 |
128
133
  | bundle 必须单一自包含 factory,任何库都被内联 | **外部事实**(DSH 打包契约) | 不能 |
129
134
  | 兼容矩阵是发布门禁 | **外部事实**(项目治理) | 不能 |
130
135
  | §5.7 canvas 条款的措辞 | 内部选择 | 可议,但**本提案不需要改**(§1.3.1) |
@@ -221,7 +226,7 @@
221
226
  | D16 | 新增 i18n 键中英成对(§3.9) | 项目语言配对规则 |
222
227
  | D17 | **合规的可验证形式**:语义列表始终在 DOM 中、始终可聚焦可操作;隐藏图形区后**所有操作仍可在列表完成**;图上与 inspector 内不存在任何列表之外的独有操作 | §5.7 与 §1.3.1 的落点,必须有测试 |
223
228
  | D18 | **默认焦点规则**:① `selectedItemId` 若在图中则用它;② 否则取拓扑序第一个 **`prerequisiteStatus === 'dependency-conflict'`** 的 active deliverable;③ 无冲突则第一个 `waiting`;④ 再无则拓扑序第一个 active deliverable;⑤ 无 active deliverable 但有候选边时,取 canonical order 第一个 pending 节点。展开图形区**不抢焦点** | `focusId` 可为 `undefined`,必须定义默认值。**必须看 `prerequisiteStatus` 而非 `executionDisplay`**:core 的 UI 组合规则会把冲突掩盖成 `in-progress`/`blocked`([dependencies.ts:125](../../src/core/dependencies.ts)),只看 `executionDisplay` 会选错节点——W0 原型实测复现 |
224
- | D19 | **缩放契约**:所有几何以 **em** 表达;布局函数输出**无量纲 layout units**;SVG 与 HTML 标签层在**同一 wrapper** 内、共用**一个** CSS transform;节点高度取离散档位(`3em` / `4.5em`),由摘要字符数**纯函数**决定,**不做运行时文本测量** | 200% 文本缩放只放大文本不放大 px 盒;固定 px + HTML 文本必然溢出,而运行时测量会破坏布局确定性(§3.7) |
229
+ | D19 | **缩放契约(已被 0.3.1 决策取代)**:实现为全 px 几何(184px 节点、`PX_PER_EM=18.4`、`PX_PER_EM_Y=22`);布局函数输出 layout units,渲染层转 px;SVG 与 HTML 标签层在同一 wrapper 内、共用一个 CSS transform;节点高度由字符数纯函数决定,不做运行时测量 | 旧版 em 推导与固定 px 冲突;3.1 改用 px 并保持 184px 节点/两行截断。200% 根字号(32px)文本缩放仍未覆盖,不能引用 W0-2 的 page scale 证据 |
225
230
 
226
231
  ### 3.3 接口:语义层与几何层分离
227
232
 
@@ -279,7 +284,7 @@ export function layoutRelationGraph(
279
284
  ): GraphLayout
280
285
 
281
286
  export interface GraphLayout {
282
- /** 坐标单位是 em 倍数(无量纲);渲染层乘以 --charter-graph-unit(D19) */
287
+ /** 坐标单位是 layout units;渲染层按 PX_PER_EM/PX_PER_EM_Y 转 px(0.3.1) */
283
288
  readonly nodes: readonly (RelationNode & {
284
289
  readonly x: number; readonly y: number
285
290
  readonly w: number; readonly h: number // h ∈ {3, 4.5}(em 倍数)
@@ -428,7 +433,7 @@ inspector 与列表看到);仍 > 60 → ② 深度锁 1;仍 > 60 → ③
428
433
 
429
434
  ### 3.7 视觉与缩放规格
430
435
 
431
- **几何(全部 em,D19)**
436
+ **几何(px 渲染,0.3.1;em 推导保留为历史)**
432
437
 
433
438
  以下数值满足两条硬不变式,否则节点必然重叠(W0 原型实测:违反时 6 节点样本出现 9 处重叠):
434
439
 
@@ -440,13 +445,13 @@ LINE_CAPACITY = floor((NODE_W − 2 × padding) / 摘要字号) (由几何
440
445
 
441
446
  | 项 | 值 | 推导 |
442
447
  | --- | --- | --- |
443
- | 单位 | `--charter-graph-unit: 1em`(继承根字号);布局输出无量纲单位,渲染层乘以该 unit | D19 |
444
- | 节点宽 | `10em`(min `9em` / max `12em`) | 初始视图宽度约束(见下) |
445
- | rank 列间距 | `12.5em` = 节点宽 `10em` + 边间距 `2.5em` | 横向不重叠 |
446
- | 同 rank 行间距 | `5.5em` = 最大节点高 `4.5em` + 行间距 `1em` | 纵向不重叠 |
447
- | 节点盒 | 高取 `3em` / `4.5em` 两档,且 `min-height: max(3em, 44px)` | D7 触控下限 |
448
+ | 单位 | layout units → px:`PX_PER_EM=18.4`、`PX_PER_EM_Y=22`(无 `--charter-graph-unit`) | 0.3.1 决策 |
449
+ | 节点宽 | `184px` = `10 × 18.4px`(min/max 由 W0 定) | 固定 px 几何 |
450
+ | rank 列间距 | `230px` = `12.5 × 18.4px` | 横向不重叠 |
451
+ | 同 rank 行间距 | `121px` = `5.5 × 22px` | 纵向不重叠 |
452
+ | 节点盒 | 高度 `66px` / `99px`(`3/4.5 × 22px`),`min-height: 44px` | D7 触控下限 |
448
453
  | 节点圆角/边框 | 7px / 1px `--charter-border-soft` | 与现有 `charter-dependency` 行一致 |
449
- | 每行容量 | `LINE_CAPACITY = floor((10 − 2×0.625) / 0.78) = 11`(CJK 计 1,拉丁/数字计 0.5) | 由几何推导;**偏保守**,W0-2 用真实渲染行数校准 |
454
+ | 每行容量 | 仍由 `NODE_W`、padding 与摘要字号推导为 11 个 CJK 等效字符 | W0-2 校准;px 化后需重新确认 |
450
455
  | 节点文本 | HTML 层:`D<n>` 用 `--charter-brand` `0.6875em`/700(复用 `charter-dependency__key` 语言),摘要 `0.78em`,状态 `0.6875em` tertiary | 与现有列表视觉一致 |
451
456
  | 边 | 三次贝塞尔水平走向,1.5px,箭头 8px,`vector-effect: non-scaling-stroke` | — |
452
457
  | hit 线 | 同路径、透明、命中宽 ≥44px 等效 | D7 |
@@ -474,11 +479,11 @@ LINE_CAPACITY = floor((NODE_W − 2 × padding) / 摘要字号) (由几何
474
479
  `weight` 按字符计权(CJK 计 1,拉丁/数字/空格计 0.5),
475
480
  `LINE_CAPACITY = floor((NODE_W_EM − 2 × NODE_PADDING_EM) / SUMMARY_EM) = floor((10 − 1.25) / 0.78) = 11`
476
481
  ——即**每行约 11 个 CJK 字符或 22 个拉丁字符**,两行合计约 22 CJK / 44 拉丁。
477
- 节点高度只由 `labelLines` 决定(`3em` / `4.5em`),**不做运行时文本测量**,因此布局确定性成立、快照测试可行。
482
+ 节点高度只由 `labelLines` 决定(`66px` / `99px`,即 `3/4.5 × 22px`),**不做运行时文本测量**,因此布局确定性成立、快照测试可行。
478
483
  该常量**偏保守**(按参考字号的等宽估算,未按实际字体度量):保守方向只会让节点偏高,不会溢出;
479
484
  W0-2 用"纯函数行数 vs 真实渲染行数"逐节点校准,若实测长期偏保守可上调常量(上调后必须重跑零重叠验收)。
480
- 3. 200% 文本缩放下,因为节点盒与文本都以 em 表达,两者**同比放大**,夹取行为不变(行数不变、溢出仍由 CSS
481
- 省略号处理),不会溢出节点盒。
485
+ 3. 实现使用固定 px 节点;用户字号只影响语义列表。200% **页面缩放**会同比放大整个画布,不能证明
486
+ 200% **根字号文本缩放**(32px)下固定 184px 盒不裁切;该场景仍待真实浏览器人工门禁。
482
487
  4. 完整正文永远可得:accessible name 含**未截断**摘要、inspector 可展开全文、hover/focus 提供等价 tooltip;
483
488
  tooltip 不承载唯一信息(§5.7)。
484
489
  5. **单一变换**:SVG 与 HTML 标签层放在同一个 `position: relative` wrapper 内,缩放/平移只对 wrapper 施加
@@ -604,7 +609,7 @@ W0-1/2/3 与人工项的**执行步骤**见 §10.11,参数**定稿规则**见
604
609
  | 图上编辑破坏 Change Set 原子性 | D4:图只 stage ops;Apply 保持唯一提交点与 previewDigest 校验;W3 等价性测试兜底 |
605
610
  | SVG 内 ARIA 跨 AT 不一致 | 只用 `role="button"`/`role="link"` + roving tabindex + `aria-label`;不用 SVG list 语义;W0-3 用真实 AT 验证 |
606
611
  | Tab 陷阱 / 键盘用户到不了列表 | D5 复合控件(图 = 1 个 Tab 停靠)+ 前置 skip 链接,卡片外到列表 ≤ 2 次 Tab |
607
- | 200% 文本缩放导致节点溢出或两层错位 | D19:全 em 几何、离散高度档位、纯函数行数、单一 wrapper transform;W0-2 实测把关 |
612
+ | 200% 文本缩放导致节点溢出或两层错位 | 0.3.1 全 px 几何、纯函数行数、单一 wrapper transform;W0-2 现有字号 10/14/22 + page scale 证据不覆盖根字号 32px,仍待人工 |
608
613
  | 大图不可读 | D2 只做 ego 图 |
609
614
  | pending 节点被误读为执行序 | D10:不给 rank/`D<n>`,独立泳道 + "未进入执行序"写进 accessible name 与角标 |
610
615
  | 引入图形库导致 bundle 与无障碍失控 | D6 自研,零新依赖;W2 记录真实 bundle delta |
@@ -849,7 +854,7 @@ col(n) = base(n) + candRank(n)
849
854
  **决定:CSS transform 施加在单一 wrapper 上,不用 viewBox 变换。**
850
855
 
851
856
  - 理由:viewBox 缩放会同时缩放 stroke 与 SVG 内文本,与"浏览器文本缩放改根字号"叠加时互相干扰;
852
- CSS transform 对 HTML 标签层与 SVG 一视同仁,正好复用 D19 的"单一 transform"约束。
857
+ CSS transform 对 HTML 标签层与 SVG 一视同仁;0.3.1 沿用 px 几何与"单一 transform"约束。
853
858
  - 缩放档位:`0.75 / 1 / 1.25`,工具条按钮 + 键盘 `+` / `-` / `0`。
854
859
  - **最小缩放 0.75**:「适应窗口」按内容与容器比值算 scale,但 clamp 到 ≥0.75;clamp 后仍放不下就保持
855
860
  0.75 并允许平移,**不无限缩小**(避免文本缩到不可读,也避免与 200% 文本缩放叠加后失效)。
@@ -972,7 +977,7 @@ col(n) = base(n) + candRank(n)
972
977
  | 参数 | 兜底值(可先按此实现) | 测量方法 | 决策规则 |
973
978
  | --- | --- | --- | --- |
974
979
  | D5 可导航元素阈值 | 60 | W0-3 真实键盘走查:从默认焦点遍历全图所需按键数与耗时(**含 history 泳道**) | 40 个元素可在 30 秒内走完且不迷失 → 保持 60;走查者报告疲劳/迷失 → 降到 40。降级路径不变(关 history → 锁深度 → 隐藏图形区) |
975
- | §3.7 几何常量 | `NODE_W 10em` / `RANK_PITCH 12.5em` / `ROW_PITCH 5.5em` / 高度 `3|4.5em`(已满足两条不变式、20 组组合零重叠) | W0-2 真实字体度量 | 只允许调 `NODE_W_EM`(9–12em)与 `SUMMARY_EM`;调后必须重算 `LINE_CAPACITY` 与两条不变式,并重跑 W0-0 零重叠 |
980
+ | §3.7 几何常量 | `NODE_W=184px` / `RANK_PITCH=230px` / `ROW_PITCH=121px` / 高度 `66|99px`(已满足两条不变式) | W0-2 真实浏览器 | 只允许按 px 调 `NODE_W`(9–12 单位 ×18.4)与摘要字号;调后必须重算 `LINE_CAPACITY` 与两条不变式,并重跑 W0-0 零重叠 |
976
981
  | `LINE_CAPACITY` | 11 | W0-2 逐节点比对纯函数行数 vs 真实行数 | 见 §10.6(按语言分别校准) |
977
982
  | §3.1 两栏断点 | 容器 `<880px` 堆叠(沿用现有 container query 断点集合) | W0-1 五档宽度自动测量 | 取"最小的全部 PASS 宽度",且必须落在现有断点集合 `{880, 560, 520}` 内,不新增断点 |
978
983
  | 图形区高度 | 基础 `22.5em`,附加带按行数增高 | W0-2 在 200% 缩放下确认能同时显示 ≥2 列 + 候选带 + history 带 | 不满足则提到 `26em`;仍不满足则改为容器高度自适应 + 内部滚动 |
@@ -13,7 +13,7 @@ English | [中文](charter-design-v1.zh.md)
13
13
  > session, and deterministically rebuild them from an independent authoritative record before every model
14
14
  > request. Compaction may rewrite history summaries; it is never a writer or recovery source for the charter.
15
15
 
16
- Research baseline: 2026-10-20. Target contract baseline: DSH `0.2.2-rc.1`; minimum supported version:
16
+ Research baseline: 2026-10-20. Target contract baseline: DSH `0.2.2-rc.2`; minimum supported version:
17
17
  `0.1.7-rc.2`.
18
18
 
19
19
  Related documents:
@@ -584,7 +584,7 @@ Current evidence:
584
584
 
585
585
  - The Vitest suite across core, host, client, and verification-helper test files (current counts and commands are
586
586
  in the verification record, which is the source of truth);
587
- - Typecheck, build, and tests pass on all nine declared DSH versions (`0.1.7-rc.2` through `0.2.2-rc.1`);
587
+ - Typecheck, build, and tests pass on all ten declared DSH versions (`0.1.7-rc.2` through `0.2.2-rc.2`);
588
588
  - Fresh Web profile install/startup passed on `0.1.7-rc.2`, `0.2.0-rc.2`, `0.2.1-rc.2`, `0.2.1-rc.4`, `0.2.1-rc.5`, and `0.2.2-rc.1`;
589
589
  - Real Web UI verified on `0.2.0-rc.2`: stable-order tab placement (with `dsh-context` installed), localization,
590
590
  objective/invariant editing, preview, Apply, and reload persistence. The current rc.6 source adds
@@ -11,7 +11,7 @@
11
11
  > 定位:保存当前会话中用户明确确认的目标、硬约束和交付物,并在每次模型请求前从独立正本确定性重建。
12
12
  > 压缩可以改写历史摘要,不能成为会话契约的写入者或恢复来源。
13
13
 
14
- 调研基准日:2026-10-19。目标契约基线:DSH `0.2.2-rc.1`。
14
+ 调研基准日:2026-10-19。目标契约基线:DSH `0.2.2-rc.2`。
15
15
 
16
16
  相关文档:
17
17
 
@@ -20,7 +20,7 @@
20
20
 
21
21
  实现状态:MVP Host、纯内核、JSON storage 组合、Remote contract 和主对话页标签页 Client 已完成实现并通过版本矩阵
22
22
  验证。当前 `npm run typecheck`、`npm test`、`npm run build` 均通过(具体文件/测试数以验证记录为准);同一源码在 DSH
23
- 九个声明 DSH 版本(`0.1.7-rc.2` 至 `0.2.2-rc.1`)均通过 typecheck、build 和 Vitest 套件(计数见验证记录)。
23
+ 十个声明 DSH 版本(`0.1.7-rc.2` 至 `0.2.2-rc.2`)均通过 typecheck、build 和 Vitest 套件(计数见验证记录)。
24
24
  fresh Web profile 的安装/启动已在 `0.1.7-rc.2`、`0.2.0-rc.2`、`0.2.1-rc.2`、`0.2.1-rc.4`、`0.2.1-rc.5`、`0.2.2-rc.1` 通过;DSH
25
25
  `0.2.0-rc.2` Web profile 上已用真实 Chrome 验证「对话」「轨迹」「会话契约」标签顺序、目标编辑、预览、Apply
26
26
  和刷新持久化。rc.6 源码增加了版本标识、审阅、恢复、无障碍和观测证据。