@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,464 @@
1
+ /**
2
+ * kernel/gate.ts —— 两段式动作准入(spec / commit / fatal / read)+ 一次性凭据。
3
+ *
4
+ * 内核层纪律(README §8 红线 2):
5
+ * - 零框架依赖:不 import 任何 @deepseek-ai/*,只允许 node:crypto(sha256,与 state.ts 寻址口径一致);
6
+ * - 无真实 IO:工作区写操作由调用方注入的 StagingSink 承接(只写暂存区),内核不做 fs/网络;
7
+ * - 装配期失败 vs 运行时拒绝:缺 reversibility 声明在 registry.freeze() 抛错(启动期失败),
8
+ * 策略性拒绝一律返回结构化结果,绝不静默。
9
+ *
10
+ * 两段式模型(04 号任务书目标 A):
11
+ * spec 级:写暂存区 + 产 diff,不触碰真实工作区;产出一次性凭据(绑定目标内容 hash);
12
+ * commit 级:必须携带有效凭据才放行(already_used / expired / hash_mismatch / unknown 结构化拒绝);
13
+ * fatal 级:无人工批准通道时直接拒绝;
14
+ * read 级:直接放行。
15
+ */
16
+
17
+ import { createHash } from 'node:crypto';
18
+
19
+ // ---------------------------------------------------------------------------
20
+ // 基础类型
21
+ // ---------------------------------------------------------------------------
22
+
23
+
24
+
25
+
26
+
27
+                    
28
+
29
+
30
+
31
+
32
+ /** 一次性凭据:绑定 spec 内容 hash,超时或二次使用即作废。 */
33
+
34
+
35
+                
36
+
37
+
38
+
39
+              
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+ /** 凭据校验失败必须返回结构化原因,不允许只给 "denied"。 */
50
+
51
+
52
+
53
+
54
+
55
+ // ---------------------------------------------------------------------------
56
+ // 注入接口(内核不做真实 IO 的唯一出口)
57
+ // ---------------------------------------------------------------------------
58
+
59
+
60
+
61
+          
62
+
63
+
64
+
65
+ /**
66
+ * 暂存槽。契约:writeStaged 只写暂存区,绝不触碰真实工作区。
67
+ * 内核在 speculate 前后各探测一次 workspaceHash,探测到变化直接抛 StagingLeakError(fail-closed)。
68
+ */
69
+
70
+               
71
+
72
+                 
73
+
74
+                                
75
+
76
+
77
+
78
+ /** fatal 级动作的人工批准通道(可缺省:缺省时 fatal 一律拒绝)。 */
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+ /** 可注入时钟:过期判定不做真实 Date.now 依赖,测试可冻结/拨快。 */
88
+
89
+
90
+
91
+
92
+ export class SystemClock {
93
+ now() {
94
+ return Date.now();
95
+ }
96
+ }
97
+
98
+ // ---------------------------------------------------------------------------
99
+ // 错误类型(装配期 / 编程错误 → 抛错;策略拒绝 → 结构化返回)
100
+ // ---------------------------------------------------------------------------
101
+
102
+ /** 缺 reversibility 声明:freeze() 时抛(启动期失败,非运行时拒绝)。 */
103
+ export class MissingReversibilityError extends Error {
104
+ actions ;
105
+ constructor(actions ) {
106
+ super(
107
+ `registry.freeze() 失败:以下 action 缺 reversibility 声明:${actions.join(', ')}`,
108
+ );
109
+ this.name = 'MissingReversibilityError';
110
+ this.actions = actions;
111
+ }
112
+ }
113
+
114
+ export class UnknownActionError extends Error {
115
+ constructor(name ) {
116
+ super(`未注册的 action:${name}`);
117
+ this.name = 'UnknownActionError';
118
+ }
119
+ }
120
+
121
+ export class RegistryFrozenError extends Error {
122
+ constructor() {
123
+ super('registry 已冻结,禁止再 declare()');
124
+ this.name = 'RegistryFrozenError';
125
+ }
126
+ }
127
+
128
+ export class RegistryNotFrozenError extends Error {
129
+ constructor() {
130
+ super('registry 尚未 freeze(),禁止使用(装配期失败要趁早暴露)');
131
+ this.name = 'RegistryNotFrozenError';
132
+ }
133
+ }
134
+
135
+ /** speculate() 用在非 spec 级 action 上:编程错误,抛错。 */
136
+ export class NotSpecActionError extends Error {
137
+ constructor(name , reversibility ) {
138
+ super(
139
+ `action "${name}" 的 reversibility 是 ${reversibility},只有 spec 级动作能走 speculate()`,
140
+ );
141
+ this.name = 'NotSpecActionError';
142
+ }
143
+ }
144
+
145
+ /** speculate 后探测到真实工作区变化:StagingSink 违反"只写暂存区"契约,fail-closed。 */
146
+ export class StagingLeakError extends Error {
147
+ path ;
148
+ constructor(path ) {
149
+ super(
150
+ `StagingSink 契约破坏:speculate 写暂存区后探测到工作区 "${path}" 内容变化(暂存泄漏进真实工作区)`,
151
+ );
152
+ this.name = 'StagingLeakError';
153
+ this.path = path;
154
+ }
155
+ }
156
+
157
+ // ---------------------------------------------------------------------------
158
+ // 决策类型
159
+ // ---------------------------------------------------------------------------
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+ // ---------------------------------------------------------------------------
203
+ // ActionRegistry
204
+ // ---------------------------------------------------------------------------
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ export class ActionRegistry {
213
+ #decls = new Map ();
214
+ #frozen = false;
215
+
216
+ /** 注册动作声明。冻结后调用抛 RegistryFrozenError;重名抛错。 */
217
+ declare(decl ) {
218
+ if (this.#frozen) throw new RegistryFrozenError();
219
+ if (this.#decls.has(decl.name)) {
220
+ throw new Error(`action 重复注册:${decl.name}`);
221
+ }
222
+ this.#decls.set(decl.name, {
223
+ name: decl.name,
224
+ reversibility: decl.reversibility,
225
+ description: decl.description,
226
+ });
227
+ return this;
228
+ }
229
+
230
+ /** 装配期冻结点:任何一个 action 缺 reversibility 声明都在此抛错(启动期失败)。 */
231
+ freeze() {
232
+ const missing = [];
233
+ for (const d of this.#decls.values()) {
234
+ if (!d.reversibility) missing.push(d.name);
235
+ }
236
+ if (missing.length > 0) throw new MissingReversibilityError(missing);
237
+ this.#frozen = true;
238
+ }
239
+
240
+ get frozen() {
241
+ return this.#frozen;
242
+ }
243
+
244
+ reversibilityOf(name ) {
245
+ if (!this.#frozen) throw new RegistryNotFrozenError();
246
+ const d = this.#decls.get(name);
247
+ if (!d) throw new UnknownActionError(name);
248
+ return d.reversibility ;
249
+ }
250
+ }
251
+
252
+ // ---------------------------------------------------------------------------
253
+ // ActionGate
254
+ // ---------------------------------------------------------------------------
255
+
256
+
257
+
258
+
259
+                          
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+             
268
+
269
+                   
270
+
271
+
272
+
273
+ function sha256(text ) {
274
+ return createHash('sha256').update(text, 'utf8').digest('hex');
275
+ }
276
+
277
+ /** spec 内容 hash:对暂存写入 receipts 做确定性序列化后 sha256(口径与 state.ts 一致)。 */
278
+ function computeSpecHash(receipts ) {
279
+ const canonical = JSON.stringify(
280
+ receipts
281
+ .map((r) => ({ path: r.path, hash: r.hash }))
282
+ .sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0)),
283
+ );
284
+ return sha256(canonical);
285
+ }
286
+
287
+ export class ActionGate {
288
+ #registry ;
289
+ #staging ;
290
+ #clock ;
291
+ #ttl ;
292
+ #approval ;
293
+ #credentials = new Map ();
294
+ #seq = 0;
295
+
296
+ constructor(opts ) {
297
+ this.#registry = opts.registry;
298
+ this.#staging = opts.staging;
299
+ this.#clock = opts.clock ?? new SystemClock();
300
+ this.#ttl = opts.credentialTtlMs ?? 300_000;
301
+ this.#approval = opts.approval;
302
+ }
303
+
304
+ #assertUsable(action ) {
305
+ return this.#registry.reversibilityOf(action); // 未冻结 / 未注册 → 抛错(装配期失败)
306
+ }
307
+
308
+ /**
309
+ * spec 级动作:写暂存区 + 产 diff + 发一次性凭据;对真实工作区零副作用。
310
+ * - 非冻结/未注册 → 抛错;非 spec 级 → 抛 NotSpecActionError(编程错误);
311
+ * - 写暂存区前后各探测一次工作区,探测到变化抛 StagingLeakError(不发凭据)。
312
+ */
313
+ speculate(req ) {
314
+ const rev = this.#assertUsable(req.action);
315
+ if (rev !== 'spec') throw new NotSpecActionError(req.action, rev);
316
+ if (!req.writes || req.writes.length === 0) {
317
+ return {
318
+ verdict: 'deny',
319
+ reason: 'empty-spec',
320
+ detail: `spec 请求 "${req.action}"(taskId=${req.taskId})没有任何写入目标`,
321
+ };
322
+ }
323
+
324
+ // 1. 先采样目标工作区 hash(在写暂存区之前,若暂存泄漏也逃不过前后对比)
325
+ const expectedWorkspace = req.writes.map((w) => ({
326
+ path: w.path,
327
+ hash: this.#staging.workspaceHash(w.path),
328
+ }));
329
+
330
+ // 2. 写暂存区(内核不做真实 IO,全部经注入的 StagingSink)
331
+ const receipts = req.writes.map((w) =>
332
+ this.#staging.writeStaged(w.path, w.content),
333
+ );
334
+
335
+ // 3. 复核:暂存写入不得触碰真实工作区(fail-closed)
336
+ for (const e of expectedWorkspace) {
337
+ if (this.#staging.workspaceHash(e.path) !== e.hash) {
338
+ throw new StagingLeakError(e.path);
339
+ }
340
+ }
341
+
342
+ const specHash = computeSpecHash(receipts);
343
+ const credential = {
344
+ id: `${req.taskId}#spec#${++this.#seq}`,
345
+ specHash,
346
+ taskId: req.taskId,
347
+ expiresAt: this.#clock.now() + this.#ttl,
348
+ used: false,
349
+ };
350
+ this.#credentials.set(credential.id, {
351
+ credential,
352
+ action: req.action,
353
+ expectedWorkspace,
354
+ });
355
+
356
+ return {
357
+ verdict: 'allow',
358
+ diff: this.#staging.diffStaged(),
359
+ specHash,
360
+ credential,
361
+ };
362
+ }
363
+
364
+ /**
365
+ * commit 级动作:必须携带有效一次性凭据。
366
+ * 校验顺序(确定性):unknown → already_used → expired → hash_mismatch。
367
+ * 任一失败返回结构化原因;凭据不被消费(hash_mismatch 不烧凭据,但凭据已被用过则 already_used 优先)。
368
+ */
369
+ commit(req ) {
370
+ this.#assertUsable(req.action);
371
+ const rec = this.#credentials.get(req.credential.id);
372
+ if (!rec) {
373
+ return {
374
+ verdict: 'deny',
375
+ rejection: {
376
+ reason: 'unknown',
377
+ detail: `凭据 ${req.credential.id} 不存在(从未签发或 id 传错)`,
378
+ },
379
+ };
380
+ }
381
+ if (rec.credential.used) {
382
+ return {
383
+ verdict: 'deny',
384
+ rejection: {
385
+ reason: 'already_used',
386
+ detail: `凭据 ${rec.credential.id} 是一次性的,已在之前的 commit 中消费`,
387
+ },
388
+ };
389
+ }
390
+ const now = this.#clock.now();
391
+ if (now > rec.credential.expiresAt) {
392
+ return {
393
+ verdict: 'deny',
394
+ rejection: {
395
+ reason: 'expired',
396
+ detail: `凭据 ${rec.credential.id} 已于 ${rec.credential.expiresAt} 过期(当前 ${now})`,
397
+ },
398
+ };
399
+ }
400
+ // spec 之后目标内容变化 → 凭据作废(hash_mismatch)
401
+ for (const e of rec.expectedWorkspace) {
402
+ const current = this.#staging.workspaceHash(e.path);
403
+ if (current !== e.hash) {
404
+ return {
405
+ verdict: 'deny',
406
+ rejection: {
407
+ reason: 'hash_mismatch',
408
+ detail: `凭据 ${rec.credential.id} 绑定的目标 "${e.path}" 内容在 spec 之后发生了变化(期望 ${e.hash.slice(0, 8)}…,实际 ${current.slice(0, 8)}…)`,
409
+ },
410
+ };
411
+ }
412
+ }
413
+ rec.credential.used = true; // 一次性消费
414
+ return {
415
+ verdict: 'allow',
416
+ credentialId: rec.credential.id,
417
+ action: req.action,
418
+ };
419
+ }
420
+
421
+ /**
422
+ * 一次性准入判定(read / fatal / 未携带凭据的 commit、spec)。
423
+ * - read:直接放行;
424
+ * - fatal:无批准通道 → 拒绝(理由可读);有通道 → 交给通道裁决;
425
+ * - commit:准入不走这里——必须先 speculate() 拿凭据再走 commit();
426
+ * - spec:准入同样走 speculate()。
427
+ */
428
+ async admit(req ) {
429
+ const rev = this.#assertUsable(req.action);
430
+ if (rev === 'read') {
431
+ return { verdict: 'allow', reversibility: 'read' };
432
+ }
433
+ if (rev === 'fatal') {
434
+ if (!this.#approval) {
435
+ return {
436
+ verdict: 'deny',
437
+ reason: 'fatal-no-approval-channel',
438
+ detail: `action "${req.action}" 是 fatal 级(不可逆),当前装配没有人工批准通道,直接拒绝`,
439
+ };
440
+ }
441
+ const ok = await this.#approval.requestApproval({
442
+ action: req.action,
443
+ taskId: req.taskId,
444
+ detail: req.detail ?? '',
445
+ });
446
+ if (!ok) {
447
+ return {
448
+ verdict: 'deny',
449
+ reason: 'fatal-approval-denied',
450
+ detail: `action "${req.action}" 的人工批准被拒绝`,
451
+ };
452
+ }
453
+ return { verdict: 'allow', reversibility: 'fatal' };
454
+ }
455
+ return {
456
+ verdict: 'deny',
457
+ reason: rev === 'commit' ? 'commit-requires-credential' : 'spec-via-speculate',
458
+ detail:
459
+ rev === 'commit'
460
+ ? `action "${req.action}" 是 commit 级:先由 spec 级动作产出一次性凭据,再走 gate.commit() 放行,不允许直接准入`
461
+ : `action "${req.action}" 是 spec 级:走 gate.speculate() 写暂存区并领取一次性凭据,不允许直接准入`,
462
+ };
463
+ }
464
+ }