@yiyi_zhang/laoshi 0.2.0 → 0.3.0

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 (113) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +3 -2
  3. package/adapters/dsh/adapter.ts +22 -1
  4. package/adapters/dsh/dsh-runtime.ts +14 -3
  5. package/adapters/dsh/install.mjs +16 -4
  6. package/adapters/dsh/plugin/index.mjs +197 -18
  7. package/adapters/dsh/plugin/package.json +1 -1
  8. package/adapters/mogao/adapter.ts +9 -1
  9. package/adapters/mogao/mogao-runtime.ts +30 -8
  10. package/adapters/paseo/install.mjs +13 -4
  11. package/adapters/paseo/plugin/client/data.ts +13 -2
  12. package/adapters/paseo/plugin/client/detail.tsx +244 -4
  13. package/adapters/paseo/plugin/client/format.ts +25 -117
  14. package/adapters/paseo/plugin/client/overview.tsx +3 -3
  15. package/adapters/paseo/plugin/index.server.ts +2 -1
  16. package/adapters/paseo/plugin/package.json +1 -1
  17. package/adapters/paseo/plugin/paseo-plugin.json +1 -1
  18. package/adapters/paseo/plugin/server/handlers.ts +22 -4
  19. package/adapters/paseo/plugin/server/req.ts +17 -4
  20. package/adapters/paseo/plugin/shared/contracts.ts +28 -2
  21. package/adapters/paseo/plugin/shared/view-model.ts +425 -0
  22. package/bin/req.mjs +10 -0
  23. package/contracts/cli-json.md +3 -1
  24. package/docs/design/dsh-adapter.md +9 -9
  25. package/docs/design/shared-ui.md +43 -0
  26. package/docs/guide//345/256/211/350/243/205/344/270/216/345/215/207/347/272/247.md +13 -8
  27. package/docs/guide//347/234/237/345/256/236/347/216/257/345/242/203/350/265/260/346/237/245.md +78 -0
  28. package/engine/src/api.ts +11 -2
  29. package/engine/src/board.ts +435 -0
  30. package/engine/src/config.ts +23 -0
  31. package/engine/src/doctor.ts +25 -0
  32. package/engine/src/estimate.ts +11 -0
  33. package/engine/src/extensions.ts +271 -0
  34. package/engine/src/handover-cmd.ts +47 -0
  35. package/engine/src/handover.ts +89 -0
  36. package/engine/src/history.ts +102 -0
  37. package/engine/src/joint.ts +49 -4
  38. package/engine/src/launch.ts +2 -1
  39. package/engine/src/main.ts +1 -1
  40. package/engine/src/messages.ts +58 -0
  41. package/engine/src/pipeline.ts +109 -4
  42. package/engine/src/reply.ts +27 -6
  43. package/engine/src/semver.ts +21 -0
  44. package/package.json +5 -2
  45. package/site-dist/404.html +2 -2
  46. package/site-dist/assets/{app.BxNgGFu-.js → app.DZpVs0VH.js} +1 -1
  47. package/site-dist/assets/changelog.md.CdUYbro4.js +1 -0
  48. package/site-dist/assets/{changelog.md.D0PzSXw9.lean.js → changelog.md.CdUYbro4.lean.js} +1 -1
  49. package/site-dist/assets/chunks/@localSearchIndexroot.CHr-ITwS.js +1 -0
  50. package/site-dist/assets/chunks/{VPLocalSearchBox.Dw_fzw9V.js → VPLocalSearchBox.BHkmziy1.js} +1 -1
  51. package/site-dist/assets/chunks/{theme.CwrnT4KI.js → theme.BsPChbDE.js} +2 -2
  52. package/site-dist/assets/guide_dsh.md.D0XhcUHz.js +7 -0
  53. package/site-dist/assets/guide_dsh.md.D0XhcUHz.lean.js +7 -0
  54. package/site-dist/assets/{guide_getting-started.md.CjzysdDe.js → guide_getting-started.md.BDd3nU5n.js} +1 -1
  55. package/site-dist/assets/{guide_install.md.By4WxsJG.js → guide_install.md.SsIHMfUu.js} +7 -5
  56. package/site-dist/assets/{guide_install.md.By4WxsJG.lean.js → guide_install.md.SsIHMfUu.lean.js} +7 -5
  57. package/site-dist/assets/guide_walkthrough.md.nj_PWP9Y.js +5 -0
  58. package/site-dist/assets/guide_walkthrough.md.nj_PWP9Y.lean.js +5 -0
  59. package/site-dist/assets/reference_contracts_cli-json.md.3iU9h4rw.js +1 -0
  60. package/site-dist/assets/reference_contracts_cli-json.md.3iU9h4rw.lean.js +1 -0
  61. package/site-dist/changelog.html +5 -5
  62. package/site-dist/guide/cli.html +4 -4
  63. package/site-dist/guide/dsh.html +8 -6
  64. package/site-dist/guide/getting-started.html +5 -5
  65. package/site-dist/guide/how-it-works.html +4 -4
  66. package/site-dist/guide/index.html +4 -4
  67. package/site-dist/guide/install.html +11 -9
  68. package/site-dist/guide/intranet.html +4 -4
  69. package/site-dist/guide/maintainer.html +4 -4
  70. package/site-dist/guide/mogao.html +4 -4
  71. package/site-dist/guide/phases.html +4 -4
  72. package/site-dist/guide/project.html +4 -4
  73. package/site-dist/guide/user.html +4 -4
  74. package/site-dist/guide/walkthrough.html +34 -0
  75. package/site-dist/hashmap.json +1 -1
  76. package/site-dist/index.html +4 -4
  77. package/site-dist/reference/adr/0001-new-repo-core-and-adapters.html +4 -4
  78. package/site-dist/reference/adr/0002-two-orchestration-modes.html +4 -4
  79. package/site-dist/reference/adr/0003-generate-once-then-lock.html +4 -4
  80. package/site-dist/reference/adr/0004-external-contracts-stay-stable.html +4 -4
  81. package/site-dist/reference/adr/0005-skill-names.html +4 -4
  82. package/site-dist/reference/adr/0006-deterministic-engine-platform-capabilities.html +4 -4
  83. package/site-dist/reference/adr/0007-one-install-many-repos.html +4 -4
  84. package/site-dist/reference/adr/0008-capability-sources-and-platform-plugin.html +4 -4
  85. package/site-dist/reference/adr/index.html +4 -4
  86. package/site-dist/reference/commands.html +4 -4
  87. package/site-dist/reference/config.html +4 -4
  88. package/site-dist/reference/contracts/agent-runtime.html +4 -4
  89. package/site-dist/reference/contracts/cli-json.html +5 -5
  90. package/site-dist/reference/contracts/feature-files.html +4 -4
  91. package/site-dist/reference/contracts/index.html +4 -4
  92. package/site-dist/reference/contracts/notifier-event.html +4 -4
  93. package/site-dist/reference/contracts/result-file.html +4 -4
  94. package/site-dist/reference/contracts/spec.html +4 -4
  95. package/site-dist/reference/contracts/state.html +4 -4
  96. package/site-dist/reference/contracts/usage-record.html +4 -4
  97. package/site-dist/reference/contracts/verify.html +4 -4
  98. package/site-dist/reference/design/adapter-guide.html +4 -4
  99. package/site-dist/reference/design/architecture.html +4 -4
  100. package/site-dist/reference/design/builtin-capabilities.html +4 -4
  101. package/site-dist/reference/design/cli-adapter.html +4 -4
  102. package/site-dist/reference/design/platform-vocabulary.html +4 -4
  103. package/site-dist/reference/scope.html +4 -4
  104. package/skills/laoshi-setup/SKILL.md +1 -1
  105. package/ui/shared/view-model.ts +424 -0
  106. package/ui/web/board.ts +1126 -0
  107. package/site-dist/assets/changelog.md.D0PzSXw9.js +0 -1
  108. package/site-dist/assets/chunks/@localSearchIndexroot.vA-yiw-8.js +0 -1
  109. package/site-dist/assets/guide_dsh.md.0X-eYB87.js +0 -5
  110. package/site-dist/assets/guide_dsh.md.0X-eYB87.lean.js +0 -5
  111. package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.js +0 -1
  112. package/site-dist/assets/reference_contracts_cli-json.md.D6vfWOD9.lean.js +0 -1
  113. /package/site-dist/assets/{guide_getting-started.md.CjzysdDe.lean.js → guide_getting-started.md.BDd3nU5n.lean.js} +0 -0
