dsh-reconcile 0.1.2 → 0.1.3
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 +2 -2
- package/client.js +2 -1
- package/package.json +1 -1
- package/test/selfcheck.mjs +20 -1
package/README.md
CHANGED
|
@@ -66,11 +66,11 @@ DeepSeek Harness 插件:**先核事实、再决定问不问、收工对账**
|
|
|
66
66
|
|
|
67
67
|
## 安装
|
|
68
68
|
|
|
69
|
-
**从 npm 装(已发布 0.1.
|
|
69
|
+
**从 npm 装(已发布 0.1.2):**
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
72
|
dsh plugin --profile web add dsh-reconcile
|
|
73
|
-
dsh plugin --profile web add dsh-reconcile@0.1.
|
|
73
|
+
dsh plugin --profile web add dsh-reconcile@0.1.2 # 钉版本
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
npm 包页:<https://www.npmjs.com/package/dsh-reconcile>
|
package/client.js
CHANGED
|
@@ -793,7 +793,8 @@ function formatScore(result) {
|
|
|
793
793
|
}, [draft, inputActions, sessionId])
|
|
794
794
|
|
|
795
795
|
if (!score) {
|
|
796
|
-
|
|
796
|
+
// 紧凑版没有「有文字」这个中间变量(那是输入框下方那个组件的),这里直接从 draft 现算
|
|
797
|
+
return String(draft ?? '').trim() !== ''
|
|
797
798
|
? h('span', { style: { color: T.muted, fontSize: 11 }, 'data-dsh-plugin': 'dsh-reconcile' }, `${t('scoreLabel')} …`)
|
|
798
799
|
: null
|
|
799
800
|
}
|
package/package.json
CHANGED
package/test/selfcheck.mjs
CHANGED
|
@@ -910,6 +910,25 @@ x
|
|
|
910
910
|
})
|
|
911
911
|
}
|
|
912
912
|
|
|
913
|
+
/* --------------------- 9. 客户端作用域静态护栏 --------------------- */
|
|
914
|
+
{
|
|
915
|
+
const src = readFileSync(new URL('../client.js', import.meta.url), 'utf8')
|
|
916
|
+
const startOf = (name) => src.indexOf('function ' + name)
|
|
917
|
+
const scoreStart = startOf('ScoreHint')
|
|
918
|
+
const heroStart = startOf('HeroHint')
|
|
919
|
+
test('客户端作用域:hasText 只出现在 ScoreHint 内(HeroHint 误用会白屏崩溃)', () => {
|
|
920
|
+
assert.ok(scoreStart > 0 && heroStart > scoreStart, '函数定位失败')
|
|
921
|
+
const scoreSlice = src.slice(scoreStart, heroStart)
|
|
922
|
+
const outside = src.split('\n').map((line, i) => ({ line, no: i + 1 }))
|
|
923
|
+
.filter(({ line }) => /\bhasText\b/.test(line) && !/^\s*(\/\/|\*)/.test(line))
|
|
924
|
+
.filter(({ no }) => {
|
|
925
|
+
const pos = src.split('\n').slice(0, no - 1).join('\n').length
|
|
926
|
+
return !(pos >= scoreStart && pos < heroStart)
|
|
927
|
+
})
|
|
928
|
+
assert.deepEqual(outside.map((o) => o.no), [], 'hasText 出现在 ScoreHint 之外:' + JSON.stringify(outside))
|
|
929
|
+
})
|
|
930
|
+
}
|
|
931
|
+
|
|
913
932
|
/* -------------------------------- 汇总 -------------------------------- */
|
|
914
933
|
const total = passed + failed
|
|
915
934
|
console.log(`\n自检:${passed}/${total} 通过${failed > 0 ? `,${failed} 失败` : ''}`)
|
|
@@ -919,4 +938,4 @@ if (failed > 0) {
|
|
|
919
938
|
}
|
|
920
939
|
process.exit(1)
|
|
921
940
|
}
|
|
922
|
-
console.log('全绿。覆盖:打分表 16 项 · TASK.md 解析/回写 14 项 · 证据判定 16 项 · 覆盖与防伪造 13 项 · 骨架与返工 4 项 · 跨站 8 项 · 候选排序 7 项 · 客户端打分器对拍 2 项')
|
|
941
|
+
console.log('全绿。覆盖:打分表 16 项 · TASK.md 解析/回写 14 项 · 证据判定 16 项 · 覆盖与防伪造 13 项 · 骨架与返工 4 项 · 跨站 8 项 · 候选排序 7 项 · 客户端打分器对拍 2 项 · 作用域护栏 1 项')
|