# dsh-market

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

## Metadata

- Author: [@dsh-market](https://github.com/dsh-market)
- Repo: <https://github.com/dsh-market/dsh-market.git>
- GitHub: [dsh-market/dsh-market](https://github.com/dsh-market/dsh-market)
- Stars: 1,427
- Language: TypeScript
- License: [MIT](https://spdx.org/licenses/MIT.html)
- Homepage: <https://dshmarket.com>
- Topics: `deepseek-harness`, `dsh-plugin`, `marketplace`
- Forks: 83
- Open Issues: 35
- Last push: 2026-08-20T14:12:16.000Z
- Added: 2026-08-20T00:00:00.000Z

## Install

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

## Wiki

## One-Line Description
This is the e2e test fixture that comes with the dsh-market repository; it's not a plugin intended for regular users to install. It intentionally declares the same loader entry ID as `fixture-a` to verify whether the install process will intercept the clash during end-to-end testing.

## Core Capabilities
- Declares `id: dshm-fixture-a` in `cordis.patch.yml`, competing with `fixture-a` for the same loader entry
- Injects `webServer` via the host to write a timestamp marker file at `$DSH_HOME/e2e-dshm-e2e-fixture-clash.alive`
- Deletes the marker file during plugin uninstall to prove that the lifecycle dispose actually occurred
- Serves as adversarial input for the e2e suite (`tests/web/install.e2e.ts`), verifying that the install interface rejects ID conflicts

## Technical Implementation
- **Language**: JavaScript (ESM, `type: module`)
- **Key Dependencies**: Only uses built-in modules `node:fs` and `node:path`
- **Architecture Pattern**: Injects `cordis.patch.yml` into the cordis loading stack via `package.json#dsh.bundle.patch`; the module itself attaches to the host in the form of `apply(ctx)`
- **Entry File**: `tests/web/fixtures/fixture-clash/index.js`

## Use Cases
Only used in the test case at line 127 of `tests/web/install.e2e.ts` — "refuses an install that would duplicate a loader entry id (#122)". Regular users have no reason to install it directly; it exists to create an install conflict sample to verify the protection logic, rather than providing any business functionality.

## Prerequisites & Compatibility

| Dependency | Minimum Version | Description |
|---|---|---|
| DSH Host | Not declared | Injects webServer, depends on host capabilities, no version constraint |
| Node | Not declared | Only uses `node:fs` / `node:path`, actually runs on the test Node runtime |
| Platform | Cross-platform | No native modules, no system calls, only file read/write |
| Native Modules | None | All come from Node built-ins |

## Installation

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

## Configuration
This plugin requires no additional configuration.

## FAQ

**Q: Is this plugin meant for regular users to install?**

A: No. It's an e2e fixture under `tests/web/fixtures/` in the dsh-market repository, only used in tests like `install.e2e.ts`, and provides no business functionality.

**Q: What is its relationship with `fixture-a`?**

A: Both intentionally declare their `id` field as `dshm-fixture-a`, and cordis does not allow two entities under the same loader entry; if the install process lets this fixture through, the host will reject the entire bundle tree on next startup.

**Q: What happens if it's installed into a real profile?**

A: The test case at `tests/web/install.e2e.ts:127` expects install to return a non-200 status code, and `dshm-e2e-fixture-clash` should not appear in the `installed` list; the already-installed `fixture-a` must remain live, proving the conflict was blocked before writing to the profile.

**Q: What is the marker file for?**

A: It's the fixture's self-proving liveness probe: the file only appears when cordis parses the package, loads the module, runs `apply()`, and satisfies the `webServer` injection; during uninstall, it's deleted by the dispose callback in `ctx.effect`, so it can distinguish between "plugin alive" and "plugin dead".

**Q: Will the file stay on disk forever?**

A: No. `$DSH_HOME/e2e-dshm-e2e-fixture-clash.alive` is deleted by the effect callback in dispose via `rmSync(..., { force: true })`; once the plugin is uninstalled, it's cleaned up.

**Q: What host dependencies does its code have?**

A: It only obtains the webServer service provided by the host via `ctx.inject(['webServer'], ...)`, depending on the same bundle injection path that cordis would reject before the fix for issue #122.

## Difficulty Level
Beginner — Since it's not a user-configurable plugin itself, users only need to add it to the e2e fixture list; no business parameters need to be understood.

## Known Issues & Limitations
- **Itself is a "known issue"**: The purpose of fixture-clash's existence is to create an ID conflict sample in the install path. The comment in `cordis.patch.yml:1` clearly states: "cordis refuses to boot a tree with two entries under one id, so an install that lets this through bricks the next start"
- **Explicitly asserted to be rejected by `tests/web/install.e2e.ts:127`**: The install route must return non-200, otherwise the e2e test case fails (corresponding to issue #122)
- **Should not appear in real users' profiles**: This fixture only serves dsh-market's own regression testing and has no functional value for external users
- **`private: true`**: The package.json is marked as private, and the publishing pipeline will block it; it only circulates within the monorepo

---

This document is auto-generated by [deepseek-plugin.org](https://deepseek-plugin.org). HTML page: [dsh-market](https://deepseek-plugin.org/plugins/dsh-market/dsh-market/tests/web/fixtures/fixture-clash)
Wiki generated by AI (model: `MiniMax-M2.5`)