@@ -34,6 +34,8 @@ export interface Requirement {
34
34
  updatedAt: string;
35
35
  usage: Usage | null;
36
36
  present: boolean;
37
+ startedBy?: string | null;
38
+ owner?: string | null;
37
39
  /** req-kit 1.13+: it has an interface prototype, which the review page shows. */
38
40
  hasPrototype?: boolean;
39
41
  /** req-kit 1.12+: what a requirement that needs a person is waiting for; absent before. */
@@ -182,17 +184,41 @@ export const statsRpc = defineRpc({
182
184
  output: z.custom<StatsSummary>(),
183
185
  });
184
186
 
185
- export const ACTIONS = ["approve", "stop", "resume", "verify", "sync", "reply", "start"] as const;
187
+ export const ACTIONS = ["approve", "stop", "resume", "verify", "sync", "reply", "start", "try", "try-stop", "change", "handover"] as const;
186
188
  export type Action = (typeof ACTIONS)[number];
187
189
 
190
+ export interface HandoverEvent {
191
+ from: string | null;
192
+ to: string;
193
+ at: string;
194
+ note: string | null;
195
+ }
196
+
197
+ export interface RequirementHistory {
198
+ specVersion: string | null;
199
+ changes: Array<{ title: string; body: string }>;
200
+ commits: Array<{ commit: string; date: string; author: string; subject: string; diff: string; truncated: boolean }>;
201
+ owner: { owner: string | null; history: HandoverEvent[] };
202
+ }
203
+
204
+ export const historyRpc = defineRpc({
205
+ name: "req.history",
206
+ input: target,
207
+ output: z.custom<RequirementHistory>(),
208
+ });
209
+
188
210
  export const runRpc = defineRpc({
189
211
  name: "req.run",
190
212
  input: target.extend({
191
213
  action: z.enum(ACTIONS),
192
214
  /** For verify: local | deployed. */
193
215
  verifyEnv: z.enum(["local", "deployed"]).optional(),
194
- /** For reply (1.12): the answer, passed to the requirement's chat. */
216
+ /** For reply / change: the answer or change request passed to the requirement's chat. */
195
217
  text: z.string().max(8000).optional(),
218
+ /** For handover: new owner name/account. */
219
+ to: z.string().max(64).optional(),
220
+ /** For handover: optional handover note. */
221
+ note: z.string().max(500).optional(),
196
222
  }),
197
223
  output: z.object({ ok: z.boolean(), message: z.string() }),
198
224
  });
@@ -0,0 +1,425 @@
1
+ // Generated from ui/shared/view-model.ts by scripts/sync-ui-shared.mjs — do not edit directly.
2
+ // Platform-agnostic UI view-model shared by Paseo (React Native), dsh (Web plugin),
3
+ // and local web views. Zero DOM, zero React Native, zero Node imports.
4
+
5
+ export type Attention = "approval" | "business" | "permission" | "interrupted" | "not_completed" | "not_started" | null;
6
+
7
+ export type Group = "attention" | "running" | "verify" | "done" | "other";
8
+
9
+ export type ActionKind = "approve" | "stop" | "resume" | "verify" | "sync" | "start" | "reply";
10
+
11
+ export type Tone = "needs" | "running" | "success" | "warning" | "danger" | "muted";
12
+
13
+ export type Urgency = "normal" | "elevated" | "urgent";
14
+
15
+ export interface RequirementWaiting {
16
+ since: string;
17
+ reason?: string | null;
18
+ questions: string[];
19
+ canReply?: boolean;
20
+ card?: { system: string; id: string; requester?: string | null } | null;
21
+ }
22
+
23
+ export interface RequirementView {
24
+ key: string;
25
+ repo: string;
26
+ sourceRepo?: string | null;
27
+ project: string;
28
+ featureDir: string;
29
+ title: string;
30
+ branch?: string | null;
31
+ type: string | null;
32
+ profile: string | null;
33
+ stage: string;
34
+ status: string | null;
35
+ attention: Attention;
36
+ running: boolean;
37
+ updatedAt: string;
38
+ startedBy?: string | null;
39
+ owner?: string | null;
40
+ hasPrototype?: boolean;
41
+ current: Array<{ key: string; title?: string }>;
42
+ waiting?: RequirementWaiting | null;
43
+ external?: Array<{ pending: number; id: string | null }>;
44
+ jointCount?: number;
45
+ }
46
+
47
+ export const ATTENTION_LABELS: Record<Exclude<Attention, null>, string> = {
48
+ approval: "等待确认方案",
49
+ business: "等待需求方决定",
50
+ permission: "等待批准权限",
51
+ interrupted: "已中断,可以继续",
52
+ not_completed: "结束但未完成",
53
+ not_started: "已确认,未开始开发",
54
+ };
55
+
56
+ export const TYPE_LABELS: Record<string, string> = {
57
+ defect: "缺陷",
58
+ refactor: "重构",
59
+ assessment: "评估",
60
+ };
61
+
62
+ export const PROFILE_LABELS: Record<string, string> = {
63
+ quick: "快速档",
64
+ standard: "标准档",
65
+ };
66
+
67
+ export const GROUP_ORDER: Group[] = ["attention", "running", "verify", "done", "other"];
68
+
69
+ export const GROUP_LABELS: Record<Group, string> = {
70
+ attention: "需要你处理",
71
+ running: "进行中",
72
+ verify: "研发完成,待测试验证",
73
+ done: "最近完成",
74
+ other: "其他",
75
+ };
76
+
77
+ export const GROUP_EYEBROWS: Record<Group, string> = {
78
+ attention: "需要你处理",
79
+ running: "进行中",
80
+ verify: "待测试验证",
81
+ done: "最近完成",
82
+ other: "其他",
83
+ };
84
+
85
+ export const ACTION_TEXT: Record<ActionKind, { label: string; confirm: string }> = {
86
+ approve: { label: "确认方案", confirm: "确认 preview.md 中的方案,开始写代码?请先看过确认预览和原型。" },
87
+ stop: { label: "停止", confirm: "停止这个需求的流水线?正在运行的步骤会被中断,之后可以继续。" },
88
+ start: { label: "开始开发", confirm: "按已确认的需求说明开始开发?在项目主目录中的需求会新建自己的工作区。" },
89
+ resume: { label: "继续", confirm: "从中断处继续?需求说明改过的话,只处理变化的部分。" },
90
+ verify: { label: "开始测试验证", confirm: "开始测试验证?选择在哪里验证。" },
91
+ sync: { label: "同步到外部系统", confirm: "把这个需求同步到对接的外部系统:补发没有成功的调用、补建卡片、更新状态。" },
92
+ reply: { label: "发送回复", confirm: "把回复转给这个需求的对话,由它更新需求说明并继续开发。" },
93
+ };
94
+
95
+ const RECENT_MS = 14 * 24 * 3600_000;
96
+ const ELEVATED_WAIT_MS = 4 * 3600_000;
97
+ const URGENT_WAIT_MS = 24 * 3600_000;
98
+
99
+ export function groupOf(r: Pick<RequirementView, "attention" | "running" | "status" | "updatedAt">, now = Date.now()): Group {
100
+ if (r.attention) return "attention";
101
+ if (r.running) return "running";
102
+ if (r.status === "phase_done") return "verify";
103
+ if (r.status === "completed" && now - Date.parse(r.updatedAt) < RECENT_MS) return "done";
104
+ return "other";
105
+ }
106
+
107
+ export function minutes(m: number): string {
108
+ if (m < 1) return "不到 1 分钟";
109
+ if (m < 60) return `${Math.round(m)} 分钟`;
110
+ const h = Math.floor(m / 60);
111
+ const rest = Math.round(m % 60);
112
+ return rest === 0 ? `${h} 小时` : `${h} 小时 ${rest} 分`;
113
+ }
114
+
115
+ export function ago(iso: string, now = Date.now()): string {
116
+ const m = (now - Date.parse(iso)) / 60_000;
117
+ if (!Number.isFinite(m)) return "";
118
+ if (m < 1) return "刚刚";
119
+ if (m < 60) return `${Math.round(m)} 分钟前`;
120
+ if (m < 24 * 60) return `${Math.round(m / 60)} 小时前`;
121
+ return `${Math.round(m / 60 / 24)} 天前`;
122
+ }
123
+
124
+ export function waited(since: string, now = Date.now()): string {
125
+ const m = (now - Date.parse(since)) / 60_000;
126
+ if (!Number.isFinite(m) || m < 1) return "刚刚";
127
+ if (m < 60) return `等了 ${Math.round(m)} 分钟`;
128
+ if (m < 48 * 60) return `等了 ${Math.round(m / 60)} 小时`;
129
+ return `等了 ${Math.round(m / 60 / 24)} 天`;
130
+ }
131
+
132
+ export function urgencyOf(since: string, now = Date.now()): Urgency {
133
+ const ms = now - Date.parse(since);
134
+ if (!Number.isFinite(ms) || ms < ELEVATED_WAIT_MS) return "normal";
135
+ if (ms >= URGENT_WAIT_MS) return "urgent";
136
+ return "elevated";
137
+ }
138
+
139
+ export function tokens(n: number | null): string {
140
+ if (n === null) return "未报告";
141
+ return n >= 10_000 ? `${Math.round(n / 1_000) / 10} 万` : String(n);
142
+ }
143
+
144
+ export function facts(r: Pick<RequirementView, "project" | "type" | "profile" | "jointCount">): string {
145
+ return [
146
+ r.project,
147
+ r.type ? (TYPE_LABELS[r.type] ?? r.type) : null,
148
+ r.profile ? (PROFILE_LABELS[r.profile] ?? r.profile) : null,
149
+ r.jointCount && r.jointCount > 0 ? `多仓 +${r.jointCount}` : null,
150
+ ]
151
+ .filter(Boolean)
152
+ .join(" · ");
153
+ }
154
+
155
+ export function actionsFor(
156
+ r: Pick<RequirementView, "attention" | "running" | "status" | "external">,
157
+ ): Array<Exclude<ActionKind, "reply">> {
158
+ const base: Array<Exclude<ActionKind, "reply">> = r.running
159
+ ? ["stop"]
160
+ : r.attention === "approval"
161
+ ? ["approve"]
162
+ : r.attention === "interrupted" || r.attention === "business"
163
+ ? ["resume"]
164
+ : r.attention === "not_started"
165
+ ? ["start"]
166
+ : r.status === "phase_done"
167
+ ? ["verify"]
168
+ : [];
169
+ if (!r.running && r.status && (r.external ?? []).some((e) => e.pending > 0 || !e.id)) base.push("sync");
170
+ return base;
171
+ }
172
+
173
+ export const TRACK = [
174
+ { label: "对齐", who: "你" },
175
+ { label: "方案", who: "AI · 你确认" },
176
+ { label: "实现", who: "AI" },
177
+ { label: "评审", who: "AI · 开发同事" },
178
+ { label: "验证", who: "AI" },
179
+ { label: "验收", who: "需求方" },
180
+ ] as const;
181
+
182
+ const STEP_STOP: Array<[RegExp, number]> = [
183
+ [/^(design|design_review|design_revise|design_proposal|assessment|diagnosis|reproduce)/, 1],
184
+ [/^(implement|acceptance_tests)/, 2],
185
+ [/^(code_review|review_fix)/, 3],
186
+ [/^(verify|defect_fix|reverify|service|handoff|report)/, 4],
187
+ ];
188
+
189
+ export interface TrackStop {
190
+ label: string;
191
+ who: string;
192
+ state: "done" | "now" | "needs" | "todo";
193
+ }
194
+
195
+ export function trackOf(
196
+ r: Pick<RequirementView, "stage" | "status" | "attention" | "running" | "current">,
197
+ humanReview?: { status: string; stale: boolean } | null,
198
+ ): TrackStop[] {
199
+ let at = 0;
200
+ let needs = false;
201
+ const running = r.current[0]?.key;
202
+ if (r.stage.startsWith("对齐")) at = 0;
203
+ else if (r.attention === "approval" || r.attention === "business" || r.attention === "not_started") [at, needs] = [1, true];
204
+ else if (running) at = STEP_STOP.find(([re]) => re.test(running))?.[1] ?? 2;
205
+ else if (r.status === "phase_done") [at, needs] = [4, true];
206
+ else if (r.status === "completed" || /待验收|已验收|验收/.test(r.stage)) {
207
+ const reviewed = humanReview && humanReview.status === "approved" && !humanReview.stale;
208
+ if (/已验收|验收通过/.test(r.stage)) at = TRACK.length;
209
+ else if (humanReview !== undefined && !reviewed) [at, needs] = [3, true];
210
+ else [at, needs] = [5, true];
211
+ } else if (r.status) at = 2;
212
+ return TRACK.map((t, i) => ({ ...t, state: i < at ? "done" : i === at ? (needs ? "needs" : "now") : "todo" }));
213
+ }
214
+
215
+ export function iconOf(r: Pick<RequirementView, "attention" | "running" | "status" | "stage">): { name: string; tone: Tone } {
216
+ if (r.attention === "interrupted") return { name: "OctagonAlert", tone: "danger" };
217
+ if (r.attention === "permission") return { name: "ShieldCheck", tone: "needs" };
218
+ if (r.attention === "approval") return { name: "PenTool", tone: "needs" };
219
+ if (r.attention === "business") return { name: "MessagesSquare", tone: "needs" };
220
+ if (r.attention === "not_started") return { name: "Play", tone: "needs" };
221
+ if (r.attention === "not_completed") return { name: "CircleDashed", tone: "warning" };
222
+ if (r.running) return { name: "LoaderCircle", tone: "running" };
223
+ if (r.stage.startsWith("对齐")) return { name: "MessagesSquare", tone: "muted" };
224
+ if (r.status === "phase_done" || /待验收/.test(r.stage)) return { name: "ClipboardCheck", tone: "warning" };
225
+ if (r.status === "completed") return { name: "CircleCheck", tone: "success" };
226
+ return { name: "Circle", tone: "muted" };
227
+ }
228
+
229
+ export const INBOX_KIND: Record<
230
+ Exclude<Attention, null>,
231
+ { label: string; tone: "needs" | "danger" | "muted"; icon: string; todo: string; impact: string }
232
+ > = {
233
+ approval: {
234
+ icon: "PenTool",
235
+ label: "确认方案",
236
+ tone: "needs",
237
+ todo: "方案已通过审核。看一下“做完后会看到什么”,没问题就确认开始写代码;要改就写下来。",
238
+ impact: "确认前不会开始写代码,此时调整成本最低。",
239
+ },
240
+ business: {
241
+ icon: "MessagesSquare",
242
+ label: "回答问题",
243
+ tone: "needs",
244
+ todo: "方案审核有业务问题需要你拍板,回答后开发会接着进行。",
245
+ impact: "流水线暂停在方案阶段,回答前不会继续。",
246
+ },
247
+ permission: {
248
+ icon: "ShieldCheck",
249
+ label: "批准权限",
250
+ tone: "needs",
251
+ todo: "当前步骤在等你允许它执行一项操作,批准或拒绝后会立即继续。",
252
+ impact: "批准前步骤会一直停留在这里。",
253
+ },
254
+ interrupted: {
255
+ icon: "OctagonAlert",
256
+ label: "已中断",
257
+ tone: "danger",
258
+ todo: "开发中断了,自动处理没能解决。查看原因后可直接继续,已完成步骤不会重做。",
259
+ impact: "流水线已停止,需要人工确认后恢复。",
260
+ },
261
+ not_completed: {
262
+ icon: "CircleDashed",
263
+ label: "没有完成",
264
+ tone: "muted",
265
+ todo: "流水线已结束但存在未完成项,完成报告里记录了原因和建议。",
266
+ impact: "请查看完成报告决定补充开发或收尾。",
267
+ },
268
+ not_started: {
269
+ icon: "Play",
270
+ label: "还没开始开发",
271
+ tone: "needs",
272
+ todo: "需求说明已经确认,但开发尚未启动。确认无误即可点“开始开发”。",
273
+ impact: "尚未进入方案与编码阶段。",
274
+ },
275
+ };
276
+
277
+ export interface InboxCardModel {
278
+ item: RequirementView;
279
+ kind: (typeof INBOX_KIND)[Exclude<Attention, null>];
280
+ since: string;
281
+ waitedText: string;
282
+ urgency: Urgency;
283
+ primaryAction: Exclude<ActionKind, "reply"> | null;
284
+ }
285
+
286
+ /** Longest-waiting decisions first, enriched with urgency level and clear impact/CTA metadata. */
287
+ export function buildInboxCards(items: RequirementView[], now = Date.now()): InboxCardModel[] {
288
+ return items
289
+ .filter((r) => r.attention !== null)
290
+ .sort((a, b) => (a.waiting?.since ?? a.updatedAt).localeCompare(b.waiting?.since ?? b.updatedAt))
291
+ .map((item) => {
292
+ const since = item.waiting?.since ?? item.updatedAt;
293
+ const actions = actionsFor(item);
294
+ return {
295
+ item,
296
+ kind: INBOX_KIND[item.attention!],
297
+ since,
298
+ waitedText: waited(since, now),
299
+ urgency: urgencyOf(since, now),
300
+ primaryAction: actions[0] ?? null,
301
+ };
302
+ });
303
+ }
304
+
305
+ export interface BoardFilter {
306
+ project?: string | null;
307
+ group?: Group | "all";
308
+ query?: string;
309
+ }
310
+
311
+ export function filterRequirements(items: RequirementView[], filter: BoardFilter, now = Date.now()): RequirementView[] {
312
+ const q = filter.query?.trim().toLowerCase() ?? "";
313
+ return items.filter((item) => {
314
+ if (filter.project && item.project !== filter.project) return false;
315
+ if (filter.group && filter.group !== "all" && groupOf(item, now) !== filter.group) return false;
316
+ if (!q) return true;
317
+ const haystack = [
318
+ item.title,
319
+ item.project,
320
+ item.featureDir,
321
+ item.branch ?? "",
322
+ item.stage,
323
+ item.startedBy ?? "",
324
+ item.owner ?? "",
325
+ item.waiting?.card?.id ?? "",
326
+ ]
327
+ .join(" ")
328
+ .toLowerCase();
329
+ return haystack.includes(q);
330
+ });
331
+ }
332
+
333
+ export interface BoardSummary {
334
+ total: number;
335
+ attention: number;
336
+ running: number;
337
+ verify: number;
338
+ done: number;
339
+ urgentCount: number;
340
+ longestWaitText: string | null;
341
+ }
342
+
343
+ /** Top-bar KPI summary across requirements (Linear / Vercel Dashboard style). */
344
+ export function summarizeBoard(items: RequirementView[], now = Date.now()): BoardSummary {
345
+ let attention = 0;
346
+ let running = 0;
347
+ let verify = 0;
348
+ let done = 0;
349
+ let urgentCount = 0;
350
+ let oldestWaitSince: string | null = null;
351
+
352
+ for (const item of items) {
353
+ const g = groupOf(item, now);
354
+ if (g === "attention") {
355
+ attention++;
356
+ const since = item.waiting?.since ?? item.updatedAt;
357
+ if (!oldestWaitSince || since < oldestWaitSince) oldestWaitSince = since;
358
+ if (urgencyOf(since, now) === "urgent") urgentCount++;
359
+ } else if (g === "running") running++;
360
+ else if (g === "verify") verify++;
361
+ else if (g === "done") done++;
362
+ }
363
+
364
+ return {
365
+ total: items.length,
366
+ attention,
367
+ running,
368
+ verify,
369
+ done,
370
+ urgentCount,
371
+ longestWaitText: oldestWaitSince ? waited(oldestWaitSince, now) : null,
372
+ };
373
+ }
374
+
375
+ export interface ChecklistItemView {
376
+ id: string;
377
+ kind: "criterion" | "decision";
378
+ title: string;
379
+ required: boolean;
380
+ pipeline: "pass" | "fail" | "unverified" | "unknown";
381
+ evidence: string | null;
382
+ }
383
+
384
+ export interface ChecklistSummary {
385
+ total: number;
386
+ requiredTotal: number;
387
+ pipelinePass: number;
388
+ pipelineNeedsEyes: number;
389
+ checkedPass: number;
390
+ checkedFail: number;
391
+ remainingRequired: number;
392
+ }
393
+
394
+ /** Summarizes pipeline verification progress and human acceptance ticks for the workbench. */
395
+ export function summarizeChecklist(
396
+ items: ChecklistItemView[],
397
+ marks: Record<string, "pass" | "fail" | "skip"> = {},
398
+ ): ChecklistSummary {
399
+ let requiredTotal = 0;
400
+ let pipelinePass = 0;
401
+ let pipelineNeedsEyes = 0;
402
+ let checkedPass = 0;
403
+ let checkedFail = 0;
404
+ let remainingRequired = 0;
405
+
406
+ for (const item of items) {
407
+ if (item.required) requiredTotal++;
408
+ if (item.pipeline === "pass") pipelinePass++;
409
+ else pipelineNeedsEyes++;
410
+ const m = marks[item.id];
411
+ if (m === "pass") checkedPass++;
412
+ else if (m === "fail") checkedFail++;
413
+ else if (item.required) remainingRequired++;
414
+ }
415
+
416
+ return {
417
+ total: items.length,
418
+ requiredTotal,
419
+ pipelinePass,
420
+ pipelineNeedsEyes,
421
+ checkedPass,
422
+ checkedFail,
423
+ remainingRequired,
424
+ };
425
+ }
package/bin/req.mjs CHANGED
@@ -41,6 +41,8 @@ const HELP = `laoshi ${version}(${kitRoot})
41
41
  laoshi permission <需求> approve|deny [理由]
42
42
  批准或拒绝步骤等待批准的操作,并接着运行(平台在对话里问人时用)
43
43
  laoshi reply <需求> <回复> 把回答或方案意见转给需求的对话(需求插件的"等你处理"用它)
44
+ laoshi handover <需求> <接手人> [--note <说明>]
45
+ 把需求转交给另一位同事负责(记入 .pipeline/owner.json)
44
46
  laoshi integration test [需求] 只显示对接外部系统时会执行的命令,不真正调用
45
47
  laoshi start --from <系统>:<卡号> 从需求管理系统中的一张卡片开始需求(没有人开着对话也可以)
46
48
  laoshi card check [<卡号>|--all] 读取需求方在卡片中的回复,转给需求的会话
@@ -61,6 +63,8 @@ const HELP = `laoshi ${version}(${kitRoot})
61
63
  laoshi index [--rebuild [目录…]] [--prune]
62
64
  本机记录的需求(需求插件据此找到所有需求);索引里缺的需求用 --rebuild 补登
63
65
  laoshi api <命令> … 给程序用的 JSON 输出(见 contracts/cli-json.md)
66
+ laoshi board [--port <端口>] [--repo <目录>] [--read-only] [--no-open]
67
+ 在本机打开需求看板网页(查看所有需求、产物与待处理操作)
64
68
  laoshi plugin install [--yes] | status | remove
65
69
  Paseo 的需求插件(在 Paseo 里看需求、确认方案、停止和继续)
66
70
  laoshi migrate [--apply | --rollback] [--from <目录>] [--to <目录>]
@@ -196,9 +200,15 @@ switch (command) {
196
200
  case "api":
197
201
  code = needTsx() ? node([tsxCli, path.join(kitRoot, "engine", "src", "api.ts"), ...rest]) : 1;
198
202
  break;
203
+ case "board":
204
+ code = needTsx() ? node([tsxCli, path.join(kitRoot, "engine", "src", "board.ts"), ...rest]) : 1;
205
+ break;
199
206
  case "reply":
200
207
  code = needTsx() ? node([tsxCli, path.join(kitRoot, "engine", "src", "reply.ts"), ...rest]) : 1;
201
208
  break;
209
+ case "handover":
210
+ code = needTsx() ? node([tsxCli, path.join(kitRoot, "engine", "src", "handover-cmd.ts"), ...rest]) : 1;
211
+ break;
202
212
  case "permission":
203
213
  // Answers a step's pending approval, then continues the run (the step picks up the answer).
204
214
  code = needTsx() ? node([tsxCli, path.join(kitRoot, "engine", "src", "permission-cmd.ts"), ...rest]) : 1;
@@ -24,10 +24,11 @@
24
24
  | `req api list [--repo <目录>]` | 这个仓库所有工作区中的需求,数组,每项见下面的"需求" |
25
25
  | `req api list --all` | 本机记录过的所有需求([需求索引](usage-record.md)),同上;目录已不在的 `present: false`。1.14 起还包括:用 `--track` 登记、还在对齐中的需求(`stage` 为"对齐中",没有 `spec.md` 时 `title` 取自 `alignment.md`),以及索引里出现过的项目中没登记的需求 |
26
26
  | `req api status <需求> [--repo <目录>]` | 一个需求的详情,见下面的"详情" |
27
+ | `req api history <需求> [--repo <目录>]` | 需求的变更历史与负责人:`{ specVersion, changes: [{ title, body }], commits: [{ commit, date, author, subject, diff, truncated }], owner: { owner, history } }` |
27
28
  | `req api file <需求> <文件> [--repo <目录>]` | `{ featureDir, file, size, truncated, content }`;只能读取功能目录中的文档(见下),最多 512 KB |
28
29
  | `req api stats [--since 30d] [--month 2026-10]` | `req stats --json` 的内容,见 [使用记录](usage-record.md) |
29
30
  | `req api index [--rebuild <目录>…] [--prune]` | 不带选项:索引的全部条目;`--rebuild`:`{ scanned, registered, pruned, total }` |
30
- | `req api run <approve\|stop\|resume\|verify\|sync\|reply\|start> <需求> [--repo <目录>] [选项]` | `{ command, featureDir, ok, exitCode, message }`。在 `--repo`(默认当前目录)中执行与 `req <命令> <需求>` 完全相同的操作;`ok` 为 false 时退出码为 1。`start`(1.14):在项目主目录中自动加 `--worktree`(上次已建好工作区的接着用),并把进展发回登记时的对话 |
31
+ | `req api run <approve\|stop\|resume\|verify\|sync\|reply\|start\|try\|handover> <需求> [--repo <目录>] [选项]` | `{ command, featureDir, ok, exitCode, message }`。在 `--repo`(默认当前目录)中执行与 `req <命令> <需求>` 完全相同的操作;`ok` 为 false 时退出码为 1。`start`(1.14):在项目主目录中自动加 `--worktree`(上次已建好工作区的接着用),并把进展发回登记时的对话;`reply --change <需求> <改动内容>`:从看板/插件发起改需求通知对话先停下再对齐变化;`handover <需求> <接手人> [--note <说明>]`:转交负责人到 `.pipeline/owner.json` |
31
32
  | `req api models` | 1.12 起。`{ current, choices, recommended }`:本机配置中现在的 `agents`;daemon 上能无人值守运行的选择(`{ id, label, provider, profile }`,Paseo profile 在前);按推荐的 `agents`。连不上 daemon 时报错 |
32
33
  | `req api config [--repo <目录>] [--machine]` | 1.12 起。`{ sources, ignored, error, repo, groups }`:`sources` 是生效的配置文件(`layer` 为 `machine` / `team` / `project`,按叠加顺序);`groups` 按主题分组,每项 `{ key, label, description, display, value, setBy, scope, changed }`:`display` 是用大白话写的值,`value` 中看起来像密钥的值和个人账号替换为 `••••`,`setBy` 是写了它的文件,`changed` 表示与默认值不同。配置有错误时 `error` 写明原因,值按各文件所写。`--machine` 不看项目配置 |
33
34
  | `req api set-agents --json <设置>` | 1.12 起。`{ ok, message }`。`<设置>` 是 `{ builder, reviewer, fallback }`(`fallback` 可以为 null),检查后写入本机配置的 `agents`,原文件备份 |
@@ -46,6 +47,7 @@
46
47
  | `project` | 项目名:对话所在目录的目录名 |
47
48
  | `codebase` | laoshi M2c 起。需求所属的代码库:`{ root, remote }`,`root` 是主检出目录(需求自己的 worktree 归属它的原仓库),`remote` 是 origin 的地址(去掉凭据),没有时为 null(ADR 0007) |
48
49
  | `startedBy` | laoshi 起。发起人:状态文件的 `startedBy`;还没运行过、或状态文件是更早的版本时为 null |
50
+ | `owner` | 转交接手后的当前负责人(`.pipeline/owner.json` 中的 `owner`);未转交过时为 null |
49
51
  | `repo` | 需求所在的目录(有自己的工作区时是那个工作区) |
50
52
  | `sourceRepo` / `workspaceId` | 有自己的工作区时:对话所在的目录、平台对这个工作区的引用(Paseo 上是工作区 ID);否则 null |
51
53
  | `featureDir` / `name` / `title` | 功能目录、目录名、需求标题 |
@@ -44,21 +44,21 @@ laoshi 引擎(外部的确定性进程,状态在 .pipeline/state.json)
44
44
  | AgentRuntime | dsh 上的做法 | 来源 | 验证 |
45
45
  | --- | --- | --- | --- |
46
46
  | `verifyOrigin` | 用 `session/list` 找到 `DSH_SESSION_ID` 对应的会话,核对 `cwd` | platform | 部分(字段已确认) |
47
- | `startAgent` | 插件调用 `ctx.subagents.startActivation`:`parent` 为发起会话,`delivery: "caller"`,`label` 为步骤名,`cwd` 为仓库或 worktree,`agentPreset` 按角色选择。没有插件时退回 `session/create`,创建顶层会话,不显示在对话下 | plugin | 是 |
47
+ | `startAgent` | 插件调用 `ctx.subagents.startActivation`:`parent` 为发起会话,`delivery: "caller"`,`label` 为步骤名,`cwd` 为仓库或 worktree,`agentPreset` / `agentOptions` 按角色选择(插件同时兼容 `0.2.2-alpha.2` 的嵌套 `request` 与 `0.2.2-rc.5+` 的扁平顶层参数)。没有插件时退回 `session/create`,创建顶层会话,不显示在对话下 | plugin | 是 |
48
48
  | `StepAgent.wait` | 轮询 `session/list` 中子会话的 `running`;"在等审批"由插件报告(见 §5)。之后可以换成订阅事件流 | platform + plugin | 是(轮询) |
49
- | `StepAgent.followUp` | `subagents/prompt`,`mode: "continuable"`,`delivery: "queue"` | platform | 是 |
49
+ | `StepAgent.followUp` | `subagents/prompt`,`delivery: "queue"`(旧版附带 `parentSessionId`、`mode: "continuable"`) | platform | 是 |
50
50
  | `StepAgent.archive` | `workspaces` 的 `archiveSession` | platform | 否 |
51
51
  | `attachAgent` | 按会话 ID 继续;host 会冷恢复已持久化的会话 | platform | 是(顶层会话和子会话都已验证,见摸底包自测 P12) |
52
52
  | `notifyAgent` | `session/prompt`,`mode: "queue"` | platform | 是 |
53
- | `interruptAgent` | 子会话用 `subagents/interruptByParent` 或 `session/cancel`,再用 queue 模式发送新指令 | platform | `session/cancel` 已验证 |
53
+ | `interruptAgent` | 子会话优先调用 `ctx.subagents.interrupt(sessionId, { kind: "user" })`(或 `interruptByUser`,旧版回退 `interruptByParent`);普通会话用 `session/cancel`,再用 queue 模式发送新指令 | platform | `0.2.2-rc.5` 与 `session/cancel` 均已验证 |
54
54
  | `listPaseoProfiles`(将改名,见 ADR 0008) | `agentPresets` 的列表,以及模型目录 | platform | 否 |
55
55
  | `listServices` / `startServices` / `stopServices` | dsh 没有服务定义。由 laoshi 内置的服务管理读取代码库配置中的服务,分配端口,做健康检查,保留输出 | builtin | — |
56
56
  | `createWorktree` / `waitForWorkspaceSetup` | laoshi 内置的 `git worktree`。可选启用 `dsh-experimental-worktree`,但它会改变会话的工作目录,和"步骤在 worktree、对话在原目录"的做法需要先对齐 | builtin | — |
57
- | `scheduleMessage` / `cancelSchedule` | 插件调用 `ctx.schedule.create(sessionId, …)`;用 `/api` 的 `schedule/delete` 取消 | plugin | 创建已验证 |
58
- | `scheduleNewAgent` | 插件为定时任务创建一个专用会话,再预约到它 | plugin | 否 |
57
+ | `scheduleMessage` / `cancelSchedule` | 插件调用 `ctx.schedule.create`(兼容 `0.2.2-alpha.2` 与 `0.2.2-rc.5+` 的 `{ title, prompt, timing, target }` 对象格式及必填 `cron.time_zone`),支持 `expiresAt` 到期由插件定时取消;`0.2.2-rc.5+` 通过 `ctx.schedule.edit({ action: "delete" })` 取消(旧版 `ctx.schedule.delete`) | plugin | `0.2.2-rc.5` 实机创建、取消与 `expiresAt` 到期取消均已验证 |
58
+ | `scheduleNewAgent` | 插件为定时任务创建一个专用会话,再预约到它(使用 dsh 默认模型) | plugin | `0.2.2-rc.5` 实机已验证 |
59
59
  | `startSessionAgent` | `session/create`,再 `session/prompt` | platform | 是 |
60
60
  | `providerQuota` | 没有订阅额度;只能拿到每个会话的 `tokenUsage` | none | — |
61
- | `recentActivity` / `runningTool` / `toolCalls` | `session/page` 中的 `tool/call`、`tool/result` 事件 | platform | 事件已确认 |
61
+ | `recentActivity` / `runningTool` / `toolCalls` | 优先通过 `sessions.events`(旧版回退 `session/page`)读取 `tool/call`、`tool/result` 事件 | platform | 事件已确认 |
62
62
  | `capabilities` | 看是否挂载了 `browser-use` 等插件 | platform | 否 |
63
63
  | `providerStatus` | 模型目录与凭据状态 | platform | 否 |
64
64
  | 用量(`WaitOutcome.usage`) | `projections.tokenUsage` | platform | 是 |
@@ -139,7 +139,7 @@ M2b 起,`--worktree` 和服务改用 laoshi 的内置实现([builtin-capabil
139
139
 
140
140
  ## 10. 正式版的进展(M4b,2026-11-04)
141
141
 
142
- - **按角色选择模型**:agent 的 `provider` 写成 `<dsh 的提供方>/<模型>`,插件在 `startActivation` 的 `request.agentOptions` 中传入 `provider`、`model`,以及来自 `thinkingOptionId` 的 `reasoningEffort`。dsh 的 spawn 后端支持这一项,子 agent 默认继承父 agent 的模型,这里可以覆盖。`dsh/chat-model` 表示用对话的模型。
142
+ - **按角色选择模型**:agent 的 `provider` 写成 `<dsh 的提供方>/<模型>`,插件在 `startActivation` 中通过 `agentOptions`(`0.2.2-alpha.2` 为 `request.agentOptions`,`0.2.2-rc.5+` 为顶层 `agentOptions`)传入 `provider`、`model`,以及来自 `thinkingOptionId` 的 `reasoningEffort`。dsh 的 spawn 后端支持这一项,子 agent 默认继承父 agent 的模型,这里可以覆盖。`dsh/chat-model` 表示用对话的模型。
143
143
  - **列出模型**:插件新增 `models` 操作(`ctx.llm.listProviders()` / `listModels()`)。`doctor` 显示可用的模型并逐个角色检查;运行时的 `providerStatus` 也由它提供,接单器的自检因此能用。插件因此多注入一个 `llm` 服务。
144
- - 在真实 dsh(0.2.2-alpha.2)上验证:reviewer 的三个步骤用自己的模型,builder 的步骤用对话的模型;`doctor` 列出模型、逐个角色检查通过(`adapters/dsh/e2e`)。
145
- - 能力表中还是"无"的:平台的 agent profile(dsh 的 agent 预设可以对应,暂不做)、定时启动 agent(需求总览定时发送)、额度、平台工具信息。按契约,这几项缺失只影响对应的附加功能。
144
+ - 在真实 dsh(`0.2.2-alpha.2` 与 `0.2.2-rc.5`)上验证:reviewer 的三个步骤用自己的模型,builder 的步骤用对话的模型;`doctor` 列出模型、逐个角色检查通过(`adapters/dsh/e2e`)。
145
+ - 能力表中后续已补齐 `scheduleAgent`(见 [adapters/dsh/README.md](../../adapters/dsh/README.md))与托管 Web 需求看板 `board` RPC;目前仍未接入或待后续确认的仅剩:平台的 agent profile(dsh 的 agent 预设可以对应,暂不做)、额度、平台工具信息、事件流替代轮询,以及浏览器能力探测。
@@ -0,0 +1,43 @@
1
+ # M4:跨平台共用界面视图层与 UI 体验规范
2
+
3
+ > 对应 [docs/roadmap.md](../roadmap.md) P1 的 **M4(共用界面组件)**,为 **D1(dsh 界面插件)**、**X1(集中处理待办)**、**X2(验收工作台)** 及 **G3(合规与效能报告页)** 提供统一基础。
4
+
5
+ ## 1. 为什么采用两层共享架构
6
+
7
+ | 平台 | 运行环境 | 约束 |
8
+ |---|---|---|
9
+ | Paseo 插件 | React Native(`adapters/paseo/plugin/`) | 独立拷贝安装,禁止 DOM API,禁止跨出插件目录的相对导入 |
10
+ | dsh 界面插件 / 本机看板 | Web(HTML / React DOM) | 浏览器环境,直接消费 `design/` 的 `--rk-*` CSS 变量与组件样式 |
11
+
12
+ 两者底层数据完全一致(均消费 `laoshi api` 的 JSON 契约 [contracts/cli-json.md](../../contracts/cli-json.md)),设计语言也完全一致([design/README.md](../../design/README.md) 的 Bento Launchpad 家族:青柠绿表示"等你决定"、靛蓝表示 AI、青色表示运行中)。因此拆为两层:
13
+
14
+ 1. **`ui/shared/view-model.ts`(纯 TypeScript 领域视图模型)**:
15
+ - 零 DOM、零 React Native、零 Node 导入;
16
+ - 统一负责分组(`groupOf`)、6 站放行轨(`trackOf`)、图标与语义色(`iconOf`)、可执行动作矩阵(`actionsFor`)、时间与用量格式化、顶部 KPI 汇总(`summarizeBoard`)、组合筛选搜索(`filterRequirements`)、以及按紧迫度排序的待处理卡片模型(`buildInboxCards`)。
17
+ - Paseo 插件、dsh 界面插件、本机网页全部共用同一套业务状态判断与文案,避免逻辑漂移。
18
+ 2. **`ui/web/board.ts`(Web 共享视图层)**:
19
+ - 面向 dsh 界面插件(D1)和本机看板;
20
+ - 直接复用 `design/reference/tokens.css`(或 `engine/src/review-assets/rk-tokens.css`)的 `--rk-*` 变量,支持深色默认与浅色切换。
21
+
22
+ ## 2. 参考业界最佳实践的 UI 体验优化
23
+
24
+ 在原有 Paseo 插件界面基础上,借鉴 **Linear(待办聚焦与快捷键)**、**GitHub Actions(步骤放行轨)** 与 **Vercel Dashboard(Bento KPI 概览与抽屉详情)** 的交互模式:
25
+
26
+ 1. **顶部 4 格 Bento KPI 概览条(点击即筛选)**:
27
+ - 展示「需要你处理」「进行中」「待测试验证」「最近完成」四个数字;当存在等待超过 24 小时的紧急事项时自动标出最长等待时长。
28
+ - 点击任意 KPI 卡片即可切换对应筛选状态,减少多层跳转。
29
+ 2. **即时搜索与项目胶囊(支持 `/` 快捷键)**:
30
+ - 支持按需求标题、项目名、目录、分支、卡片编号与发起人实时过滤;
31
+ - 多仓库场景自动展示 `多仓 +N` 标识。
32
+ 3. **高优"等你处理"聚焦区(Needs You)**:
33
+ - 按等待时长从久到近排序,自动标注紧迫度(`< 4h` 常规、`≥ 4h` 关注、`≥ 24h` 紧急);
34
+ - 每张卡给出**一句话影响说明**("确认前不会开始写代码"等)与**唯一青柠绿主操作 CTA**,避免按钮堆砌。
35
+ 4. **6 站可视化放行轨 + 右侧详情抽屉**:
36
+ - 每条需求行直接呈现 6 站放行轨(对齐 → 方案 → 实现 → 评审 → 验证 → 验收),进行中带青色脉冲指示,等你决定带青柠高亮;
37
+ - 点击任意行在右侧滑出详情抽屉(不丢失列表滚动位置与筛选条件),支持 `Esc` 关闭,窄屏(400px)自动单栏自适应。
38
+
39
+ ## 3. 后续接入路径
40
+
41
+ - **D1(dsh 界面插件)**:直接挂载 `ui/web/board.ts`(或基于同一 CSS/DOM 结构绑定 dsh 插件 RPC),把只读/操作请求转发到 `laoshi api`。
42
+ - **X1 / X2(集中处理与验收工作台)**:在 `ui/shared/view-model.ts` 增加验收清单与证据状态模型,抽屉内增加「一键试用」「验收勾选」「证据预览」标签页,Paseo 与 dsh 同步获得。
43
+ - **G3(合规与效能报告页)**:在顶栏新增「统计与合规」视图,同样复用 `ui/shared` 聚合模型。