@hugesb/dsh-stream-agent 0.0.0-stage → 0.3.2

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 (161) hide show
  1. package/CHANGELOG.md +622 -0
  2. package/CONTRIBUTING.md +72 -0
  3. package/LICENSE +202 -0
  4. package/README.en.md +349 -0
  5. package/README.md +300 -3
  6. package/cordis.patch.yml +77 -0
  7. package/dist/entry/action-gate.js +206 -0
  8. package/dist/entry/adapter-kit.js +192 -0
  9. package/dist/entry/context-render.js +119 -0
  10. package/dist/entry/control-bar-cli.js +289 -0
  11. package/dist/entry/control-bar.js +123 -0
  12. package/dist/entry/control-session.js +115 -0
  13. package/dist/entry/control-state.js +125 -0
  14. package/dist/entry/cordis-compat.js +95 -0
  15. package/dist/entry/eval-probe.js +112 -0
  16. package/dist/entry/intent-log.js +121 -0
  17. package/dist/entry/json-persistence.js +306 -0
  18. package/dist/entry/loop.js +4163 -0
  19. package/dist/entry/mock-provider.js +549 -0
  20. package/dist/entry/obs-broker.js +178 -0
  21. package/dist/entry/ptc-bridge.js +405 -0
  22. package/dist/entry/state-handle.js +217 -0
  23. package/dist/entry/takeover-registry.js +60 -0
  24. package/dist/kernel/control-bar.js +559 -0
  25. package/dist/kernel/final.js +62 -0
  26. package/dist/kernel/gate.js +464 -0
  27. package/dist/kernel/modes.js +253 -0
  28. package/dist/kernel/obs.js +517 -0
  29. package/dist/kernel/parser.js +1081 -0
  30. package/dist/kernel/render.js +466 -0
  31. package/dist/kernel/state.js +416 -0
  32. package/dist/version.js +9 -0
  33. package/docs/TEST-PROPOSITIONS.md +139 -0
  34. package/docs/adr-001-segment-boundary.md +61 -0
  35. package/docs/architecture.md +104 -0
  36. package/docs/desktop-ui-feasibility.md +277 -0
  37. package/docs/disabled-lines-audit.md +53 -0
  38. package/docs/limitations.md +181 -0
  39. package/docs/protocol.md +99 -0
  40. package/docs/v0.4.0-plan.md +50 -0
  41. package/eval/METRICS.md +128 -0
  42. package/eval/RESULTS.md +246 -0
  43. package/eval/tasks/fixtures/big-report.md +298 -0
  44. package/eval/tasks/fixtures/build-manifest.txt +5 -0
  45. package/eval/tasks/fixtures/deploy.yaml +4 -0
  46. package/eval/tasks/fixtures/error.log +200 -0
  47. package/eval/tasks/fixtures/features.yaml +4 -0
  48. package/eval/tasks/fixtures/pipeline.yaml +4 -0
  49. package/eval/tasks/fixtures/sales-q1.csv +61 -0
  50. package/eval/tasks/fixtures/settings.yaml +4 -0
  51. package/eval/tasks/fixtures/users-roster.json +304 -0
  52. package/eval/tasks/fixtures/users-scores.json +20 -0
  53. package/eval/tasks/gen-fixtures.cjs +80 -0
  54. package/eval/tasks/tasks.json +150 -0
  55. package/eval/tools/f6-kill-drill.cjs +176 -0
  56. package/eval/tools/f6-kill-drill.worker.cjs +131 -0
  57. package/eval/tools/gen-results.cjs +191 -0
  58. package/eval/tools/machine-test.cjs +200 -0
  59. package/eval/tools/manual-code-scenarios.md +59 -0
  60. package/eval/tools/replay-check.cjs +311 -0
  61. package/eval/tools/runner.cjs +219 -0
  62. package/eval/tools/session-log.cjs +106 -0
  63. package/eval/tools/summarize.cjs +185 -0
  64. package/eval/tools/t3-cells.cjs +173 -0
  65. package/package.json +73 -6
  66. package/patches/adapters-smoke.yml +41 -0
  67. package/patches/eval-account.yml +36 -0
  68. package/patches/eval-baseline.yml +33 -0
  69. package/patches/eval-stream-code-off.yml +46 -0
  70. package/patches/eval-stream-code-on.yml +47 -0
  71. package/patches/eval-stream.yml +54 -0
  72. package/patches/takeover.yml +42 -0
  73. package/patches/test-preset.yml +23 -0
  74. package/preset/stream/cordis.patch.yml +39 -0
  75. package/preset/stream/package.json +13 -0
  76. package/preset.yml +56 -0
  77. package/profiles/stream/README.md +66 -0
  78. package/profiles/stream/cordis.patch.yml +12 -0
  79. package/profiles/stream/package.json +17 -0
  80. package/profiles/stream-headless/package.json +16 -0
  81. package/scripts/build.mjs +103 -0
  82. package/scripts/check-consistency.mjs +146 -0
  83. package/scripts/gate.mjs +138 -0
  84. package/scripts/install-check.mjs +116 -0
  85. package/scripts/install-cycle.mjs +88 -0
  86. package/scripts/release.mjs +428 -0
  87. package/scripts/repair-session-logs.mjs +498 -0
  88. package/src/entry/action-gate.ts +206 -0
  89. package/src/entry/adapter-kit.ts +192 -0
  90. package/src/entry/context-render.ts +119 -0
  91. package/src/entry/control-bar-cli.ts +289 -0
  92. package/src/entry/control-bar.ts +123 -0
  93. package/src/entry/control-session.ts +115 -0
  94. package/src/entry/control-state.ts +125 -0
  95. package/src/entry/cordis-compat.ts +95 -0
  96. package/src/entry/eval-probe.ts +112 -0
  97. package/src/entry/intent-log.ts +121 -0
  98. package/src/entry/json-persistence.ts +306 -0
  99. package/src/entry/loop.ts +4163 -0
  100. package/src/entry/mock-provider.ts +549 -0
  101. package/src/entry/obs-broker.ts +178 -0
  102. package/src/entry/ptc-bridge.ts +405 -0
  103. package/src/entry/state-handle.ts +217 -0
  104. package/src/entry/takeover-registry.ts +60 -0
  105. package/src/kernel/control-bar.ts +559 -0
  106. package/src/kernel/final.ts +62 -0
  107. package/src/kernel/gate.ts +464 -0
  108. package/src/kernel/modes.ts +253 -0
  109. package/src/kernel/obs.ts +517 -0
  110. package/src/kernel/parser.ts +1081 -0
  111. package/src/kernel/render.ts +466 -0
  112. package/src/kernel/state.ts +416 -0
  113. package/src/version.ts +9 -0
  114. package/test/activation.test.ts +187 -0
  115. package/test/adapters.test.ts +676 -0
  116. package/test/control-bar.test.ts +486 -0
  117. package/test/desktop-ui.test.ts +359 -0
  118. package/test/eval-probe.test.ts +139 -0
  119. package/test/f5-plan.test.ts +221 -0
  120. package/test/f6-intent.test.ts +168 -0
  121. package/test/f7-segment.test.ts +190 -0
  122. package/test/fix-limits.test.ts +599 -0
  123. package/test/gate.test.ts +380 -0
  124. package/test/helpers/stub-loop.ts +240 -0
  125. package/test/host-conformance.test.ts +418 -0
  126. package/test/kernel/obs.test.ts +329 -0
  127. package/test/kernel/parser.test.ts +451 -0
  128. package/test/loop.test.ts +1393 -0
  129. package/test/mock-provider.test.ts +386 -0
  130. package/test/ptc-bridge.test.ts +356 -0
  131. package/test/render.test.ts +418 -0
  132. package/test/s2-install-check.test.ts +46 -0
  133. package/test/scenarios/3-file-basic.json +13 -0
  134. package/test/scenarios/5-file-basic.json +22 -0
  135. package/test/scenarios/burn-more.json +9 -0
  136. package/test/scenarios/degraded-final.json +10 -0
  137. package/test/scenarios/fault-abort-xml.json +11 -0
  138. package/test/scenarios/fault-malformed-command.json +12 -0
  139. package/test/scenarios/fault-midstream-abort.json +11 -0
  140. package/test/scenarios/fault-saturating-output.json +9 -0
  141. package/test/scenarios/fault-timeout.json +9 -0
  142. package/test/scenarios/peek-first.json +11 -0
  143. package/test/scenarios/peek-second.json +11 -0
  144. package/test/scenarios/peek-third.json +10 -0
  145. package/test/scenarios/recover-final.json +10 -0
  146. package/test/scenarios/reroute-first.json +17 -0
  147. package/test/scenarios/reroute-second.json +16 -0
  148. package/test/scenarios/starvation-final.json +10 -0
  149. package/test/scenarios/starvation-promote.json +11 -0
  150. package/test/scenarios/wait-tools-continue.json +10 -0
  151. package/test/scenarios/wait-tools-xml.json +22 -0
  152. package/test/scenarios/wait-tools.json +15 -0
  153. package/test/session-format.test.ts +234 -0
  154. package/test/state.test.ts +335 -0
  155. package/test/stream-v02.test.ts +264 -0
  156. package/test/v031-display.test.ts +333 -0
  157. package/test/v032-conflict.test.ts +191 -0
  158. package/test/v032-truncation.test.ts +291 -0
  159. package/ui/client.js +576 -0
  160. package/ui/index.js +282 -0
  161. package/ui/package.json +26 -0
