dsh-quality-lens 0.1.1 → 0.1.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 (3) hide show
  1. package/README.md +2 -2
  2. package/lib/jev.js +5 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -152,7 +152,7 @@ node scripts/calibrate.mjs --in calibration/samples.labeled.jsonl
152
152
  - 默认引擎在本地完成,**不调用模型、不联网**;
153
153
  - 报告只存本机 `$DSH_HOME/quality-lens/reports.jsonl`,删目录即清空;
154
154
  - 无遥测;Jev 模式需显式配置 key,且仅发送当前问答;
155
- - 报告、证据、提示词建议里的凭证样式字符串(`npm_` / `ghp_` / `sk-` 等)会自动打码;旧报告在加载时也会被清洗。
155
+ - 报告、证据、提示词建议、Jev 请求里的凭证样式字符串(`npm_` / `ghp_` / `sk-` 等)会自动打码;旧报告在加载时也会被清洗。
156
156
  - 校准只读你自己的本机会话,不上传。
157
157
 
158
158
  ---
@@ -168,7 +168,7 @@ node scripts/calibrate.mjs --in calibration/samples.labeled.jsonl
168
168
  ## 开发
169
169
 
170
170
  ```sh
171
- node --test test/scoring.test.mjs test/host.test.mjs test/client-bundle.test.mjs test/labels-jev.test.mjs # 32 tests
171
+ node --test test/scoring.test.mjs test/host.test.mjs test/client-bundle.test.mjs test/labels-jev.test.mjs # 33 tests
172
172
  node scripts/demo.mjs # 打印样本评分
173
173
  node prototype/build.mjs # 重建自包含原型
174
174
  ```
package/lib/jev.js CHANGED
@@ -12,7 +12,7 @@
12
12
  * provider. It is off by default and never runs without an explicit key.
13
13
  * Failures degrade to the local engine; nothing here ever throws at the caller.
14
14
  */
15
- import { classifyLabels, labelsToReport } from './scoring.js'
15
+ import { classifyLabels, labelsToReport, redactSecrets } from './scoring.js'
16
16
 
17
17
  export const JEV_PROVIDERS = {
18
18
  typesafe: {
@@ -62,10 +62,10 @@ function noulQuestion(id, instructions) {
62
62
  * @param {{ question: string, answer: string, labels?: object }} input
63
63
  */
64
64
  export function buildJevRequest(input) {
65
- const question = String(input?.question ?? '')
66
- const answer = String(input?.answer ?? '')
67
- const context = String(input?.context ?? '')
68
- const contextAnswer = String(input?.contextAnswer ?? '')
65
+ const question = redactSecrets(String(input?.question ?? ''))
66
+ const answer = redactSecrets(String(input?.answer ?? ''))
67
+ const context = redactSecrets(String(input?.context ?? ''))
68
+ const contextAnswer = redactSecrets(String(input?.contextAnswer ?? ''))
69
69
  const labels = input?.labels ?? classifyLabels({ question, answer, context, contextAnswer })
70
70
  const intents = (labels.topic?.intents ?? []).slice(0, 5)
71
71
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-quality-lens",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "为每个 DeepSeek Harness 回答做质量与话题关联体检,并给出可复制的提示词改进建议。只观测不改写,默认本地评分,可选 Jev 精评。",
5
5
  "type": "module",
6
6
  "main": "lib/host.js",