dsh-market/tests/web/fixtures/fixture-clash

1.4kStar83Fork35Issue2Watching

dsh-market 自身的端到端测试夹具:故意与 fixture-a 占用同一个加载器入口 ID,用来验证 install 工作流能否在挂载前拦截冲突。

机审证据安装命令仓库已核验dsh-plugin Topic许可证READMEAI 百科

此插件是大仓库 dsh-market/dsh-market 的子包,星数与活跃度统计的是整个仓库。

语言
TypeScript
License
MIT
分支
main
deepseek-harnessdsh-pluginmarketplace

安装

$ dsh plugin --profile web add github:dsh-market/dsh-market/tests/web/fixtures/fixture-clash

在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程

对话式安装

帮我安装 DeepSeek Harness 插件 dsh-market/dsh-market/tests/web/fixtures/fixture-clash:先查看仓库 https://github.com/dsh-market/dsh-market.git 确认安全性,然后执行安装命令并验证插件加载成功。

把这段指令粘贴给 DSH Web GUI 里的助手,由它代你完成安装与验证。

一句话定位

这是 dsh-market 仓库自带的 e2e 测试夹具,不是面向普通用户安装的插件。它故意与 fixture-a 声明同一个加载器入口 ID,用来在端到端测试里验证 install 流程是否会拦截冲突。

核心能力

  • cordis.patch.yml 中声明 id: dshm-fixture-a,与 fixture-a 抢占同一个加载器入口
  • 通过宿主注入 webServer,在 $DSH_HOME/e2e-dshm-e2e-fixture-clash.alive 写入时间戳标记文件
  • 在插件卸载时删除标记文件,用来证明生命周期 dispose 真的发生过
  • 作为 e2e 套件(tests/web/install.e2e.ts)的对抗输入,验证 install 接口会拒绝 ID 冲突

技术实现

  • 语言: JavaScript(ESM,type: module
  • 关键依赖: 仅使用 node:fsnode:path 内置模块
  • 架构模式: 通过 package.json#dsh.bundle.patchcordis.patch.yml 注入到 cordis 加载栈,模块本身以 apply(ctx) 形式挂到宿主
  • 入口文件: tests/web/fixtures/fixture-clash/index.js

适用场景

仅在 tests/web/install.e2e.ts 第 127 行的"refuses an install that would duplicate a loader entry id (#122)"用例里被使用,普通用户没有理由直接安装它;它存在的目的是制造一个 install 冲突样本来验证防护逻辑,而不是提供任何业务功能。

前置依赖与兼容性

依赖最低版本说明
DSH 宿主未声明注入 webServer 依赖宿主能力,无版本约束
Node未声明仅使用 node:fs / node:path,实际跑在测试用的 Node 运行时上
平台跨平台没有原生模块、没有系统调用,仅文件读写
原生模块全部来自 Node 内置

安装方式

dsh plugin --profile web add github:dsh-market/dsh-market/tests/web/fixtures/fixture-clash

配置项

本插件无需额外配置。

常见问题

Q: 这个插件是给普通用户装的吗?

A: 不是。它是 dsh-market 仓库 tests/web/fixtures/ 下的 e2e 夹具,只在 install.e2e.ts 之类的测试里被使用,不提供任何业务功能。

Q: 它和 fixture-a 是什么关系?

A: 二者故意把 id 字段都声明成 dshm-fixture-a,而 cordis 不允许同一个加载器入口下挂两个实体;只要 install 流程放行这个夹具,宿主下次启动就会拒绝整个 bundle 树。

Q: 把它装进真实 profile 会发生什么?

A: tests/web/install.e2e.ts:127 用例期望 install 返回非 200 状态码,且 installed 列表里不会出现 dshm-e2e-fixture-clash;已经装好的 fixture-a 必须保持 live,证明冲突被拦在了写入 profile 之前。

Q: 标记文件有什么用?

A: 它是 fixture 自证的存活探针:仅当 cordis 解析包、加载模块、跑完 apply()、并满足 webServer 注入时,文件才会出现;卸载时由 ctx.effect 的 dispose 回调负责删除,因此能区分"插件在岗"和"插件已死"。

Q: 文件会一直留在磁盘上吗?

A: 不会。$DSH_HOME/e2e-dshm-e2e-fixture-clash.alive 由 effect 回调在 dispose 时通过 rmSync(..., { force: true }) 删除,插件一旦卸载就清掉。

Q: 它的代码依赖宿主有什么?

A: 只通过 ctx.inject(['webServer'], ...) 拿宿主提供的 webServer 服务,依赖的正是 issue #122 修复前会让 cordis 拒启的同一种 bundle 注入路径。

上手难度

入门 — 因为它本身不是供人配置的插件,使用者只需要把它放进 e2e fixture 列表,无需理解任何业务参数。

已知问题与限制

  • 本身就是"已知问题":fixture-clash 的存在意义就是在 install 路径里制造一个 ID 冲突样本。cordis.patch.yml:1 注释明确说明:"cordis refuses to boot a tree with two entries under one id, so an install that lets this through bricks the next start"
  • tests/web/install.e2e.ts:127 显式断言拒绝:install 路由必须返回非 200,否则该 e2e 用例失败(对应 issue #122)
  • 不应出现在真实用户的 profile 里:该夹具只服务于 dsh-market 自身的回归测试,对外没有功能价值
  • private: true:package.json 标了 private,发布链路会拦截它,仅在 monorepo 内部流转

收录徽章

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/dsh-market/dsh-market/tests/web/fixtures/fixture-clash)

把这段 markdown 粘贴到你的 GitHub README,链接回本插件详情页。徽章只声明已被本站收录,不代表安全认证。

返回插件目录