@@ -0,0 +1,304 @@
1
+ {
2
+ "users": [
3
+ {
4
+ "id": "u-0001",
5
+ "name": "user1",
6
+ "tier": "free"
7
+ },
8
+ {
9
+ "id": "u-0002",
10
+ "name": "user2",
11
+ "tier": "pro"
12
+ },
13
+ {
14
+ "id": "u-0003",
15
+ "name": "user3",
16
+ "tier": "team"
17
+ },
18
+ {
19
+ "id": "u-0004",
20
+ "name": "user4",
21
+ "tier": "free"
22
+ },
23
+ {
24
+ "id": "u-0005",
25
+ "name": "user5",
26
+ "tier": "pro"
27
+ },
28
+ {
29
+ "id": "u-0006",
30
+ "name": "user6",
31
+ "tier": "team"
32
+ },
33
+ {
34
+ "id": "u-0007",
35
+ "name": "user7",
36
+ "tier": "free"
37
+ },
38
+ {
39
+ "id": "u-0008",
40
+ "name": "user8",
41
+ "tier": "pro"
42
+ },
43
+ {
44
+ "id": "u-0009",
45
+ "name": "user9",
46
+ "tier": "team"
47
+ },
48
+ {
49
+ "id": "u-0010",
50
+ "name": "user10",
51
+ "tier": "free"
52
+ },
53
+ {
54
+ "id": "u-0011",
55
+ "name": "user11",
56
+ "tier": "pro"
57
+ },
58
+ {
59
+ "id": "u-0012",
60
+ "name": "user12",
61
+ "tier": "team"
62
+ },
63
+ {
64
+ "id": "u-0013",
65
+ "name": "user13",
66
+ "tier": "free"
67
+ },
68
+ {
69
+ "id": "u-0014",
70
+ "name": "user14",
71
+ "tier": "pro"
72
+ },
73
+ {
74
+ "id": "u-0015",
75
+ "name": "user15",
76
+ "tier": "team"
77
+ },
78
+ {
79
+ "id": "u-0016",
80
+ "name": "user16",
81
+ "tier": "free"
82
+ },
83
+ {
84
+ "id": "u-0017",
85
+ "name": "user17",
86
+ "tier": "pro"
87
+ },
88
+ {
89
+ "id": "u-0018",
90
+ "name": "user18",
91
+ "tier": "team"
92
+ },
93
+ {
94
+ "id": "u-0019",
95
+ "name": "user19",
96
+ "tier": "free"
97
+ },
98
+ {
99
+ "id": "u-0020",
100
+ "name": "user20",
101
+ "tier": "pro"
102
+ },
103
+ {
104
+ "id": "u-0021",
105
+ "name": "user21",
106
+ "tier": "team"
107
+ },
108
+ {
109
+ "id": "u-0022",
110
+ "name": "user22",
111
+ "tier": "free"
112
+ },
113
+ {
114
+ "id": "u-0023",
115
+ "name": "user23",
116
+ "tier": "pro"
117
+ },
118
+ {
119
+ "id": "u-0024",
120
+ "name": "user24",
121
+ "tier": "team"
122
+ },
123
+ {
124
+ "id": "u-0025",
125
+ "name": "user25",
126
+ "tier": "free"
127
+ },
128
+ {
129
+ "id": "u-0026",
130
+ "name": "user26",
131
+ "tier": "pro"
132
+ },
133
+ {
134
+ "id": "u-0027",
135
+ "name": "user27",
136
+ "tier": "team"
137
+ },
138
+ {
139
+ "id": "u-0028",
140
+ "name": "user28",
141
+ "tier": "free"
142
+ },
143
+ {
144
+ "id": "u-0029",
145
+ "name": "user29",
146
+ "tier": "pro"
147
+ },
148
+ {
149
+ "id": "u-0030",
150
+ "name": "user30",
151
+ "tier": "team"
152
+ },
153
+ {
154
+ "id": "u-0031",
155
+ "name": "user31",
156
+ "tier": "free"
157
+ },
158
+ {
159
+ "id": "u-0032",
160
+ "name": "user32",
161
+ "tier": "pro"
162
+ },
163
+ {
164
+ "id": "u-0033",
165
+ "name": "user33",
166
+ "tier": "team"
167
+ },
168
+ {
169
+ "id": "u-0034",
170
+ "name": "user34",
171
+ "tier": "free"
172
+ },
173
+ {
174
+ "id": "u-0035",
175
+ "name": "user35",
176
+ "tier": "pro"
177
+ },
178
+ {
179
+ "id": "u-0036",
180
+ "name": "user36",
181
+ "tier": "team"
182
+ },
183
+ {
184
+ "id": "u-0037",
185
+ "name": "user37",
186
+ "tier": "free"
187
+ },
188
+ {
189
+ "id": "u-0038",
190
+ "name": "user38",
191
+ "tier": "pro"
192
+ },
193
+ {
194
+ "id": "u-0039",
195
+ "name": "user39",
196
+ "tier": "team"
197
+ },
198
+ {
199
+ "id": "u-0040",
200
+ "name": "user40",
201
+ "tier": "free"
202
+ },
203
+ {
204
+ "id": "u-0041",
205
+ "name": "user41",
206
+ "tier": "pro"
207
+ },
208
+ {
209
+ "id": "u-0042",
210
+ "name": "user42",
211
+ "tier": "team"
212
+ },
213
+ {
214
+ "id": "u-0043",
215
+ "name": "user43",
216
+ "tier": "free"
217
+ },
218
+ {
219
+ "id": "u-0044",
220
+ "name": "user44",
221
+ "tier": "pro"
222
+ },
223
+ {
224
+ "id": "u-0045",
225
+ "name": "user45",
226
+ "tier": "team"
227
+ },
228
+ {
229
+ "id": "u-0046",
230
+ "name": "user46",
231
+ "tier": "free"
232
+ },
233
+ {
234
+ "id": "u-0047",
235
+ "name": "user47",
236
+ "tier": "pro"
237
+ },
238
+ {
239
+ "id": "u-0048",
240
+ "name": "user48",
241
+ "tier": "team"
242
+ },
243
+ {
244
+ "id": "u-0049",
245
+ "name": "user49",
246
+ "tier": "free"
247
+ },
248
+ {
249
+ "id": "u-0050",
250
+ "name": "user50",
251
+ "tier": "pro"
252
+ },
253
+ {
254
+ "id": "u-0051",
255
+ "name": "user51",
256
+ "tier": "team"
257
+ },
258
+ {
259
+ "id": "u-0052",
260
+ "name": "user52",
261
+ "tier": "free"
262
+ },
263
+ {
264
+ "id": "u-0053",
265
+ "name": "user53",
266
+ "tier": "pro"
267
+ },
268
+ {
269
+ "id": "u-0054",
270
+ "name": "user54",
271
+ "tier": "team"
272
+ },
273
+ {
274
+ "id": "u-0055",
275
+ "name": "user55",
276
+ "tier": "free"
277
+ },
278
+ {
279
+ "id": "u-0056",
280
+ "name": "user56",
281
+ "tier": "pro"
282
+ },
283
+ {
284
+ "id": "u-0057",
285
+ "name": "user57",
286
+ "tier": "team"
287
+ },
288
+ {
289
+ "id": "u-0058",
290
+ "name": "user58",
291
+ "tier": "free"
292
+ },
293
+ {
294
+ "id": "u-0059",
295
+ "name": "user59",
296
+ "tier": "pro"
297
+ },
298
+ {
299
+ "id": "u-0060",
300
+ "name": "user60",
301
+ "tier": "team"
302
+ }
303
+ ]
304
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "scored": [
3
+ {
4
+ "id": "u-0009",
5
+ "score": 33
6
+ },
7
+ {
8
+ "id": "u-0024",
9
+ "score": 57
10
+ },
11
+ {
12
+ "id": "u-0041",
13
+ "score": 91
14
+ },
15
+ {
16
+ "id": "u-0058",
17
+ "score": 12
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,80 @@
1
+ // eval/tasks/gen-fixtures.cjs —— 任务集固定 fixtures(逐字节确定性;评测两臂共用同一份)
2
+ // 用法:node eval/tasks/gen-fixtures.cjs (幂等;产物写入本目录 fixtures/)
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const out = path.join(__dirname, 'fixtures');
6
+ fs.mkdirSync(out, { recursive: true });
7
+
8
+ const lines = [];
9
+
10
+ // big-report.md:300 行确定性报告;L137 是探针行(R1 考察 tf-peek 精确取回)
11
+ lines.length = 0;
12
+ lines.push('# Quarterly Platform Report (fixture)');
13
+ lines.push('');
14
+ const w = ['alpha', 'bravo', 'charlie', 'delta', 'echo', 'foxtrot', 'golf', 'hotel', 'india', 'juliet'];
15
+ for (let i = 1; i <= 296; i++) {
16
+ if (i === 135) { // 文件行号 = i+2(前两行是标题+空行)→ 探针行落在文件 L137
17
+ lines.push('L137-quirk-quokka: the secret calibration constant is 424242');
18
+ continue;
19
+ }
20
+ const section = i % 40 === 1 ? `## Section ${Math.floor(i / 40) + 1}` : `entry ${i}: ${w[i % 10]}-${(i * 37) % 997} status=ok`;
21
+ lines.push(section);
22
+ }
23
+ fs.writeFileSync(path.join(out, 'big-report.md'), lines.join('\n') + '\n', 'utf8');
24
+
25
+ // error.log:200 行;唯一 ERROR 在 L173(R3 考察骨架关键行定位)
26
+ lines.length = 0;
27
+ for (let i = 1; i <= 200; i++) {
28
+ if (i === 173) lines.push(`2026-01-01T10:${String(i).padStart(2, '0')}:00Z ERROR disk-quota-exceeded volume=D trace-id=tr-9f87`);
29
+ else lines.push(`2026-01-01T10:${String(i).padStart(2, '0')}:00Z INFO worker heartbeat seq=${i} ok`);
30
+ }
31
+ fs.writeFileSync(path.join(out, 'error.log'), lines.join('\n') + '\n', 'utf8');
32
+
33
+ // config 三件套(R2 跨文件改配置:revision 7 → 9)
34
+ for (const name of ['settings', 'features', 'deploy']) {
35
+ const body = [
36
+ `# ${name}.yaml (fixture)`,
37
+ 'service: platform',
38
+ 'revision: 7',
39
+ name === 'settings' ? 'locale: zh-CN' : name === 'features' ? 'flags: [a, b]' : 'replicas: 2',
40
+ '',
41
+ ].join('\n');
42
+ fs.writeFileSync(path.join(out, `${name}.yaml`), body, 'utf8');
43
+ }
44
+
45
+ // R4 双 JSON 找共同记录:共同 id 有 4 个(u-0009/0024/0041/0058),其中 tier=pro 的唯一 = u-0041(score 91)
46
+ const usersA = Array.from({ length: 60 }, (_, i) => ({ id: `u-${String(i + 1).padStart(4, '0')}`, name: `user${i + 1}`, tier: ['free', 'pro', 'team'][i % 3] }));
47
+ const usersB = [
48
+ { id: 'u-0009', score: 33 },
49
+ { id: 'u-0024', score: 57 },
50
+ { id: 'u-0041', score: 91 },
51
+ { id: 'u-0058', score: 12 },
52
+ ];
53
+ fs.writeFileSync(path.join(out, 'users-roster.json'), JSON.stringify({ users: usersA }, null, 2), 'utf8');
54
+ fs.writeFileSync(path.join(out, 'users-scores.json'), JSON.stringify({ scored: usersB }, null, 2), 'utf8');
55
+
56
+ // C1 销售数据:60 行,sum(amount) 确定性 = 60 * (100+i) = 4830?行 i+1: amount=100+i → sum=Σ(100..159)=7770
57
+ lines.length = 0;
58
+ lines.push('region,amount');
59
+ for (let i = 0; i < 60; i++) lines.push(`zone-${i % 5},${100 + i}`);
60
+ fs.writeFileSync(path.join(out, 'sales-q1.csv'), lines.join('\n') + '\n', 'utf8');
61
+
62
+ // C2 指针配置:指向缺失文件(考察失败改道)
63
+ fs.writeFileSync(path.join(out, 'pipeline.yaml'), [
64
+ '# pipeline.yaml (fixture)',
65
+ 'source: data/missing-source.json',
66
+ 'fallback: none',
67
+ 'output: out/result.json',
68
+ '',
69
+ ].join('\n'), 'utf8');
70
+
71
+ // C3 清单(读清单 → 逐项写文件 → 报告)
72
+ fs.writeFileSync(path.join(out, 'build-manifest.txt'), [
73
+ '# build-manifest.txt (fixture)',
74
+ 'docs/intro.md = Stream agent intro, three paragraphs, plain markdown.',
75
+ 'docs/design.md = Single-stream protocol design notes, mention tf-write and tf-peek.',
76
+ 'docs/eval.md = Evaluation plan summary, mention METRICS and baseline.',
77
+ 'docs/roadmap.md = Roadmap: M0 through M10 one line each.',
78
+ ].join('\n'), 'utf8');
79
+
80
+ console.log('fixtures written to', out);
@@ -0,0 +1,150 @@
1
+ {
2
+ "$schema": "eval-task-set-v1",
3
+ "note": "分派 08 交付 2:任务集(10 个;写入批 3 / 读改查 4 / 复合 3)。任务文本写死在本文件,基线与对照逐字节同一任务。seed.fixtures 相对 eval/tasks/fixtures/;seed.path 是任务工作区内的目标路径。checks: exists / contains(path,text) / final-contains(text, 对最终 assistant 消息全文)。",
4
+ "metricsDoc": "eval/METRICS.md",
5
+ "tasks": [
6
+ {
7
+ "id": "W1",
8
+ "type": "write-batch",
9
+ "title": "写 3 个文件",
10
+ "seed": [],
11
+ "prompt": "请在当前目录写三个文件:intro.md(3 行,主题:本项目的目标)、plan.md(3 行,主题:实施计划)、notes.md(2 行,主题:注意事项)。每个文件第一行以 '# ' 开头标题。",
12
+ "checks": [
13
+ { "kind": "exists", "path": "intro.md" },
14
+ { "kind": "exists", "path": "plan.md" },
15
+ { "kind": "exists", "path": "notes.md" },
16
+ { "kind": "contains", "path": "intro.md", "text": "#" }
17
+ ],
18
+ "budgetTokens": 40000
19
+ },
20
+ {
21
+ "id": "W2",
22
+ "type": "write-batch",
23
+ "title": "写 5 个章节文件 + index",
24
+ "seed": [],
25
+ "prompt": "请写 5 个章节文件 chapters/ch01.md 到 chapters/ch05.md,每个文件 3 行,第一行是 '# 第N章'。然后写 index.md,列出 5 个章节的文件名和标题。",
26
+ "checks": [
27
+ { "kind": "exists", "path": "chapters/ch01.md" },
28
+ { "kind": "exists", "path": "chapters/ch02.md" },
29
+ { "kind": "exists", "path": "chapters/ch03.md" },
30
+ { "kind": "exists", "path": "chapters/ch04.md" },
31
+ { "kind": "exists", "path": "chapters/ch05.md" },
32
+ { "kind": "exists", "path": "index.md" },
33
+ { "kind": "contains", "path": "index.md", "text": "ch03" }
34
+ ],
35
+ "budgetTokens": 60000
36
+ },
37
+ {
38
+ "id": "W3",
39
+ "type": "write-batch",
40
+ "title": "写 8 个模块文件 + 汇总",
41
+ "seed": [],
42
+ "prompt": "请写 8 个文件 modules/m1.txt 到 modules/m8.txt,第 N 个文件内容为 'module N: ok'。然后写 modules/summary.txt,按顺序列出全部 8 个文件名,一行一个。",
43
+ "checks": [
44
+ { "kind": "exists", "path": "modules/m1.txt" },
45
+ { "kind": "exists", "path": "modules/m8.txt" },
46
+ { "kind": "contains", "path": "modules/m8.txt", "text": "module 8: ok" },
47
+ { "kind": "exists", "path": "modules/summary.txt" }
48
+ ],
49
+ "budgetTokens": 80000
50
+ },
51
+ {
52
+ "id": "R1",
53
+ "type": "read-peek",
54
+ "title": "读大文件答指定行细节",
55
+ "seed": [{ "fixture": "big-report.md", "path": "data/big-report.md" }],
56
+ "prompt": "请读取 data/big-report.md,回答两个问题并直接给出答案:1) 第 137 行的完整原文;2) 该文件总行数。不要省略第 137 行的内容。",
57
+ "checks": [
58
+ { "kind": "final-contains", "text": "424242" },
59
+ { "kind": "final-contains", "text": "L137-quirk-quokka" }
60
+ ],
61
+ "budgetTokens": 40000
62
+ },
63
+ {
64
+ "id": "R2",
65
+ "type": "read-edit",
66
+ "title": "跨文件改配置",
67
+ "seed": [
68
+ { "fixture": "settings.yaml", "path": "config/settings.yaml" },
69
+ { "fixture": "features.yaml", "path": "config/features.yaml" },
70
+ { "fixture": "deploy.yaml", "path": "config/deploy.yaml" }
71
+ ],
72
+ "prompt": "config/ 下有三个 yaml 配置文件,每个都有 revision 字段(当前是 7)。请把三个文件的 revision 全部改为 9,其他内容保持不变。",
73
+ "checks": [
74
+ { "kind": "contains", "path": "config/settings.yaml", "text": "revision: 9" },
75
+ { "kind": "contains", "path": "config/features.yaml", "text": "revision: 9" },
76
+ { "kind": "contains", "path": "config/deploy.yaml", "text": "revision: 9" }
77
+ ],
78
+ "budgetTokens": 40000
79
+ },
80
+ {
81
+ "id": "R3",
82
+ "type": "read-peek",
83
+ "title": "日志找错",
84
+ "seed": [{ "fixture": "error.log", "path": "logs/error.log" }],
85
+ "prompt": "请读取 logs/error.log,找出其中唯一的 ERROR 行,并给出:1) 完整的原始行内容;2) 该行的 trace-id。请直接给出答案。",
86
+ "checks": [
87
+ { "kind": "final-contains", "text": "tr-9f87" },
88
+ { "kind": "final-contains", "text": "disk-quota-exceeded" }
89
+ ],
90
+ "budgetTokens": 40000
91
+ },
92
+ {
93
+ "id": "R4",
94
+ "type": "read-join",
95
+ "title": "双 JSON 求共同记录",
96
+ "seed": [
97
+ { "fixture": "users-roster.json", "path": "data/users-roster.json" },
98
+ { "fixture": "users-scores.json", "path": "data/users-scores.json" }
99
+ ],
100
+ "prompt": "data/users-roster.json 是名册(users 数组,含 id/name/tier),data/users-scores.json 是成绩表(scored 数组,含 id/score)。请找出两个文件中同时出现的全部 user id(按 id 匹配),并指出其中 tier 为 pro 的那一个,给出它的 id 和 score。",
101
+ "checks": [
102
+ { "kind": "final-contains", "text": "u-0041" },
103
+ { "kind": "final-contains", "text": "91" }
104
+ ],
105
+ "budgetTokens": 50000
106
+ },
107
+ {
108
+ "id": "C1",
109
+ "type": "composite",
110
+ "title": "读→算→写→汇报",
111
+ "seed": [{ "fixture": "sales-q1.csv", "path": "data/sales-q1.csv" }],
112
+ "prompt": "请读取 data/sales-q1.csv(含表头 region,amount),计算 amount 列的总和。然后创建 out/summary.md,内容包含:总和数值和记录条数。最后在回复中直接给出总和数字。",
113
+ "checks": [
114
+ { "kind": "exists", "path": "out/summary.md" },
115
+ { "kind": "contains", "path": "out/summary.md", "text": "7770" },
116
+ { "kind": "final-contains", "text": "7770" }
117
+ ],
118
+ "budgetTokens": 50000
119
+ },
120
+ {
121
+ "id": "C2",
122
+ "type": "composite",
123
+ "title": "失败改道",
124
+ "seed": [{ "fixture": "pipeline.yaml", "path": "pipeline.yaml" }],
125
+ "prompt": "pipeline.yaml 声明了一个数据管道:source 指向 data/missing-source.json。请尝试按声明执行:读取 source 文件并把内容写入 output 指定的 out/result.json。如果 source 不存在,则改用兜底方案:向 out/result.json 写入 {\"status\":\"fallback\",\"reason\":\"source missing\"},并在回复中说明 source 缺失。",
126
+ "checks": [
127
+ { "kind": "exists", "path": "out/result.json" },
128
+ { "kind": "contains", "path": "out/result.json", "text": "fallback" },
129
+ { "kind": "final-contains", "text": "missing" }
130
+ ],
131
+ "budgetTokens": 50000
132
+ },
133
+ {
134
+ "id": "C3",
135
+ "type": "composite",
136
+ "title": "按清单批量产出",
137
+ "seed": [{ "fixture": "build-manifest.txt", "path": "build-manifest.txt" }],
138
+ "prompt": "请读取 build-manifest.txt,按其中 4 条 '路径 = 说明' 规格分别创建对应文件(docs/intro.md、docs/design.md、docs/eval.md、docs/roadmap.md),内容按各自说明撰写(至少 2 行)。完成后写 docs/report.md,逐个列出 4 个文件及其完成状态。",
139
+ "checks": [
140
+ { "kind": "exists", "path": "docs/intro.md" },
141
+ { "kind": "exists", "path": "docs/design.md" },
142
+ { "kind": "exists", "path": "docs/eval.md" },
143
+ { "kind": "exists", "path": "docs/roadmap.md" },
144
+ { "kind": "contains", "path": "docs/design.md", "text": "tf-peek" },
145
+ { "kind": "exists", "path": "docs/report.md" }
146
+ ],
147
+ "budgetTokens": 80000
148
+ }
149
+ ]
150
+ }