dsh-score 0.1.0

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/README.md ADDED
@@ -0,0 +1,216 @@
1
+ <div align="center">
2
+
3
+ # 🏆 dsh-score
4
+
5
+ **Multi-dimensional quality scoring for DeepSeek Harness plugins.**
6
+
7
+ *Five dimensions, real `gh`/`npm` evidence, one weighted risk card and leaderboard.*
8
+
9
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
10
+ [![DSH plugin](https://img.shields.io/badge/dsh-plugin-✅-green)](https://github.com/topics/dsh-plugin)
11
+ [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-brightgreen.svg)](#)
12
+ [![CI](https://img.shields.io/github/actions/workflow/status/PerryLink/dsh-score/ci.yml?branch=main&label=CI)](https://github.com/PerryLink/dsh-score/actions)
13
+ [![Version](https://img.shields.io/github/v/tag/PerryLink/dsh-score?label=version)](https://github.com/PerryLink/dsh-score/releases)
14
+ [![npm version](https://img.shields.io/npm/v/dsh-score)](https://www.npmjs.com/package/dsh-score)
15
+ [![npm downloads](https://img.shields.io/npm/dm/dsh-score)](https://www.npmjs.com/package/dsh-score)
16
+
17
+ [English](README.md) · [简体中文](README.zh.md) · [Español](README.es.md) · [Português](README.pt.md) · [हिन्दी](README.hi.md)
18
+
19
+ </div>
20
+
21
+ ---
22
+
23
+ ## Compatibility
24
+
25
+ | Component | Version |
26
+ |---|---|
27
+ | DeepSeek Harness | `0.1.0-rc.6` (peer dependencies pinned) |
28
+ | Node.js | `^22.19.0 \|\| >=24.0.0` |
29
+ | Package manager | `pnpm@11.7.0` |
30
+ | Platform | Windows / macOS / Linux (host-only plugin) |
31
+ | External tools | `gh` CLI on PATH (authenticated for API reads), `npm` CLI on PATH |
32
+
33
+ ## What you get
34
+
35
+ - `score` tool — one target through the five-dimension pipeline; returns the structured risk card, or `{ kind: 'background', jobId }` with `background: true`.
36
+ - `/score` command — batch scoring of a whitespace/comma-separated target list as a `score-batch` background job over `ctx.jobs`, producing a leaderboard snapshot (JSON + Markdown).
37
+ - `score_report` tool — fetch any stored score card (`sc_...`), leaderboard (`lb_...`), or the latest leaderboard.
38
+ - **Five dimensions** (weights configurable, defaults sum to 100): install success `25`, maintenance `20`, documentation `20`, security `20`, compliance `15`.
39
+ - **Evidence discipline** — every dimension records its audit links (`source`, sanitized `detail`, `observedAt`); a dimension without evidence reports `no-evidence` (score 0, excluded from the weighted total), never a fabricated number.
40
+ - Structured results — every record carries `schema: "dsh-score/v1"` with first-class fields; this is the machine-readable contract downstream tooling consumes.
41
+
42
+ ## Quick start
43
+
44
+ ### Git channel
45
+
46
+ ```sh
47
+ dsh plugin --profile web add github:PerryLink/dsh-score#<commit-sha>
48
+ ```
49
+
50
+ The first `add` fails because pnpm blocks the package's `prepare` build; copy the exact key pnpm printed into the profile's `pnpm-workspace.yaml` and re-run:
51
+
52
+ ```yaml
53
+ allowBuilds:
54
+ 'dsh-score': true
55
+ ```
56
+
57
+ ### npm channel
58
+
59
+ ```sh
60
+ dsh plugin --profile web add dsh-score
61
+ ```
62
+
63
+ Prebuilt packages need no build allowance. Restart the profile, then use `score` / `/score` from a session.
64
+
65
+ ## Install & uninstall
66
+
67
+ ```sh
68
+ dsh plugin --profile web add dsh-score # install (npm) — or the git form above
69
+ dsh plugin --profile web remove dsh-score # uninstall
70
+ ```
71
+
72
+ ## Configuration
73
+
74
+ All keys are optional (defaults shown); invalid values fail loudly at load.
75
+
76
+ | Key | Default | Description |
77
+ |---|---|---|
78
+ | `probeTimeoutMs` | `60000` | Deadline for one `gh`/`npm` probe command. |
79
+ | `outputTailBytes` | `8000` | Cap on the sanitized output tail recorded per probe. |
80
+ | `cacheMaxAgeMs` | `86400000` | How long a cached score card is reused before re-scoring (0 disables the cache). |
81
+ | `staleCommitWarnDays` | `90` | Commit/publish age at which maintenance drops to `warn`. |
82
+ | `staleCommitFailDays` | `365` | Commit/publish age at which maintenance drops to `fail`. |
83
+ | `staleIssueWarnDays` | `30` | Oldest-open-issue age (response proxy) at which maintenance drops to `warn`. |
84
+ | `staleIssueFailDays` | `180` | Oldest-open-issue age at which maintenance drops to `fail`. |
85
+ | `maxBatchTargets` | `20` | `/score` batch cap. |
86
+ | `batchConcurrency` | `1` | Batch concurrency (serial avoids API-rate contention). |
87
+ | `weights` | `{install:25, maintenance:20, documentation:20, security:20, compliance:15}` | Per-dimension weights (each 0–100; at least one must be > 0). |
88
+
89
+ ## Tools & surfaces
90
+
91
+ ### `score`
92
+
93
+ ```
94
+ score(target: string, refresh?: boolean, background?: boolean)
95
+ ```
96
+
97
+ - `target` — a GitHub repo (`github:owner/repo`, `owner/repo`, a git/https URL) or an npm package name.
98
+ - `refresh: true` bypasses the score cache and re-gathers evidence.
99
+ - `background: true` starts a `score-batch` job and returns its id.
100
+
101
+ ### `/score <targets...>`
102
+
103
+ Starts one background batch job; progress streams through the job output, and the final line names the leaderboard id for `score_report`.
104
+
105
+ ### `score_report(id?)`
106
+
107
+ Returns a score card (`sc_...`), a leaderboard (`lb_...`), or — with no id — the latest leaderboard.
108
+
109
+ ### Structured result sample
110
+
111
+ ```json
112
+ {
113
+ "schema": "dsh-score/v1",
114
+ "scoreId": "sc_8f1c2e4a9b3d7f01",
115
+ "target": { "kind": "repo", "spec": "github:owner/dsh-click#abc123" },
116
+ "scoredAt": "2026-08-16T00:00:00.000Z",
117
+ "durationMs": 3210,
118
+ "pluginVersion": "0.1.0",
119
+ "dimensions": {
120
+ "install": { "dimension": "install", "status": "no-evidence", "score": 0, "weight": 25,
121
+ "summary": "no dsh-test-drive result recorded for this target (install success unmeasured)",
122
+ "evidence": [{ "source": "test-drive", "detail": "no test-drive record found in the test_drive domain", "observedAt": "2026-08-16T00:00:00.000Z" }] },
123
+ "maintenance": { "dimension": "maintenance", "status": "pass", "score": 100, "weight": 20,
124
+ "summary": "active (2026-08-10T00:00:00Z; 0 open issues)",
125
+ "evidence": [{ "source": "gh-api", "detail": "last activity 2026-08-10T00:00:00Z", "observedAt": "2026-08-16T00:00:00.000Z" }] }
126
+ },
127
+ "total": 88,
128
+ "grade": "B",
129
+ "verdict": "healthy (weighted total 88/100)"
130
+ }
131
+ ```
132
+
133
+ Scoring: the total is a weighted average over dimensions that gathered evidence (no-evidence dimensions are excluded and renormalized); `A` ≥ 90, `B` ≥ 75, `C` ≥ 60, `D` ≥ 40, else `F`, and `N/A` when nothing had evidence.
134
+
135
+ ## Permissions & data
136
+
137
+ - Only public services are consumed: `ctx.subprocess`, `ctx.jobs`, `ctx.storageDomain`, `ctx.tools`, `ctx.commands`.
138
+ - Score cards and leaderboards are stored in the `score` storage-domain (tables `scores`, `leaderboards`; latest-leaderboard pointer). When the composition has no `storageDomain` (e.g. the shipped headless profile), tools still work and score persistence is disabled with a logged reason.
139
+ - Child processes inherit the provider's credential-scrubbed environment; `gh` reads its own credential store. No environment value is ever logged.
140
+ - All report/log strings pass through pure sanitizers: token literals, URL credentials, and bearer headers are redacted, and tails are byte-capped.
141
+
142
+ ## Security boundaries
143
+
144
+ - **No code execution.** The pipeline runs `gh api` and `npm view` only; it never installs, builds, or runs a target.
145
+ - **Argv-only subprocesses.** Every CLI invocation is an argv array, never shell-interpreted; repo owner/repo segments are validated against a restricted character set before use in an endpoint.
146
+ - **Evidence discipline.** No score is fabricated: a probe that fails or returns unparsable output yields `no-evidence`, never a number.
147
+ - **Detection vs redaction.** Secret-leak and malicious-install-script detection share the same pure regexes as redaction; both are unit-tested against extreme inputs.
148
+
149
+ ## Known limitations
150
+
151
+ - Repository probes require `gh` to be authenticated and network access to GitHub; npm probes require `npm` and registry access.
152
+ - A target without a resolvable GitHub repository cannot be inspected for documentation, security, or compliance (those dimensions report `no-evidence`).
153
+ - Install success depends on `dsh-test-drive` being mounted and having recorded the target; otherwise it is honestly `no-evidence`.
154
+ - The maintenance "issue response" signal is a proxy (oldest open issue age), not a direct response-time measurement.
155
+ - Score results are cached per target; use `refresh: true` (or wait past `cacheMaxAgeMs`) to force re-scoring.
156
+
157
+ ## Development
158
+
159
+ ```sh
160
+ pnpm install
161
+ pnpm run typecheck && pnpm run typecheck:ci && pnpm test
162
+ pnpm run build && pnpm run verify:self-contained && pnpm run verify:artifacts && pnpm pack
163
+ ```
164
+
165
+ - `typecheck` resolves `@deepseek-ai/*` through the local harness checkout; `typecheck:ci` checks against the published `0.1.0-rc.6` types.
166
+ - Tests use the real `Context`/`Session`/`ToolRuntime`/`LocalJobRegistry`/storage stack with a scripted subprocess provider.
167
+ - Real-CLI scoring (requires `gh`/`npm` on PATH, `gh` authenticated): invoke `score` from a mounted profile.
168
+ - Release: `node scripts/release.mjs <x.y.z>` (bumps, stamps CHANGELOG, re-runs the gate, commits + tags; never pushes).
169
+
170
+ ## Topics
171
+
172
+ `dsh`, `dsh-plugin`, `deepseek-harness`, `deepseek`, `cordis`, `plugin-scoring`, `quality-score`, `leaderboard`, `supply-chain`
173
+
174
+ ## Contributors
175
+
176
+ [PerryLink](https://github.com/PerryLink) — design and implementation.
177
+
178
+ ## PerryLink DSH Plugin Family
179
+
180
+ This project is one of the [29 DeepSeek Harness plugins](https://github.com/PerryLink) maintained by [PerryLink](https://github.com/PerryLink). If this one helps you, the others likely will too:
181
+
182
+ | Plugin | One-liner |
183
+ |---|---|
184
+ | [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) | Second-model auto-review on the approval chain, fail-closed by default |
185
+ | [dsh-background-agents](https://github.com/PerryLink/dsh-background-agents) | Durable background child agents with a Web UI sidebar, messaging and interrupt |
186
+ | [dsh-budget](https://github.com/PerryLink/dsh-budget) | Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel. |
187
+ | [dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind) | Claude Code /rewind-equivalent: snapshots, session forks, one-shot restore |
188
+ | [dsh-claude-move](https://github.com/PerryLink/dsh-claude-move) | Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH |
189
+ | [dsh-click](https://github.com/PerryLink/dsh-click) | Cross-platform native desktop control for DeepSeek Harness — Windows first. |
190
+ | [dsh-composer-history](https://github.com/PerryLink/dsh-composer-history) | Terminal-style input history for the web composer: arrows, Ctrl+R search |
191
+ | [dsh-defend](https://github.com/PerryLink/dsh-defend) | Prompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness. |
192
+ | [dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck) | Engineering-discipline guard: requirements grill, test gates, adversary review |
193
+ | [dsh-draw](https://github.com/PerryLink/dsh-draw) | Unified static-image generation routing for DeepSeek Harness. |
194
+ | [dsh-fast](https://github.com/PerryLink/dsh-fast) | Read-only performance diagnostics for DeepSeek Harness. |
195
+ | [dsh-github](https://github.com/PerryLink/dsh-github) | GitHub PR/issues integration for DSH, every write gated by approval |
196
+ | [dsh-library](https://github.com/PerryLink/dsh-library) | Local document knowledge base for DeepSeek Harness. |
197
+ | [dsh-local-ai](https://github.com/PerryLink/dsh-local-ai) | Local-model (Ollama) integration for DeepSeek Harness. |
198
+ | [dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions) | LSP diagnostics, formatting, completion, code actions and rename over language servers |
199
+ | [dsh-mask](https://github.com/PerryLink/dsh-mask) | PII masking middleware for DeepSeek Harness — anonymize personal data before it reaches the model, restore it at the display layer. |
200
+ | [dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel) | Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors |
201
+ | [dsh-memento](https://github.com/PerryLink/dsh-memento) | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool |
202
+ | [dsh-observe](https://github.com/PerryLink/dsh-observe) | OpenTelemetry and Langfuse observability exporter for DeepSeek Harness. |
203
+ | [dsh-output-styles](https://github.com/PerryLink/dsh-output-styles) | Claude Code outputStyles-equivalent runtime style switching |
204
+ | [dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules) | Claude Code-style declarative allow/deny/ask permission rules with audit |
205
+ | [dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide) | Plugin-development knowledge base as an on-demand agent skill |
206
+ | **[dsh-score](https://github.com/PerryLink/dsh-score)** | Multi-dimensional quality scoring for DeepSeek Harness plugins. |
207
+ | [dsh-session-pin](https://github.com/PerryLink/dsh-session-pin) | Pin sessions in the Web sidebar with durable ordering |
208
+ | [dsh-session-sync](https://github.com/PerryLink/dsh-session-sync) | Cross-device session sync for DeepSeek Harness — a dedicated git mirror of your session store. |
209
+ | [dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security) | Security-audit skill pack: secret scan, dependency and supply-chain review |
210
+ | [dsh-talk](https://github.com/PerryLink/dsh-talk) | Voice-first session loop for DeepSeek Harness: talk to it, hear it answer. |
211
+ | [dsh-test-drive](https://github.com/PerryLink/dsh-test-drive) | Isolated install-and-smoke test drives for DeepSeek Harness plugins. |
212
+ | [dsh-translate](https://github.com/PerryLink/dsh-translate) | Vendor parameter translation and deterministic JSON repair for DeepSeek Harness. |
213
+
214
+ ## License
215
+
216
+ [Apache-2.0](LICENSE)
package/README.pt.md ADDED
@@ -0,0 +1,182 @@
1
+ <div align="center">
2
+
3
+ # 🏆 dsh-score
4
+
5
+ **Pontuação de qualidade multidimensional para plugins do DeepSeek Harness.**
6
+
7
+ *Cinco dimensões, evidência real dos CLIs `gh`/`npm`, um cartão de risco ponderado e ranking.*
8
+
9
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
10
+ [![DSH plugin](https://img.shields.io/badge/dsh-plugin-✅-green)](https://github.com/topics/dsh-plugin)
11
+ [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-brightgreen.svg)](#)
12
+ [![CI](https://img.shields.io/github/actions/workflow/status/PerryLink/dsh-score/ci.yml?branch=main&label=CI)](https://github.com/PerryLink/dsh-score/actions)
13
+ [![Version](https://img.shields.io/github/v/tag/PerryLink/dsh-score?label=version)](https://github.com/PerryLink/dsh-score/releases)
14
+ [![npm version](https://img.shields.io/npm/v/dsh-score)](https://www.npmjs.com/package/dsh-score)
15
+ [![npm downloads](https://img.shields.io/npm/dm/dsh-score)](https://www.npmjs.com/package/dsh-score)
16
+
17
+ [English](README.md) · [简体中文](README.zh.md) · [Español](README.es.md) · [Português](README.pt.md) · [हिन्दी](README.hi.md)
18
+
19
+ </div>
20
+
21
+ ---
22
+
23
+ ## Compatibilidade
24
+
25
+ | Componente | Versão |
26
+ |---|---|
27
+ | DeepSeek Harness | `0.1.0-rc.6` (peer dependencies fixadas) |
28
+ | Node.js | `^22.19.0 \|\| >=24.0.0` |
29
+ | Gerenciador de pacotes | `pnpm@11.7.0` |
30
+ | Plataforma | Windows / macOS / Linux (plugin somente host) |
31
+ | Ferramentas externas | CLI `gh` no PATH (autenticado), CLI `npm` no PATH |
32
+
33
+ ## O que você recebe
34
+
35
+ - Ferramenta `score` — um alvo pela pipeline de cinco dimensões; retorna o cartão estruturado ou `{ kind: 'background', jobId }` com `background: true`.
36
+ - Comando `/score` — pontuação em lote de uma lista separada por espaços/vírgulas como job `score-batch` sobre `ctx.jobs`, produzindo um ranking (JSON + Markdown).
37
+ - Ferramenta `score_report` — busca um cartão (`sc_...`), um ranking (`lb_...`) ou o último ranking.
38
+ - **Cinco dimensões** (pesos configuráveis, soma 100 por padrão): instalação `25`, manutenção `20`, documentação `20`, segurança `20`, conformidade `15`.
39
+ - **Disciplina de evidência** — cada dimensão registra seus links de auditoria; sem evidência reporta `no-evidence` (pontuação 0, excluída do total), nunca um número inventado.
40
+ - Resultados estruturados — cada registro carrega `schema: "dsh-score/v1"`.
41
+
42
+ ## Início rápido
43
+
44
+ ### Canal git
45
+
46
+ ```sh
47
+ dsh plugin --profile web add github:PerryLink/dsh-score#<commit-sha>
48
+ ```
49
+
50
+ O primeiro `add` falha porque o pnpm bloqueia o `prepare`; copie a chave exata impressa em `pnpm-workspace.yaml` e tente de novo:
51
+
52
+ ```yaml
53
+ allowBuilds:
54
+ 'dsh-score': true
55
+ ```
56
+
57
+ ### Canal npm
58
+
59
+ ```sh
60
+ dsh plugin --profile web add dsh-score
61
+ ```
62
+
63
+ ## Instalação e desinstalação
64
+
65
+ ```sh
66
+ dsh plugin --profile web add dsh-score # instalar (npm) — ou o formulário git acima
67
+ dsh plugin --profile web remove dsh-score # desinstalar
68
+ ```
69
+
70
+ ## Configuração
71
+
72
+ Todas as chaves são opcionais (padrões mostrados); valores inválidos falham em voz alta ao carregar.
73
+
74
+ | Chave | Padrão | Descrição |
75
+ |---|---|---|
76
+ | `probeTimeoutMs` | `60000` | Prazo para um comando de sondagem `gh`/`npm`. |
77
+ | `outputTailBytes` | `8000` | Teto da cauda de saída saneada por sondagem. |
78
+ | `cacheMaxAgeMs` | `86400000` | Tempo de reuso de um cartão em cache. |
79
+ | `staleCommitWarnDays` | `90` | Idade de commit para `warn`. |
80
+ | `staleCommitFailDays` | `365` | Idade de commit para `fail`. |
81
+ | `staleIssueWarnDays` | `30` | Idade da issue aberta mais antiga para `warn`. |
82
+ | `staleIssueFailDays` | `180` | Idade da issue aberta mais antiga para `fail`. |
83
+ | `maxBatchTargets` | `20` | Teto de lote do `/score`. |
84
+ | `batchConcurrency` | `1` | Concorrência do lote. |
85
+ | `weights` | `{install:25, maintenance:20, documentation:20, security:20, compliance:15}` | Pesos por dimensão. |
86
+
87
+ ## Ferramentas e superfícies
88
+
89
+ ### `score`
90
+
91
+ ```
92
+ score(target: string, refresh?: boolean, background?: boolean)
93
+ ```
94
+
95
+ - `target` — repositório GitHub (`github:owner/repo`, `owner/repo`, URL git/https) ou nome de pacote npm.
96
+ - `refresh: true` ignora o cache e recoleta evidência.
97
+ - `background: true` inicia um job `score-batch`.
98
+
99
+ ### `/score <targets...>`
100
+
101
+ Inicia um job em lote em segundo plano; a última linha nomeia o id do ranking para `score_report`.
102
+
103
+ ### `score_report(id?)`
104
+
105
+ Retorna um cartão (`sc_...`), um ranking (`lb_...`) ou, sem id, o último ranking.
106
+
107
+ ## Permissões e dados
108
+
109
+ - Apenas serviços públicos: `ctx.subprocess`, `ctx.jobs`, `ctx.storageDomain`, `ctx.tools`, `ctx.commands`.
110
+ - Cartões e rankings são armazenados no domínio `score` (tabelas `scores`, `leaderboards`; ponteiro do último ranking). Sem `storageDomain`, as ferramentas seguem funcionando e a persistência é desativada com motivo registrado.
111
+ - Processos filhos herdam um ambiente sem credenciais; `gh` usa seu próprio armazenamento. Nenhum valor de ambiente é registrado.
112
+
113
+ ## Limites de segurança
114
+
115
+ - **Sem execução de código.** Apenas `gh api` e `npm view` são executados.
116
+ - **Subprocessos somente argv.** Nunca via shell; segmentos owner/repo são validados antes do uso.
117
+ - **Disciplina de evidência.** Sondagem com falha produz `no-evidence`, nunca um número.
118
+ - **Detecção vs saneamento.** Detecção de segredos e scripts maliciosos compartilha as mesmas regex puras do saneamento.
119
+
120
+ ## Limitações conhecidas
121
+
122
+ - Sondagens de repositório exigem `gh` autenticado e rede; as de npm exigem `npm` e acesso ao registry.
123
+ - Sem repositório GitHub resolvível, documentação/segurança/conformidade reportam `no-evidence`.
124
+ - O sucesso de instalação depende do `dsh-test-drive` montado com o alvo registrado.
125
+ - A «resposta a issues» é um proxy (idade da issue aberta mais antiga).
126
+ - Resultados são cacheados por alvo; use `refresh: true` para forçar nova pontuação.
127
+
128
+ ## Desenvolvimento
129
+
130
+ ```sh
131
+ pnpm install
132
+ pnpm run typecheck && pnpm run typecheck:ci && pnpm test
133
+ pnpm run build && pnpm run verify:self-contained && pnpm run verify:artifacts && pnpm pack
134
+ ```
135
+
136
+ ## Tópicos
137
+
138
+ `dsh`, `dsh-plugin`, `deepseek-harness`, `deepseek`, `cordis`, `plugin-scoring`, `quality-score`, `leaderboard`, `supply-chain`
139
+
140
+ ## Contribuidores
141
+
142
+ [PerryLink](https://github.com/PerryLink) — design e implementação.
143
+
144
+ ## PerryLink DSH Plugin Family
145
+
146
+ Este projeto é um dos [29 complementos do DeepSeek Harness](https://github.com/PerryLink) mantidos por [PerryLink](https://github.com/PerryLink). Se este ajuda você, os outros provavelmente também ajudarão:
147
+
148
+ | Plugin | One-liner |
149
+ |---|---|
150
+ | [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) | Auto-revisão com segundo modelo na cadeia de aprovação, falha fechada por padrão |
151
+ | [dsh-background-agents](https://github.com/PerryLink/dsh-background-agents) | Agentes filhos em segundo plano e duráveis com barra lateral Web, mensagens e interrupção |
152
+ | [dsh-budget](https://github.com/PerryLink/dsh-budget) | Governança de custos para DeepSeek Harness: orçamentos, carbono e latência em um painel. |
153
+ | [dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind) | Equivalente ao /rewind do Claude Code: instantâneos, bifurcações e restauração de uma vez |
154
+ | [dsh-claude-move](https://github.com/PerryLink/dsh-claude-move) | Migra sessões, memória, skills e CLAUDE.md do Claude Code para o DSH |
155
+ | [dsh-click](https://github.com/PerryLink/dsh-click) | Controle de desktop nativo multiplataforma para DeepSeek Harness — Windows primeiro. |
156
+ | [dsh-composer-history](https://github.com/PerryLink/dsh-composer-history) | Histórico de entrada estilo terminal para o compositor web: setas, busca Ctrl+R |
157
+ | [dsh-defend](https://github.com/PerryLink/dsh-defend) | Defesa contra injeção de prompt, jailbreak e vazamento de segredos para DeepSeek Harness. |
158
+ | [dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck) | Guarda de disciplina de engenharia: sabatina de requisitos, portões de teste, revisão adversária |
159
+ | [dsh-draw](https://github.com/PerryLink/dsh-draw) | Roteamento unificado de geração de imagens estáticas para DeepSeek Harness. |
160
+ | [dsh-fast](https://github.com/PerryLink/dsh-fast) | Diagnóstico de desempenho somente leitura para DeepSeek Harness. |
161
+ | [dsh-github](https://github.com/PerryLink/dsh-github) | Integração de PR/issues do GitHub para DSH, toda escrita com aprovação |
162
+ | [dsh-library](https://github.com/PerryLink/dsh-library) | Base de conhecimento documental local para DeepSeek Harness. |
163
+ | [dsh-local-ai](https://github.com/PerryLink/dsh-local-ai) | Integração de modelos locais (Ollama) para DeepSeek Harness. |
164
+ | [dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions) | Diagnóstico, formatação, completação, ações e renomeação LSP via servidores de linguagem |
165
+ | [dsh-mask](https://github.com/PerryLink/dsh-mask) | Middleware de mascaramento de PII para DeepSeek Harness — anonimiza antes do modelo e restaura na camada de exibição. |
166
+ | [dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel) | Painel MCP somente leitura: comando /mcp + aba de configurações com status, ferramentas e erros |
167
+ | [dsh-memento](https://github.com/PerryLink/dsh-memento) | Memória entre sessões com porta de aprovação: seam ctx.memory + SQLite + ferramenta memory |
168
+ | [dsh-observe](https://github.com/PerryLink/dsh-observe) | Exportador de observabilidade OpenTelemetry e Langfuse para DeepSeek Harness. |
169
+ | [dsh-output-styles](https://github.com/PerryLink/dsh-output-styles) | Troca de estilos em tempo de execução equivalente ao outputStyles do Claude Code |
170
+ | [dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules) | Regras declarativas allow/deny/ask estilo Claude Code com auditoria |
171
+ | [dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide) | Base de conhecimento de desenvolvimento de plugins como skill de agente sob demanda |
172
+ | **[dsh-score](https://github.com/PerryLink/dsh-score)** | Pontuação de qualidade multidimensional para plugins do DeepSeek Harness. |
173
+ | [dsh-session-pin](https://github.com/PerryLink/dsh-session-pin) | Fixa sessões na barra lateral Web com ordenação durável |
174
+ | [dsh-session-sync](https://github.com/PerryLink/dsh-session-sync) | Sincronização de sessões entre dispositivos para DeepSeek Harness — um espelho git dedicado do seu armazenamento de sessões. |
175
+ | [dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security) | Pacote de skills de auditoria de segurança: varredura de segredos, revisão de dependências e cadeia de suprimentos |
176
+ | [dsh-talk](https://github.com/PerryLink/dsh-talk) | Loop de sessão com voz para DeepSeek Harness: fale e ouça a resposta. |
177
+ | [dsh-test-drive](https://github.com/PerryLink/dsh-test-drive) | Testes isolados de instalação e inicialização para plugins do DeepSeek Harness. |
178
+ | [dsh-translate](https://github.com/PerryLink/dsh-translate) | Tradução de parâmetros entre fornecedores e reparo determinístico de JSON para DeepSeek Harness. |
179
+
180
+ ## Licença
181
+
182
+ [Apache-2.0](LICENSE)
package/README.zh.md ADDED
@@ -0,0 +1,190 @@
1
+ <div align="center">
2
+
3
+ # 🏆 dsh-score
4
+
5
+ **为 DeepSeek Harness 插件提供多指标质量评分。**
6
+
7
+ *五个维度、真实 gh/npm 证据,一张加权风险卡与排行榜。*
8
+
9
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
10
+ [![DSH plugin](https://img.shields.io/badge/dsh-plugin-✅-green)](https://github.com/topics/dsh-plugin)
11
+ [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-brightgreen.svg)](#)
12
+ [![CI](https://img.shields.io/github/actions/workflow/status/PerryLink/dsh-score/ci.yml?branch=main&label=CI)](https://github.com/PerryLink/dsh-score/actions)
13
+ [![Version](https://img.shields.io/github/v/tag/PerryLink/dsh-score?label=version)](https://github.com/PerryLink/dsh-score/releases)
14
+ [![npm version](https://img.shields.io/npm/v/dsh-score)](https://www.npmjs.com/package/dsh-score)
15
+ [![npm downloads](https://img.shields.io/npm/dm/dsh-score)](https://www.npmjs.com/package/dsh-score)
16
+
17
+ [English](README.md) · [简体中文](README.zh.md) · [Español](README.es.md) · [Português](README.pt.md) · [हिन्दी](README.hi.md)
18
+
19
+ </div>
20
+
21
+ ---
22
+
23
+ ## 兼容性
24
+
25
+ | 组件 | 版本 |
26
+ |---|---|
27
+ | DeepSeek Harness | `0.1.0-rc.6`(peer 依赖钉死) |
28
+ | Node.js | `^22.19.0 \|\| >=24.0.0` |
29
+ | 包管理器 | `pnpm@11.7.0` |
30
+ | 平台 | Windows / macOS / Linux(纯 host 插件) |
31
+ | 外部工具 | PATH 上的 `gh` CLI(已认证用于 API 读取)、PATH 上的 `npm` CLI |
32
+
33
+ ## 你会得到什么
34
+
35
+ - `score` 工具——对单个目标跑五维评分流水线;返回结构化风险卡,传 `background: true` 时返回 `{ kind: 'background', jobId }`。
36
+ - `/score` 命令——把空白/逗号分隔的目标列表作为 `score-batch` 后台任务(`ctx.jobs`)批量评分,产出排行榜快照(JSON + Markdown)。
37
+ - `score_report` 工具——按 id 取回评分卡(`sc_...`)、排行榜(`lb_...`)或最新排行榜。
38
+ - **五个维度**(权重可配置,默认合计 100):安装成功率 `25`、维护 `20`、文档 `20`、安全 `20`、合规 `15`。
39
+ - **证据纪律**——每个维度记录其审计链接(`source`、脱敏后的 `detail`、`observedAt`);无证据的维度如实报告 `no-evidence`(得分 0,从加权总分中剔除),绝不编造数字。
40
+ - 结构化结果——每条记录带 `schema: "dsh-score/v1"` 判别符,字段一等公民化,是下游工具消费的机器可读契约。
41
+
42
+ ## 快速开始
43
+
44
+ ### git 通道
45
+
46
+ ```sh
47
+ dsh plugin --profile web add github:PerryLink/dsh-score#<commit-sha>
48
+ ```
49
+
50
+ 首次 `add` 会因 pnpm 拦截该包的 `prepare` 构建而失败;把 pnpm 打印的精确键复制到 profile 的 `pnpm-workspace.yaml` 后重试:
51
+
52
+ ```yaml
53
+ allowBuilds:
54
+ 'dsh-score': true
55
+ ```
56
+
57
+ ### npm 通道
58
+
59
+ ```sh
60
+ dsh plugin --profile web add dsh-score
61
+ ```
62
+
63
+ 预构建包无需构建许可。重启 profile 后即可在会话中使用 `score` / `/score`。
64
+
65
+ ## 安装与卸载
66
+
67
+ ```sh
68
+ dsh plugin --profile web add dsh-score # 安装(npm)——或上面的 git 形式
69
+ dsh plugin --profile web remove dsh-score # 卸载
70
+ ```
71
+
72
+ ## 配置
73
+
74
+ 所有键均可选(括号为默认值);非法值在加载期响亮失败。
75
+
76
+ | 键 | 默认值 | 说明 |
77
+ |---|---|---|
78
+ | `probeTimeoutMs` | `60000` | 单条 `gh`/`npm` 探测命令的截止时间(毫秒)。 |
79
+ | `outputTailBytes` | `8000` | 每条探测记录的脱敏输出尾部上限(字节)。 |
80
+ | `cacheMaxAgeMs` | `86400000` | 缓存评分卡复用的时长(0 关闭缓存)。 |
81
+ | `staleCommitWarnDays` | `90` | 提交/发布年龄超过该值维护维度降为 `warn`。 |
82
+ | `staleCommitFailDays` | `365` | 提交/发布年龄超过该值维护维度降为 `fail`。 |
83
+ | `staleIssueWarnDays` | `30` | 最久未关闭 issue 年龄(响应代理)超过该值降为 `warn`。 |
84
+ | `staleIssueFailDays` | `180` | 最久未关闭 issue 年龄超过该值降为 `fail`。 |
85
+ | `maxBatchTargets` | `20` | `/score` 批量上限。 |
86
+ | `batchConcurrency` | `1` | 批量并发(串行可避免 API 限流竞争)。 |
87
+ | `weights` | `{install:25, maintenance:20, documentation:20, security:20, compliance:15}` | 各维度权重(每个 0–100;至少一个 > 0)。 |
88
+
89
+ ## 工具与界面
90
+
91
+ ### `score`
92
+
93
+ ```
94
+ score(target: string, refresh?: boolean, background?: boolean)
95
+ ```
96
+
97
+ - `target`——GitHub 仓库(`github:owner/repo`、`owner/repo`、git/https URL)或 npm 包名。
98
+ - `refresh: true` 绕过评分缓存重新采集证据。
99
+ - `background: true` 启动 `score-batch` 任务并返回其 id。
100
+
101
+ ### `/score <targets...>`
102
+
103
+ 启动一个后台批量任务;进度经任务输出流式返回,最后一行给出供 `score_report` 使用的排行榜 id。
104
+
105
+ ### `score_report(id?)`
106
+
107
+ 返回评分卡(`sc_...`)、排行榜(`lb_...`),或不传 id 时返回最新排行榜。
108
+
109
+ ## 权限与数据
110
+
111
+ - 只消费公开服务:`ctx.subprocess`、`ctx.jobs`、`ctx.storageDomain`、`ctx.tools`、`ctx.commands`。
112
+ - 评分卡与排行榜存于 `score` 存储域(表 `scores`、`leaderboards`;最新排行榜指针)。组合里没有 `storageDomain`(如官方 headless profile)时工具仍可用,评分持久化被禁用并记录原因。
113
+ - 子进程继承 provider 已剥离凭据的环境;`gh` 读取其自身的凭据存储。任何环境变量值都不被记录。
114
+ - 所有报告/日志字符串经过纯脱敏函数:token 字面量、URL 凭据、bearer 头被脱敏,尾部按字节截断。
115
+
116
+ ## 安全边界
117
+
118
+ - **不执行代码**。流水线只运行 `gh api` 与 `npm view`;绝不安装、构建或运行目标。
119
+ - **仅 argv 子进程**。每次 CLI 调用都是 argv 数组,绝不经过 shell 解释;owner/repo 段在用于端点前先做受限字符集校验。
120
+ - **证据纪律**。不编造评分:探测失败或输出不可解析时返回 `no-evidence`,绝不填数字。
121
+ - **检测与脱敏分离**。密钥泄露与恶意安装脚本检测复用与脱敏同一套纯正则,二者均有极端输入单测。
122
+
123
+ ## 已知限制
124
+
125
+ - 仓库探测需要 `gh` 已认证且有到 GitHub 的网络;npm 探测需要 `npm` 与 registry 访问。
126
+ - 无法解析出 GitHub 仓库的目标无法检查文档、安全或合规(这些维度报告 `no-evidence`)。
127
+ - 安装成功率依赖 `dsh-test-drive` 已挂载且已记录该目标;否则如实为 `no-evidence`。
128
+ - 维护维度的“issue 响应”是代理信号(最久未关闭 issue 年龄),不是直接响应时长测量。
129
+ - 评分按目标缓存;用 `refresh: true`(或等过 `cacheMaxAgeMs`)强制重评。
130
+
131
+ ## 开发
132
+
133
+ ```sh
134
+ pnpm install
135
+ pnpm run typecheck && pnpm run typecheck:ci && pnpm test
136
+ pnpm run build && pnpm run verify:self-contained && pnpm run verify:artifacts && pnpm pack
137
+ ```
138
+
139
+ - `typecheck` 经本地 harness checkout 解析 `@deepseek-ai/*`;`typecheck:ci` 对照已发布的 `0.1.0-rc.6` 类型。
140
+ - 测试使用真实 `Context`/`Session`/`ToolRuntime`/`LocalJobRegistry`/存储栈,子进程 provider 为脚本化实现。
141
+ - 真实 CLI 评分(需 PATH 有 `gh`/`npm`,`gh` 已认证):在已挂载 profile 中调用 `score`。
142
+ - 发布:`node scripts/release.mjs <x.y.z>`(升版本、盖 CHANGELOG、重跑门禁、提交 + tag;绝不 push)。
143
+
144
+ ## 主题
145
+
146
+ `dsh`、`dsh-plugin`、`deepseek-harness`、`deepseek`、`cordis`、`plugin-scoring`、`quality-score`、`leaderboard`、`supply-chain`
147
+
148
+ ## 贡献者
149
+
150
+ [PerryLink](https://github.com/PerryLink) — 设计与实现。
151
+
152
+ ## PerryLink DSH Plugin Family
153
+
154
+ 本项目是由 [PerryLink](https://github.com/PerryLink) 维护的 [29 个 DeepSeek Harness 插件](https://github.com/PerryLink)之一。如果这个对你有用,其他插件很可能也会:
155
+
156
+ | Plugin | One-liner |
157
+ |---|---|
158
+ | [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) | 审批链上的第二模型自动审查,默认失败关闭 |
159
+ | [dsh-background-agents](https://github.com/PerryLink/dsh-background-agents) | 持久化后台子代理,带 Web UI 侧边栏、消息与打断 |
160
+ | [dsh-budget](https://github.com/PerryLink/dsh-budget) | DeepSeek Harness 的成本治理:预算、碳排与延迟一屏呈现。 |
161
+ | [dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind) | Claude Code /rewind 等价物:快照、会话分叉、一次性恢复 |
162
+ | [dsh-claude-move](https://github.com/PerryLink/dsh-claude-move) | 将 Claude Code 会话、记忆、技能与 CLAUDE.md 迁入 DSH |
163
+ | [dsh-click](https://github.com/PerryLink/dsh-click) | 跨平台原生桌面控制(DeepSeek Harness),Windows 优先。 |
164
+ | [dsh-composer-history](https://github.com/PerryLink/dsh-composer-history) | Web 输入框的终端式输入历史:方向键、Ctrl+R 搜索 |
165
+ | [dsh-defend](https://github.com/PerryLink/dsh-defend) | DeepSeek Harness 的提示注入、越狱与密钥泄露防护。 |
166
+ | [dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck) | 工程纪律门禁:需求质询、测试门禁、对抗式审查 |
167
+ | [dsh-draw](https://github.com/PerryLink/dsh-draw) | DeepSeek Harness 的统一静态图像生成路由。 |
168
+ | [dsh-fast](https://github.com/PerryLink/dsh-fast) | DeepSeek Harness 的只读性能诊断。 |
169
+ | [dsh-github](https://github.com/PerryLink/dsh-github) | DSH 的 GitHub PR/issue 集成,每次写入都经审批门 |
170
+ | [dsh-library](https://github.com/PerryLink/dsh-library) | DeepSeek Harness 的本地文档知识库。 |
171
+ | [dsh-local-ai](https://github.com/PerryLink/dsh-local-ai) | DeepSeek Harness 的本地模型(Ollama)接入。 |
172
+ | [dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions) | 经语言服务器的 LSP 诊断、格式化、补全、代码操作与重命名 |
173
+ | [dsh-mask](https://github.com/PerryLink/dsh-mask) | DeepSeek Harness 的 PII 脱敏中间件——数据到模型前匿名化,展示层还原。 |
174
+ | [dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel) | 只读 MCP 运行时面板:/mcp 命令 + 带状态、工具与错误的设置页 |
175
+ | [dsh-memento](https://github.com/PerryLink/dsh-memento) | 带审批门的跨会话记忆:ctx.memory 接缝 + SQLite + memory 工具 |
176
+ | [dsh-observe](https://github.com/PerryLink/dsh-observe) | DeepSeek Harness 的 OpenTelemetry 与 Langfuse 可观测导出器。 |
177
+ | [dsh-output-styles](https://github.com/PerryLink/dsh-output-styles) | Claude Code outputStyles 等价的运行时样式切换 |
178
+ | [dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules) | Claude Code 风格声明式 allow/deny/ask 权限规则,带审计 |
179
+ | [dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide) | 按需 agent 技能形式的插件开发知识库 |
180
+ | **[dsh-score](https://github.com/PerryLink/dsh-score)** | DeepSeek Harness 插件的多指标质量评分。 |
181
+ | [dsh-session-pin](https://github.com/PerryLink/dsh-session-pin) | 在 Web 侧边栏置顶会话,顺序持久化 |
182
+ | [dsh-session-sync](https://github.com/PerryLink/dsh-session-sync) | DeepSeek Harness 的跨设备会话同步——会话存储的专用 git 镜像。 |
183
+ | [dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security) | 安全审计技能包:密钥扫描、依赖与供应链审查 |
184
+ | [dsh-talk](https://github.com/PerryLink/dsh-talk) | DeepSeek Harness 的语音优先会话闭环:对它说,听它答。 |
185
+ | [dsh-test-drive](https://github.com/PerryLink/dsh-test-drive) | DeepSeek Harness 插件的隔离式安装冒烟实测。 |
186
+ | [dsh-translate](https://github.com/PerryLink/dsh-translate) | DeepSeek Harness 的厂商参数翻译与确定性 JSON 修复。 |
187
+
188
+ ## 许可证
189
+
190
+ [Apache-2.0](LICENSE)
package/SECURITY.md ADDED
@@ -0,0 +1,57 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a vulnerability
4
+
5
+ Please report vulnerabilities privately through the GitHub Security Advisory
6
+ interface: **Security → Report a vulnerability** on
7
+ [github.com/PerryLink/dsh-score](https://github.com/PerryLink/dsh-score/security/advisories/new).
8
+
9
+ **Sanitize before you paste.** Logs, transcripts, and reproductions must be
10
+ redacted first: remove tokens, API keys, passwords, authorization headers,
11
+ personal data, and full machine-local paths. Never include secrets in the
12
+ report body; describe them by kind and position instead.
13
+
14
+ ## What to expect
15
+
16
+ - First response (acknowledgment): typically within 7 days.
17
+ - The reporter receives credit in the advisory and release notes unless they
18
+ ask to stay anonymous.
19
+ - Fixes are released through the normal release flow with a
20
+ `SECURITY:`-tagged changelog entry and a GitHub Security Advisory.
21
+
22
+ ## Security model of this plugin
23
+
24
+ `dsh-score` never executes the target's code. It only reads public metadata
25
+ and public file contents through the `gh` and `npm` CLIs over `ctx.subprocess`.
26
+ Its own boundaries are:
27
+
28
+ - **No code execution.** The scoring pipeline runs `gh api` and `npm view`
29
+ only; it never installs, builds, or runs a target. The most a malicious
30
+ target can influence is the text of the files those commands return.
31
+ - **Argv-only subprocesses.** Every CLI invocation is passed as an argv array,
32
+ never through a shell, so a hostile target spec cannot inject commands.
33
+ Repo owner/repo segments are validated against a restricted character set
34
+ before being used in a `gh api` endpoint.
35
+ - **Credential hygiene.** Child processes inherit the subprocess provider's
36
+ credential-scrubbed environment; `gh` reads its own credential store. No
37
+ environment value is ever logged, and every report string passes the pure
38
+ sanitizers (token literals, URL credentials, bearer headers, control chars,
39
+ byte-capped tails).
40
+ - **Evidence discipline.** A score is only as trustworthy as its evidence.
41
+ Every dimension records its audit links (source + sanitized detail +
42
+ timestamp); when no evidence is available the dimension reports
43
+ `no-evidence` with score 0 and is excluded from the weighted total — the
44
+ plugin never fabricates a number.
45
+
46
+ ## Out of scope
47
+
48
+ Findings ABOUT a target (secret leaks, malicious scripts, missing license) are
49
+ the point of the security dimension, not a vulnerability of this package.
50
+ Report issues in this plugin's probe layer, parsing, sanitization, or scoring
51
+ logic.
52
+
53
+ ## Acknowledgments & disclosure
54
+
55
+ Fixes follow coordinated disclosure: the advisory goes out with the release
56
+ that contains the fix. Security researchers who follow this policy are
57
+ thanked in the advisory and the changelog.