dsh-flakefinder 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  [返回简介](README.md) · [使用说明](docs/USAGE.md) · [验证记录](docs/VALIDATION.md)
4
4
 
5
+ ## 0.4.5 (2026-10-29)
6
+
7
+ - 同步仓库与 npm 的简明介绍、中英文 README 和反馈入口;本次为文档与包元数据更新。
8
+ - Sync npm descriptions and both README guides with the repository, including issue and pull-request links.
9
+
10
+ ## 0.4.4 (2026-10-28)
11
+
12
+ - 隔离清单写操作正确处理 never/未知审批策略,不再误报用户点击拒绝;保留宿主拒绝与原有可询问模式,不自动放宽审批。
13
+
5
14
  ## 0.4.3 (2026-10-27)
6
15
 
7
16
  - 修复分批更新时的新旧更新控件混用:保留原页面、草稿与安装保护,空闲后接管旧控制器,兼容旧入口。
package/README.en.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ![dsh-flakefinder whale girl plugin cover](https://raw.githubusercontent.com/STARDUSTLC666/dsh-flakefinder/master/assets/cover-whale-girl.png)
6
6
 
7
- Repeat test runs to identify intermittent failures and keep investigation history.
7
+ Repeat test runs and retain individual results to investigate intermittent failures. Keeps workspace-scoped investigation and quarantine records, with configurable confirmation and clear permission messages for writes.
8
8
 
9
9
  [![npm](https://img.shields.io/npm/v/dsh-flakefinder)](https://www.npmjs.com/package/dsh-flakefinder) [![downloads](https://raw.githubusercontent.com/STARDUSTLC666/dsh-suite/npm-downloads/assets/dsh-flakefinder-downloads.svg)](https://www.npmjs.com/package/dsh-flakefinder)
10
10
 
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ![dsh-flakefinder 鲸鱼娘插件封面](https://raw.githubusercontent.com/STARDUSTLC666/dsh-flakefinder/master/assets/cover-whale-girl.png)
6
6
 
7
- 重复运行测试,找出偶发失败用例并保留调查记录。
7
+ 重复运行测试并保留每次结果,定位偶发失败用例。支持工作区内的调查记录、隔离列表与清除操作;写操作按配置确认,并明确提示当前权限限制。
8
8
 
9
9
  [![npm](https://img.shields.io/npm/v/dsh-flakefinder)](https://www.npmjs.com/package/dsh-flakefinder) [![downloads](https://raw.githubusercontent.com/STARDUSTLC666/dsh-suite/npm-downloads/assets/dsh-flakefinder-downloads.svg)](https://www.npmjs.com/package/dsh-flakefinder)
10
10
 
package/docs/USAGE.en.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # dsh-flakefinder usage guide
2
2
 
3
+ ## Confirmation in Full Access
4
+
5
+ The plugin keeps its confirmation requirement. With approval policy `never`, it reports that confirmation is unavailable and performs no write. Switch to a mode that can ask, or explicitly set `writeApproval: false` yourself. Host denials still apply.
6
+
3
7
  [Overview](../README.en.md) · [Changelog](../CHANGELOG.md) · [Validation](VALIDATION.md)
4
8
 
5
9
  ## Current improvements
package/docs/USAGE.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # dsh-flakefinder 使用说明
2
2
 
3
+ ## 完全权限下的确认
4
+
5
+ 插件保留单独确认要求。会话审批策略为 `never` 时不能弹框,会明确说明操作未执行;请切到可询问模式,或由用户明确设置 `writeApproval: false`。其它宿主拒绝仍生效,不自动放宽权限。
6
+
3
7
  [返回简介](../README.md) · [更新记录](../CHANGELOG.md) · [验证记录](VALIDATION.md)
4
8
 
5
9
  ## 本次改进
@@ -1,5 +1,9 @@
1
1
  # dsh-flakefinder 验证记录
2
2
 
3
+ ## 2026-10-28:0.4.4
4
+
5
+ [本次修复与验收边界](validation-0.4.4.md)。
6
+
3
7
  本页整理原 README 的历史验证说明,保留当时的版本、日期与范围。自动测试、启动检查、浏览器操作和真实服务验收分别记录,不能相互替代。更详细的版本验收文件仍保留在仓库中。
4
8
 
5
9
  ## 原中文记录
@@ -0,0 +1,5 @@
1
+ # 0.4.4 验证记录(2026-10-28)
2
+
3
+ Windows 49 项回归通过、0 跳过。官方 DSH 0.2.1-rc.4 真实 agent 回合调用 flaky_quarantine:never 策略返回明确配置提示,不声称用户点击了拒绝。
4
+
5
+ 隔离和清除的可询问/未知策略、显式关闭审批、只读工具和宿主拒绝均覆盖回归。原生插件详情及默认关闭自动安装已验收,未操作用户桌面窗口。
@@ -0,0 +1,13 @@
1
+ /** Read the effective Host policy without importing a second copy of its services. */
2
+ export type ApprovalPolicy = 'ask' | 'never' | 'unknown';
3
+ export interface ApprovalContext {
4
+ get?(name: string): unknown;
5
+ approval?: {
6
+ config?: {
7
+ policy?: unknown;
8
+ };
9
+ overrideOf?(session: unknown): unknown;
10
+ };
11
+ }
12
+ export declare function approvalPolicy(ctx: ApprovalContext, execution: unknown): ApprovalPolicy;
13
+ export declare function approvalProblem(policy: ApprovalPolicy, setting: string): string | undefined;
@@ -0,0 +1,18 @@
1
+ export function approvalPolicy(ctx, execution) {
2
+ try {
3
+ const service = (ctx.get ? ctx.get('approval') : ctx.approval);
4
+ const session = execution?.agent?.session;
5
+ const policy = (session === undefined ? undefined : service?.overrideOf?.(session)) ?? service?.config?.policy;
6
+ return policy === 'ask' || policy === 'never' ? policy : 'unknown';
7
+ }
8
+ catch {
9
+ return 'unknown';
10
+ }
11
+ }
12
+ export function approvalProblem(policy, setting) {
13
+ if (policy === 'ask')
14
+ return undefined;
15
+ if (policy === 'never')
16
+ return '插件要求确认,但当前会话审批策略 never 不允许询问,操作未执行。请切换到可询问模式,或由用户明确设置 ' + setting + '=false / Confirmation is required but this session cannot ask; no action was performed.';
17
+ return '无法读取宿主审批策略,操作未执行。请检查 DSH 审批服务或插件配置 / Host approval policy unavailable; no action was performed.';
18
+ }
package/lib/index.d.ts CHANGED
@@ -10,11 +10,12 @@
10
10
  import { type FlakeConfig } from './config.js';
11
11
  import { type SubprocessSpawnLike } from './runner.js';
12
12
  import { type FlakeToolDefinition } from './tools.js';
13
+ import { type ApprovalContext } from './approval.js';
13
14
  /** cordis 服务注入:apply 里要用 ctx.subprocess 与 ctx.tools。 */
14
15
  export declare const name = "flakefinder";
15
16
  export declare const inject: string[];
16
17
  /** 插件所需的最小 ctx 面。 */
17
- export interface FlakePluginContext {
18
+ export interface FlakePluginContext extends ApprovalContext {
18
19
  subprocess: {
19
20
  spawn: SubprocessSpawnLike;
20
21
  };
package/lib/index.js CHANGED
@@ -12,6 +12,7 @@ import { resolveConfig } from './config.js';
12
12
  import { createSubprocessRunner } from './runner.js';
13
13
  import { createStore } from './store.js';
14
14
  import { buildFlakeTools } from './tools.js';
15
+ import { approvalPolicy, approvalProblem } from './approval.js';
15
16
  /** cordis 服务注入:apply 里要用 ctx.subprocess 与 ctx.tools。 */
16
17
  export const name = 'flakefinder';
17
18
  export const inject = ['subprocess', 'tools'];
@@ -38,6 +39,14 @@ export function apply(ctx, config) {
38
39
  if (typeof ctx.on === 'function') {
39
40
  if (cfg.writeApproval) {
40
41
  ctx.on('tools/pre-execute', async (exec, next) => {
42
+ if (exec.name !== 'flaky_quarantine' && exec.name !== 'flaky_clear')
43
+ return next();
44
+ const downstream = await next();
45
+ if (downstream?.kind === 'deny')
46
+ return downstream;
47
+ const problem = approvalProblem(approvalPolicy(ctx, exec), 'writeApproval');
48
+ if (problem)
49
+ return { kind: 'deny', reason: problem };
41
50
  if (exec.name === 'flaky_quarantine')
42
51
  return { kind: 'ask', reason: '把测试用例写入 .flakefinder.json 隔离清单' };
43
52
  if (exec.name === 'flaky_clear')
@@ -437,7 +437,7 @@ function __stardustUpdatesClient(ctx, React, require, shared) {
437
437
  }
438
438
 
439
439
  /* STARDUSTLC_UPDATE_CLIENT_BODY_START */
440
- window.__ModuleLoader__.load(__stardustUpdatesWrap({id:"dsh-flakefinder",factory:require=>({apply(){}})},{"name":"dsh-flakefinder","version":"0.1.0","hasWorkbench":false,"packageVersion":"0.4.3","label":"不稳定测试排查","labelEn":"Flakefinder","suiteComponent":true}));
440
+ window.__ModuleLoader__.load(__stardustUpdatesWrap({id:"dsh-flakefinder",factory:require=>({apply(){}})},{"name":"dsh-flakefinder","version":"0.1.0","hasWorkbench":false,"packageVersion":"0.4.5","label":"不稳定测试排查","labelEn":"Flakefinder","suiteComponent":true}));
441
441
 
442
442
  /* STARDUSTLC_UPDATE_CLIENT_BODY_END */
443
443
  })();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-flakefinder",
3
- "version": "0.4.3",
4
- "description": "重复运行测试,找出偶发失败用例并保留调查记录。",
3
+ "version": "0.4.5",
4
+ "description": "DSH 偶发测试调查:重复运行、失败记录、工作区隔离列表与写操作确认。欢迎提交 issues 和 PR。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",