@furongjun1999/dsh-memory 0.9.8 → 0.9.9
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 +1 -1
- package/codebuddy/CODEBUDDY.md +4 -0
- package/docs/README.md +3 -0
- package/docs//350/247/204/350/214/203/AI/347/274/226/347/250/213/351/200/232/347/224/250/350/247/204/350/214/203.md +4 -0
- package/dsh/cordis.yml.example +2 -2
- package/lib/hooks.d.ts +11 -1
- package/lib/hooks.js +58 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/init.js +11 -2
- package/lib/lib/hook_audit.d.ts +3 -0
- package/lib/lib/hook_audit.js +37 -0
- package/md_cg/autonomy.py +1 -1
- package/md_cg/config_registry.py +329 -329
- package/md_cg/config_registry_bulk.py +483 -482
- package/md_cg/config_render.py +27 -0
- package/md_cg/config_validate.py +456 -455
- package/md_cg/conflict_surface.py +127 -0
- package/md_cg/mcp_server.py +5324 -5227
- package/md_cg/mdcg.py +12 -1
- package/md_cg/mdcos.py +7159 -7108
- package/md_cg/pooling.py +487 -485
- package/md_cg/qmd_llm.py +334 -334
- package/md_cg/reach.py +10 -4
- package/md_cg/sleep.py +2 -2
- package/md_cg/sustain.py +3 -3
- package/md_cg/test_auto_defaults.py +463 -463
- package/md_cg/test_autonomy_emotion.py +328 -328
- package/md_cg/test_bm25_default.py +56 -0
- package/md_cg/test_c3_transient_read_negative.py +7 -3
- package/md_cg/test_conflict_surface.py +75 -0
- package/md_cg/test_conflict_value_untrusted.py +63 -0
- package/md_cg/test_exact_text_cache.py +194 -191
- package/md_cg/test_hotcache_tool.py +121 -0
- package/md_cg/test_issue274_read_node_id_none.py +364 -341
- package/md_cg/test_issue561_pending_review.py +89 -5
- package/md_cg/test_issue578_service_info_gate.py +264 -0
- package/md_cg/test_p3_legacy_closure.py +441 -438
- package/md_cg/test_p43_pooling.py +419 -412
- package/md_cg/test_reach.py +5 -1
- package/md_cg/test_reach_exits.py +54 -0
- package/md_cg/test_reach_single_char.py +74 -0
- package/md_cg/test_search_bm25_default.py +60 -0
- package/md_cg/test_sleep_p1.py +1032 -1032
- package/md_cg/test_untrusted_audit.py +55 -0
- package/md_cg/test_untrusted_classifier.py +42 -0
- package/md_cg/test_untrusted_enforcement.py +66 -0
- package/md_cg/untrusted.py +45 -0
- package/md_cg/untrusted_audit.py +87 -0
- package/md_cg/value_conflict.py +71 -0
- package/package.json +7 -7
- package/src/hooks.ts +59 -5
- package/src/index.ts +2 -2
- package/src/init.ts +7 -2
- package/src/lib/hook_audit.ts +32 -0
- package/zcode/AGENTS.md +4 -0
package/md_cg/config_render.py
CHANGED
|
@@ -39,6 +39,22 @@ ENUMS = {
|
|
|
39
39
|
_ENV_SLEEP_MERGE: tuple(_sl.SLEEP_MERGE_MODES),
|
|
40
40
|
"IMGSKILL_BACKEND": ("auto", "magick", "pillow"),
|
|
41
41
|
"MDCG_SCORE_MODE": ("legacy", "jaccard"),
|
|
42
|
+
"MDCG_EN_ATOMS": ("norm", "raw"),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#: 源码只认 "1" 为真值的 env 开关(人工核验:读点是 `os.environ.get(X) == "1"`,
|
|
46
|
+
#: 因此 "true"/"yes"/"on" 在运行时不生效;校验器必须按同口径拒收,避免「报合法但实际关」。
|
|
47
|
+
TRUE_LITERALS = {
|
|
48
|
+
"MDCG_RETRIEVAL_PIPELINE": ["1"],
|
|
49
|
+
"MDCG_SEMANTIC": ["1"],
|
|
50
|
+
"MDCG_UNIFY_QUERY": ["1"],
|
|
51
|
+
"MDCG_REACH": ["1"],
|
|
52
|
+
"MDCG_REACH_DIFFUSE": ["1"],
|
|
53
|
+
"MDCG_HOTCACHE": ["1"],
|
|
54
|
+
"MDCG_QMD_SYS": ["1"],
|
|
55
|
+
"MDCG_PROPOSAL_EMOTION": ["1"],
|
|
56
|
+
"MDCG_POOLING": ["1"],
|
|
57
|
+
"MDCG_READ_CACHE": ["1"],
|
|
42
58
|
}
|
|
43
59
|
|
|
44
60
|
#: 明显带值域约束的数值参数(**人工核验**,取自源码夹取/断言;未列者不约束)。
|
|
@@ -177,6 +193,15 @@ def _rule_for(e):
|
|
|
177
193
|
elif e.get("semantic") in ("on", "off", "fail-open"):
|
|
178
194
|
r["type"] = "bool"
|
|
179
195
|
r["bool_like"] = True
|
|
196
|
+
# env_flag 的源码口径恒为 `os.environ.get(X) == "1"`(只认 "1" 为真):
|
|
197
|
+
# 若只给 bool_like 宽词表,校验器会认 "true" 而运行时实际是关(issue #138 同型)。
|
|
198
|
+
if r.get("type") == "bool" and (e.get("anchor") or {}).get("how") == "env_flag":
|
|
199
|
+
r["true_literals"] = ["1"]
|
|
200
|
+
|
|
201
|
+
if name in TRUE_LITERALS:
|
|
202
|
+
r["type"] = "bool"
|
|
203
|
+
r["bool_like"] = True
|
|
204
|
+
r["true_literals"] = list(TRUE_LITERALS[name])
|
|
180
205
|
# ①b 域带枚举("enum:a|b")⇒ 枚举约束(覆盖 semantic 推出的布尔;issue #138 · EN_ATOMS)
|
|
181
206
|
if dom.startswith("enum:"):
|
|
182
207
|
r["type"] = "str"
|
|
@@ -187,6 +212,8 @@ def _rule_for(e):
|
|
|
187
212
|
if name in ENUMS:
|
|
188
213
|
r["type"] = "str"
|
|
189
214
|
r["enum"] = list(ENUMS[name])
|
|
215
|
+
r.pop("bool_like", None) # 枚举键不该再接受 "1"/"true" 当合法值
|
|
216
|
+
r.pop("true_literals", None)
|
|
190
217
|
# ③ 已知数值值域 → 数值类型 + 上下限
|
|
191
218
|
if name in RANGES:
|
|
192
219
|
lo, hi, t = RANGES[name]
|