dsh-rule-engine 0.6.2 → 0.6.4
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 +178 -7
- package/lib/core/audit.js +21 -4
- package/lib/core/authorization.js +30 -33
- package/lib/core/config.js +4 -1
- package/lib/core/dualtrack-markers.js +61 -0
- package/lib/core/guard-core.js +151 -34
- package/lib/core/intent.js +15 -22
- package/lib/core/lang.js +61 -0
- package/lib/core/lexicon.js +177 -72
- package/lib/core/llm-intent.js +2 -2
- package/lib/core/matcher.js +29 -17
- package/lib/core/measure-kinds.js +127 -0
- package/lib/core/patterns.js +382 -51
- package/lib/core/quality-ledger.js +124 -0
- package/lib/core/state.js +47 -4
- package/lib/core/text-detect.js +126 -68
- package/lib/core/tool-catalog.js +11 -3
- package/lib/core/understander.js +32 -43
- package/lib/index.js +133 -11
- package/lib/messages.js +134 -0
- package/package.json +3 -2
- package/scripts/check-tool-coverage.mjs +3 -1
- package/scripts/dualtrack-check.mjs +481 -0
- package/scripts/dualtrack-whitelist.json +7 -0
- package/scripts/local-residue-scan.mjs +10 -4
- package/scripts/plugins.json +10 -0
- package/scripts/publish-aptitude-check.mjs +5 -2
- package/scripts/release-plugin.mjs +54 -5
- package/scripts/verify-all.mjs +4 -0
- package/scripts/verify-v474.mjs +8 -8
package/scripts/verify-v474.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// verify-v474.mjs - v4.74 记录项引擎在位抽查(分点切分/规则2双检/词表跑)
|
|
2
2
|
import { parseUserIntents } from "../lib/core/intent.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { actionWordsRe } from "../lib/core/lexicon.js";
|
|
4
|
+
import { evidenceMarkRe, timeWordsRe } from "../lib/core/patterns.js";
|
|
5
5
|
|
|
6
6
|
// ① 分点切分(标点后编号——用户"1、问2、问3、跑"同行)
|
|
7
7
|
const mixed = parseUserIntents("1、为什么预算会满?2、检查时间规则?3、跑");
|
|
8
8
|
console.log("分点(同行标点):", mixed.hasExecute && mixed.clauses[2].type === "execute" ? "✅" : "❌");
|
|
9
|
-
// ②
|
|
10
|
-
console.log("词表含跑:",
|
|
11
|
-
// ③ 规则2
|
|
12
|
-
console.log("规则2证据词表:",
|
|
13
|
-
console.log("规则2具体词(昨天):",
|
|
14
|
-
console.log("规则2模糊词(之前):",
|
|
9
|
+
// ② 词表补跑(P8 小批 A 起词表经函数取;本机需 lexicons 配置注入中文词表)
|
|
10
|
+
console.log("词表含跑:", actionWordsRe().test("跑") ? "✅" : "❌");
|
|
11
|
+
// ③ 规则2双检:证据锚、具体时间词(P8 小批 B 起经访问器取;本机需 patterns 配置注入中文表)
|
|
12
|
+
console.log("规则2证据词表:", evidenceMarkRe().test("日志 ts=2026-08-27T15:21:05Z") ? "✅" : "❌");
|
|
13
|
+
console.log("规则2具体词(昨天):", timeWordsRe().test("昨天") ? "✅" : "❌");
|
|
14
|
+
console.log("规则2模糊词(之前):", timeWordsRe().test("之前") ? "❌(应不命中)" : "✅(不命中)");
|