@furongjun1999/dsh-memory 0.7.2 → 0.7.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 +57 -47
- package/codebuddy/CODEBUDDY.md +6 -6
- package/docs/README.md +148 -144
- package/docs/discipline/harnesses.yaml +16 -8
- package/docs/discipline/templates/zcode-user.md.tmpl +49 -0
- package/docs/eval/AGI/344/270/203/347/273/264/350/257/204/345/210/206/346/212/245/345/221/212_/345/205/255/345/256/266/350/256/260/345/277/206/347/263/273/347/273/237/345/220/214/345/260/272/345/256/236/346/265/213_v3.1.md +340 -0
- package/docs/eval/N225_/347/264/242/345/274/225/346/227/245/345/277/227/351/235/236/345/257/271/350/261/241/350/243/205/350/275/275/351/235/242/347/261/273/345/236/213/351/227/270_v1.0.md +2 -2
- package/docs/eval/cons200_/345/206/262/347/252/201/346/243/200/346/265/213/351/200/211/351/235/242_/345/256/236/346/226/275/350/256/260/345/275/225_v1.0.md +1 -1
- package/docs/eval/cons200_/345/206/262/347/252/201/346/243/200/346/265/213/351/200/211/351/235/242_/345/256/236/346/226/275/350/256/260/345/275/225_v1.1.md +1 -1
- package/docs/eval/issue43_/351/273/230/350/256/244/347/255/226/347/225/245/344/270/216/351/224/256/347/261/273/345/236/213/351/227/270_v1.1.md +1 -1
- package/docs/eval/issue43_/351/273/230/350/256/244/347/255/226/347/225/245/345/212/240/350/275/275/344/270/216/345/207/255/346/215/256/346/230/216/346/226/207/351/230/237/345/210/227_v1.0.md +2 -2
- package/docs/eval/issue50_/345/205/203/346/225/260/346/215/256/351/200/217/344/274/240/344/270/216/345/205/234/345/272/225_/344/277/256/345/244/215/350/256/260/345/275/225_v1.0.md +5 -5
- package/docs/eval/issue50_/345/215/212/351/207/215/345/244/215/345/276/205/345/256/232/345/244/215/346/240/270_/344/277/256/345/244/215/350/256/260/345/275/225_v1.0.md +9 -9
- package/docs/eval/issue50_/345/276/205/345/256/232/345/244/215/346/240/270/345/205/245/351/230/237_/344/277/256/345/244/215/350/256/260/345/275/225_v1.0.md +4 -4
- package/docs/eval/issue50_/351/207/215/350/246/201/345/272/246/345/220/214/346/272/220/344/270/216/344/277/235/346/212/244/350/257/255/344/271/211_/344/277/256/345/244/215/350/256/260/345/275/225_v1.0.md +1 -1
- package/docs/eval/issue51_/344/270/200/351/224/256/345/256/211/350/243/205/345/244/261/350/264/245_/345/275/222/345/261/236/345/210/244/345/256/232_v1.0.md +1 -1
- package/docs/eval/issue52_/346/235/241/344/273/266/345/205/210/350/241/214/344/270/216/346/210/252/346/226/255/345/217/257/350/247/202/346/265/213_/344/277/256/345/244/215/350/256/260/345/275/225_v1.0.md +3 -3
- package/docs/eval//344/270/211/346/241/243/350/207/252/346/262/273_/346/255/245/351/252/244/342/221/242/345/217/230/346/233/264/345/215/225/344/270/216/345/233/236/346/273/232/345/216/237/350/257/255_/350/220/275/347/240/201/350/256/260/345/275/225_v1.0.md +3 -3
- package/docs/eval//344/270/211/346/241/243/350/207/252/346/262/273_/346/255/245/351/252/244/342/221/243/345/207/206/345/205/245/350/257/273/346/225/260_/350/220/275/347/240/201/350/256/260/345/275/225_v1.0.md +7 -7
- package/docs/eval//344/274/230/345/214/226/347/254/254/344/270/200/346/211/271_/346/216/245/347/272/277/344/270/216/347/255/211/344/273/267/345/217/230/346/215/242_v1.0.md +2 -2
- package/docs/eval//344/274/230/345/214/226/347/254/254/344/270/211/346/211/271_/351/227/250/347/246/201/350/275/254/346/255/243/344/270/216/350/260/203/345/272/246/346/255/242/350/241/200/344/270/216/351/227/250/346/216/247/346/224/266/345/217/243_v1.0.md +1 -1
- package/docs/eval//344/274/230/345/214/226/347/254/254/344/272/214/346/211/271_/344/276/235/350/265/226/351/200/217/344/274/240/344/270/216/345/257/271/346/213/215/345/217/243/345/276/204/344/270/216/350/264/237/347/274/223/345/255/230_v1.0.md +7 -7
- package/docs/eval//345/207/272/350/264/247/351/235/242/345/206/222/347/203/237_/350/277/233/350/264/247/351/227/250/347/246/201_v1.0.md +10 -10
- package/docs/eval//345/217/221/345/270/20307_/345/244/226/351/203/250/346/212/245/345/221/212/345/233/233/346/211/271/344/277/256/345/244/215/344/270/216/346/217/222/344/273/266/351/235/242/345/212/240/345/233/272_v1.0.md +4 -0
- package/docs/eval//345/217/221/345/270/20308_/350/207/252/350/277/255/344/273/243/344/270/216/347/235/241/347/234/240_/345/233/276/346/243/200/347/264/242/350/267/257/344/270/216/346/235/203/351/207/215_v1.0.md +1 -1
- package/docs/eval//345/217/221/345/270/20311_/345/244/226/346/212/245/345/205/255/350/277/236/344/277/256/344/270/216/344/270/226/347/225/214/346/250/241/345/236/213/345/272/225/345/272/247_v1.0.md +91 -0
- package/docs/eval//345/217/221/345/270/20312_/344/270/226/347/225/214/346/250/241/345/236/213/345/212/237/350/203/275/347/253/257_v1.0.md +108 -0
- package/docs/eval//345/275/222/344/270/200/345/261/202/347/274/272/347/234/201/347/277/273/345/205/263_/344/277/256/345/244/215/350/256/260/345/275/225_v1.0.md +2 -2
- package/docs/eval//347/224/250/346/210/267/350/243/201/345/206/263/345/244/204/347/275/256_/347/254/254/344/270/200/346/211/271_v1.0.md +195 -0
- package/docs/eval//347/224/250/346/210/267/350/243/201/345/206/263/345/244/204/347/275/256_/347/254/254/344/272/214/346/211/271B6_/346/234/254/346/234/272/350/267/257/345/276/204/347/233/270/345/257/271/345/214/226_v1.0.md +78 -0
- package/docs/eval//347/253/257/345/210/260/347/253/257LoCoMoQA/345/220/214/345/217/243/345/276/204/345/257/271/347/205/247_v1.0.md +1 -1
- package/docs/eval//347/253/257/345/210/260/347/253/257/345/271/262/346/211/260/346/261/240/350/257/204/346/265/213_/347/241/256/345/256/232/346/200/247/350/243/201/345/206/263vsLLM_judge_v1.1.md +3 -3
- package/docs/eval//347/254/2543/345/261/202stg/347/273/223/346/236/204/347/264/242/345/274/225_/345/256/236/346/226/275/350/256/260/345/275/225_v1.0.md +1 -1
- package/docs/eval//347/274/226/347/240/201/351/235/242/345/211/215/347/275/256_/345/205/245/345/217/243/350/207/252/344/277/235/350/257/201UTF8/344/270/216/346/226/207/346/234/254open/345/256/210/345/215/253_v1.0.md +1 -1
- package/docs/eval//347/274/272/351/231/267/346/214/226/346/216/230_/350/207/252/344/270/273/350/277/255/344/273/243_v26.md +196 -0
- package/docs/eval//347/274/272/351/231/267/346/214/226/346/216/230_/350/207/252/344/270/273/350/277/255/344/273/243_v27.md +259 -0
- package/docs/eval//347/274/272/351/231/267/346/214/226/346/216/230_/350/207/252/344/270/273/350/277/255/344/273/243_v28.md +217 -0
- package/docs/eval//347/274/272/351/231/267/346/214/226/346/216/230_/350/207/252/344/270/273/350/277/255/344/273/243_v29.md +270 -0
- package/docs/eval//347/274/272/351/231/267/346/214/226/346/216/230_/350/207/252/344/270/273/350/277/255/344/273/243_v30.md +231 -0
- package/docs/eval//347/274/272/351/231/267/346/214/226/346/216/230_/350/207/252/344/270/273/350/277/255/344/273/243_v31.md +281 -0
- package/docs/eval//350/257/255/344/271/211/346/227/266/347/251/272/345/233/276/350/241/245/345/205/250_P1_/346/212/275/345/217/226/345/231/250v4_/344/270/211/347/216/207/350/257/273/346/225/260_v1.0.md +231 -0
- package/docs/hive//345/256/211/345/205/250/345/256/241/350/256/241/345/256/236/351/224/232_v0.1.md +1 -1
- package/docs/hive//350/234/202/345/267/242M6_ingest/345/256/236/346/226/275/350/256/241/345/210/222_v0.1.md +1 -1
- package/docs/hive//350/234/202/345/267/242/345/217/214/345/256/236/344/276/213/344/272/222/351/252/214_/350/256/276/350/256/241/345/256/232/347/250/277.md +1 -1
- package/docs/hive//350/234/202/345/267/242/350/256/276/350/256/241_/347/220/206/350/256/272/345/257/271/351/275/220_v0.1.md +17 -17
- package/docs/hive//350/234/202/345/267/242/350/277/255/344/273/243_/345/256/217/350/247/202/344/270/216/347/276/244/344/275/223/350/260/203/345/272/246_v0.1.md +1 -1
- package/docs/mdcg/README/350/257/246/347/273/206/347/211/210_v0.4.10.md +2 -2
- package/docs/mdcg//344/270/226/347/225/214/346/250/241/345/236/213/345/212/237/350/203/275/347/253/257_/344/275/277/347/224/250/344/270/216/350/277/220/347/273/264_v1.0.md +305 -0
- package/docs/mdcg//345/212/237/350/203/275/350/260/203/347/224/250/346/230/240/345/260/204/350/241/250_v0.1.md +45 -42
- package/docs/mdcg//345/217/221/345/270/203/351/227/250/347/246/201/351/223/276_v0.1.md +29 -8
- package/docs/mdcg//347/235/241/347/234/240/345/221/250/346/234/237_/350/277/220/347/273/264/345/211/215/346/217/220/344/270/216/347/273/264/346/212/244/346/214/207/345/215/227_v1.0.md +71 -1
- package/docs/plans//345/205/250/344/270/255/346/226/207/347/274/226/347/240/201/344/270/216/350/234/202/345/267/242/344/273/273/345/212/241/346/240/207/350/257/206/345/245/221/347/272/246_v2.0.md +1 -1
- package/docs/plans//345/244/232/344/270/273/344/275/223/344/270/226/347/225/214/346/250/241/345/236/213_/345/257/271/351/275/220/350/257/204/344/274/260/344/270/216/350/220/275/345/234/260/350/256/276/350/256/241_v0.1.md +141 -0
- package/docs/plans//347/235/241/347/234/240/344/270/216/350/207/252/350/277/255/344/273/243_/345/212/237/350/203/275/344/274/230/345/214/226/350/256/276/350/256/241_v0.4.md +2 -2
- package/docs/plans//350/257/255/344/271/211/346/227/266/347/251/272/345/233/276/350/241/245/345/205/250_/344/270/226/347/225/214/346/250/241/345/236/213/345/212/237/350/203/275/347/253/257_/350/256/276/350/256/241_v0.1.md +107 -0
- package/docs//345/267/245/344/275/234/347/272/252/345/276/213_/350/256/244/347/237/245/345/233/276/346/235/241/347/233/256_v1.1.json +6 -5
- package/docs//347/247/244_/350/256/260/345/277/206/347/263/273/347/273/237/350/257/204/346/265/213/350/247/204/350/214/203_v2.1.md +225 -0
- package/dsh/cordis-patch-profile-web.example.yml +2 -2
- package/lib/bridge.js +9 -0
- package/lib/hooks.d.ts +8 -1
- package/lib/hooks.js +134 -50
- package/lib/lib/hook_audit.d.ts +55 -0
- package/lib/lib/hook_audit.js +208 -0
- package/lib/lib/mutual.js +5 -1
- package/lib/lib/roleplay_web.js +17 -2
- package/lib/lib/session_state.d.ts +56 -0
- package/lib/lib/session_state.js +124 -0
- package/lib/tools.js +12 -1
- package/md_cg/auditview.py +248 -0
- package/md_cg/bench_e2e_judge.py +4 -2
- package/md_cg/branches.py +29 -3
- package/md_cg/consistency.py +38 -13
- package/md_cg/datapath.py +38 -11
- package/md_cg/forgetting.py +15 -2
- package/md_cg/freshness.py +32 -11
- package/md_cg/ghostref.py +130 -0
- package/md_cg/judgment_manifest.py +7 -0
- package/md_cg/lifecycle.py +38 -0
- package/md_cg/mcp_server.py +122 -12
- package/md_cg/mdcg.py +4923 -4822
- package/md_cg/mdcos.py +109 -21
- package/md_cg/nodefile.py +77 -13
- package/md_cg/readcache.py +29 -4
- package/md_cg/selfreport.py +12 -3
- package/md_cg/sleep.py +129 -13
- package/md_cg/sources.py +1 -1
- package/md_cg/state_events.py +131 -0
- package/md_cg/state_slots.py +221 -0
- package/md_cg/stg.py +68 -3
- package/md_cg/sustain.py +1436 -1436
- package/md_cg/test_auditview.py +277 -0
- package/md_cg/test_autonomy_modes.py +2 -1
- package/md_cg/test_boot_openblas_guard.py +197 -0
- package/md_cg/test_ccg_form_parity.py +95 -4
- package/md_cg/test_cons200_scan_selection.py +4 -2
- package/md_cg/test_datapath_device_name.py +62 -3
- package/md_cg/test_generation_guard.py +5 -2
- package/md_cg/test_ghostref.py +182 -0
- package/md_cg/test_interop.py +1 -1
- package/md_cg/test_issue52_scan_condition_first.py +1 -1
- package/md_cg/test_lifecycle_retire_leak.py +408 -0
- package/md_cg/test_lock.py +16 -7
- package/md_cg/test_m3_h9_semantic_guard.py +1 -1
- package/md_cg/test_n230_dirty_replay.py +375 -375
- package/md_cg/test_n238_body_text_parity.py +156 -0
- package/md_cg/test_n276_probe_hoist.py +199 -0
- package/md_cg/test_p4_freshness.py +95 -1
- package/md_cg/test_policy_required_ccg.py +3 -1
- package/md_cg/test_read_face_semantics.py +6 -3
- package/md_cg/test_readcache_prodpath.py +66 -0
- package/md_cg/test_sleep.py +58 -1
- package/md_cg/test_sleep_p1.py +218 -2
- package/md_cg/test_state_event_op.py +514 -0
- package/md_cg/test_state_events.py +178 -0
- package/md_cg/test_state_slots.py +691 -0
- package/md_cg/test_time_core_lint.py +8 -1
- package/md_cg/test_writepipe.py +8 -5
- package/md_cg/tokens.py +18 -2
- package/md_cg/writepipe.py +76 -0
- package/package.json +2 -2
- package/skills/plugin.json +1 -1
- package/src/bridge.ts +9 -0
- package/src/hooks.ts +599 -517
- package/src/lib/hook_audit.ts +243 -0
- package/src/lib/mutual.ts +5 -1
- package/src/lib/roleplay_web.ts +17 -2
- package/src/lib/session_state.ts +127 -0
- package/src/tools.ts +12 -1
- package/zcode/AGENTS.md +6 -6
|
@@ -631,7 +631,9 @@ def g9():
|
|
|
631
631
|
"confidence": 0.8}],
|
|
632
632
|
"subgraph": {"nodes": ["n2"]},
|
|
633
633
|
"valid_from": ts - 100, "valid_until": ts + 100000,
|
|
634
|
-
"effective_from": ts - 100, "effective_until": ts + 100000
|
|
634
|
+
"effective_from": ts - 100, "effective_until": ts + 100000,
|
|
635
|
+
# A1(2026-10-05):检验强度键存活断言(G9f)的夹具值。
|
|
636
|
+
"check_strength": "hoop"},
|
|
635
637
|
body="# 功能名:n1\n# 生效条件:无条件\n# 子功能:无\n"
|
|
636
638
|
"# 执行:无\n# 验证方式:test\n# 不适用条件:无\n\n"
|
|
637
639
|
"上游条件 葡萄 触发。\n")
|
|
@@ -651,6 +653,11 @@ def g9():
|
|
|
651
653
|
for k in ("valid_from", "valid_until", "effective_from", "effective_until"):
|
|
652
654
|
ok(k in e1 and e1.get(k) == e0.get(k),
|
|
653
655
|
"G9d 双时间轴键 %s 存活(trust.validity 免读盘判定面)" % k)
|
|
656
|
+
ok(nodefile.CHECK_STRENGTH_FIELD in e1
|
|
657
|
+
and e1.get(nodefile.CHECK_STRENGTH_FIELD)
|
|
658
|
+
== e0.get(nodefile.CHECK_STRENGTH_FIELD),
|
|
659
|
+
"G9f 检验强度键存活(check_strength,A1 新键;与 G9b–d 同族防漂移,"
|
|
660
|
+
"2026-10-05 复核补)")
|
|
654
661
|
# 端到端:搬迁后因果路仍能经边召到下游(新路不再静默拿不到边)
|
|
655
662
|
# 种子 = 词法命中 n1(上游),目标 n2 词面无重叠 —— 正是因果路的靶区。
|
|
656
663
|
_r, m = cg.search_rrf("葡萄", k=5, record=False, paths=("lexical", "chain"))
|
package/md_cg/test_writepipe.py
CHANGED
|
@@ -135,12 +135,15 @@ def _run(tmp):
|
|
|
135
135
|
"content": "PASSED SKIPME",
|
|
136
136
|
"layer": "knowledge"})
|
|
137
137
|
_check("移除即恢复(核心文件零改动)", out.get("committed") is True, repr(out))
|
|
138
|
-
# 默认 before 链含 linkref→deps→audit→consistency→gated→autonomy
|
|
139
|
-
# (2026-09-19 deps 闸门新增;2026-10-
|
|
140
|
-
#
|
|
141
|
-
#
|
|
138
|
+
# 默认 before 链含 linkref→ghostref→deps→audit→consistency→gated→autonomy
|
|
139
|
+
# (2026-09-19 deps 闸门新增;2026-10-05 A2 幽灵引用闸插 linkref 之后——
|
|
140
|
+
# 消费 ctx["linkref_targets"] 免重解析、永不短路;2026-10-02 三档自治
|
|
141
|
+
# 批次② 档位闸**恒在链尾**——档位判定必须晚于全部既有资格闸,见
|
|
142
|
+
# writepipe._gate_autonomy docstring。断言意图不变:默认链的注册表与执行序
|
|
143
|
+
# = 这一串。)
|
|
142
144
|
_check("单例默认链", singleton.names()["before"]
|
|
143
|
-
== ["linkref", "deps", "audit", "consistency", "gated",
|
|
145
|
+
== ["linkref", "ghostref", "deps", "audit", "consistency", "gated",
|
|
146
|
+
"autonomy"],
|
|
144
147
|
repr(singleton.names()))
|
|
145
148
|
_check("单例默认after链", singleton.names()["after"]
|
|
146
149
|
== ["linkref", "trust"],
|
package/md_cg/tokens.py
CHANGED
|
@@ -90,7 +90,21 @@ ALL_OPS = ("help", "info", "route", "read", "write", "goal", "task", "recent", "
|
|
|
90
90
|
# —— 「这条记忆从哪来 / 谁由它派生」的读面;真源
|
|
91
91
|
# md_cg/provenance.py(find_edges)。**只读 op**:不含任何
|
|
92
92
|
# 写入 path,故读面角色一律放行(与 status 同档)
|
|
93
|
-
"ccg", "status", "edges"
|
|
93
|
+
"ccg", "status", "edges",
|
|
94
|
+
# 路线 C(2026-10-05,多主体世界模型对齐 v0.1 §4):证据审计面
|
|
95
|
+
# audit 只读组装器(现值/出处链/两存备择/盲区/退役史)
|
|
96
|
+
# —— 真源 md_cg/auditview.py;只读、零写路径。角色白名单
|
|
97
|
+
# 缺省不给(fail-closed,新增 op 默认不在任何清单内);
|
|
98
|
+
# 本轮开给:designer(* 自动含)+ verify(证据审计=验证
|
|
99
|
+
# 单元的本职读面,见其 ROLE_SPECS 注释)。
|
|
100
|
+
# P3 新增(世界模型功能端 P3,2026-10-06):
|
|
101
|
+
# state_event 状态事件记账(追加一条五元事件到 append-only 台账)
|
|
102
|
+
# —— 写口;**角色面零新词**:cg 面作用域闸把它映射到既有
|
|
103
|
+
# "write" 词(见 mcp_server._cg_dispatch),各角色
|
|
104
|
+
# ROLE_SPECS.ops_allow 白名单零改动;登记于本表只为
|
|
105
|
+
# 「op 三处同步」契约(ALL_OPS == cg 工具 schema == 分发分支,
|
|
106
|
+
# 见 test_p27/test_p29/test_p30/test_p31 防漏改守卫)。
|
|
107
|
+
"audit", "state_event")
|
|
94
108
|
|
|
95
109
|
|
|
96
110
|
class TokenError(Exception):
|
|
@@ -166,8 +180,10 @@ ROLE_SPECS = OrderedDict([
|
|
|
166
180
|
# 豁免被分型取代(同日裁定迭代)。
|
|
167
181
|
"can_write": True, "can_admin": False, "clearance_cap": "internal",
|
|
168
182
|
"layers_allow": ["rejected", "contextual"],
|
|
183
|
+
# audit(2026-10-05 路线 C):证据审计视图=验证单元的本职读面
|
|
184
|
+
#(现值/出处链/两存备择/盲区/退役史),只读、无写路径。
|
|
169
185
|
"ops_allow": ["info", "route", "read", "write", "verify", "insight",
|
|
170
|
-
"status", "edges"],
|
|
186
|
+
"status", "edges", "audit"],
|
|
171
187
|
"delegable": False,
|
|
172
188
|
"forbidden": ["knowledge/self/anchor 层(不得改被验证内容)",
|
|
173
189
|
"private/secret 密级(restricted 错误处置标记属本职,"
|
package/md_cg/writepipe.py
CHANGED
|
@@ -422,6 +422,45 @@ def _gate_gated(ctx):
|
|
|
422
422
|
return out
|
|
423
423
|
|
|
424
424
|
|
|
425
|
+
# 生效条件:a.get("ghostref") 为 False 时跳过(opt-out,与 linkref=False 同款);否则对 a["content"]
|
|
426
|
+
# 做幽灵引用检测(ghostref.check:短语层 + id 层),结果非空时分别写入 ctx["ghost_phrases"] /
|
|
427
|
+
# ctx["late_refs"] 供链尾执行器落 fm 与出口告警消费;**恒返回 None(永不短路)**——本闸是标记/告警级,
|
|
428
|
+
# 不参与拒收判定。
|
|
429
|
+
def _gate_ghostref(ctx):
|
|
430
|
+
"""幽灵引用闸(before 链:linkref 之后、deps 之前):标记 + 降级告警,**不拒收**。
|
|
431
|
+
|
|
432
|
+
两条防线(对齐评估 v0.1 §2 L1「转引不得升级」;CD-WHALE-01 发现 C):
|
|
433
|
+
① 短语层:回指短语(「上次的/之前的/明明讲过」)且句内无可解析出处
|
|
434
|
+
⇒ ctx["ghost_phrases"] → 落 fm.uncertain_refs(A2 标记面);
|
|
435
|
+
② id 层:引用目标创建时刻晚于本文档声明的生效起点(valid_from/
|
|
436
|
+
effective_from)⇒ ctx["late_refs"] → 出口降级告警(不改建边判定)。
|
|
437
|
+
|
|
438
|
+
为何不短路(与 deps 硬拒的边界):回指是现实写作的常态——「上次的帐篷」
|
|
439
|
+
在对话记忆里天然存在,缺失的是**出处记录**而非内容本身。拒收会把正常
|
|
440
|
+
记忆挡在门外;标记让「出处不确定」这事可见、可裁决(未决不进二值)。
|
|
441
|
+
|
|
442
|
+
为何消费 ctx["linkref_targets"] 而非重算:linkref 是 targets 的唯一
|
|
443
|
+
写入点(同一次解析的两个面);重算会引入「两次解析结果漂移」的可能。
|
|
444
|
+
"""
|
|
445
|
+
a = ctx["a"]
|
|
446
|
+
if a.get("ghostref") is False:
|
|
447
|
+
return None
|
|
448
|
+
from . import ghostref as _ghostref
|
|
449
|
+
# own_from 取显式声明(**is None 判定**:0/空串不做假值跳转——
|
|
450
|
+
# 与 budget_tokens「显式 0 也是显式」同款口径)。
|
|
451
|
+
_own = a.get("valid_from")
|
|
452
|
+
if _own is None:
|
|
453
|
+
_own = a.get("effective_from")
|
|
454
|
+
rep = _ghostref.check(ctx["cg"], a.get("content") or "",
|
|
455
|
+
linkref_targets=ctx.get("linkref_targets"),
|
|
456
|
+
own_from=_own)
|
|
457
|
+
if rep["ghost_phrases"]:
|
|
458
|
+
ctx["ghost_phrases"] = rep["ghost_phrases"]
|
|
459
|
+
if rep["late_refs"]:
|
|
460
|
+
ctx["late_refs"] = rep["late_refs"]
|
|
461
|
+
return None
|
|
462
|
+
|
|
463
|
+
|
|
425
464
|
# 生效条件:ctx["a"]["content"] 的「# 子功能:」行含显式跨节点引用(`@<节点 id>`)且 depends_on 解析为空时返回 ok=False/error="E050" 的终态;depends_on 含库中不存在的 id 时返回 ok=False/error="E051" 的终态;其余(无该行 / 哨兵 / 自然语言自述 / 声明且目标齐备)返回 None 放行;
|
|
426
465
|
def _gate_deps(ctx):
|
|
427
466
|
"""依赖声明闸(before 链:linkref 之后、audit 之前):**硬拒条件缺失**。
|
|
@@ -578,11 +617,38 @@ def _executor(ctx):
|
|
|
578
617
|
depends_on=trust.as_deps(a.get("depends_on")),
|
|
579
618
|
valid_from=a.get("valid_from"), valid_until=a.get("valid_until"),
|
|
580
619
|
verification_state=a.get("verification_state"),
|
|
620
|
+
# A1 补接(2026-10-05,路线 C 动工时经 audit 现值面发现):检验强度
|
|
621
|
+
# 透传。此前 add 层已支持该形参,但**写链实参表漏传**——经 MCP
|
|
622
|
+
# op=write 声明 check_strength 一律静默丢弃(与 B2 sensitivity 漏传
|
|
623
|
+
# 同族:上游声明、落盘面丢字段,比报错难发现)。
|
|
624
|
+
check_strength=a.get("check_strength"),
|
|
625
|
+
# A2 幽灵引用标记(正文属性:每次写入按当次检测重算,不继承——
|
|
626
|
+
# 与 check_strength 的声明继承相反;缺省 None 不落键)。
|
|
627
|
+
uncertain_refs=ctx.get("ghost_phrases") or None,
|
|
581
628
|
**_hyperedge_extra(a))
|
|
582
629
|
out = {"ok": True, "id": ctx["nid"], "committed": True,
|
|
583
630
|
"verdict": ctx["verdict"]}
|
|
584
631
|
if ctx.get("cvd") is not None:
|
|
585
632
|
out["consistency"] = ctx["cvd"]
|
|
633
|
+
# A2 幽灵引用出口(标记/告警级,不改写入语义):短语层标记已随
|
|
634
|
+
# uncertain_refs 落 fm,此处把「值写进了哪里、怎么处置」如实带回。
|
|
635
|
+
if ctx.get("ghost_phrases"):
|
|
636
|
+
from . import nodefile
|
|
637
|
+
_gp = list(ctx["ghost_phrases"])
|
|
638
|
+
out["ghost_refs"] = _gp[:16]
|
|
639
|
+
out["ghost_hint"] = (
|
|
640
|
+
"幽灵引用标记(A2):正文含无可解析出处的回指短语(%s)——"
|
|
641
|
+
"已落 fm.%s(**未拒收**)。若其指代某条既有记忆,请改为可解析引用"
|
|
642
|
+
"(正文写裸 id,写入链自动建 reference 边);确为首次出现时,"
|
|
643
|
+
"该标记即「出处待补」的诚实记录。"
|
|
644
|
+
% ("、".join(_gp[:5]), nodefile.UNCERTAIN_REFS_FIELD))
|
|
645
|
+
if ctx.get("late_refs"):
|
|
646
|
+
out["late_refs"] = list(ctx["late_refs"])[:10]
|
|
647
|
+
out["late_hint"] = (
|
|
648
|
+
"目标晚于自身(A2 降级告警):本文档声明的生效起点早于被引目标的"
|
|
649
|
+
"创建时刻——引用了「当时尚不存在」的目标。边照常建立(linkref 不看"
|
|
650
|
+
"时间轴);请核对两条时间轴:若引用意图成立可忽略,若是回填/转写"
|
|
651
|
+
"产生的时序错觉,请修正 valid_from。")
|
|
586
652
|
# ⑥:直写提示(不改落盘行为、不改 verdict;见本函数开头注释)
|
|
587
653
|
if _prior is not None:
|
|
588
654
|
out["overwrite_of"] = _prior
|
|
@@ -610,6 +676,10 @@ _AUTONOMY_META_KEYS = ("tags", "condition_space", "verification_basis",
|
|
|
610
676
|
"non_applicable_conditions", "derived_from", "relation",
|
|
611
677
|
"depends_on", "valid_from", "valid_until",
|
|
612
678
|
"verification_state", "importance", "importance_source",
|
|
679
|
+
# A1 补接(2026-10-05):检验强度同族入载荷——否则
|
|
680
|
+
# confirm 档出单 → accept 重放会丢该声明(与
|
|
681
|
+
# verification_state 同款的「两条路径元数据不等价」坑)。
|
|
682
|
+
"check_strength",
|
|
613
683
|
"override")
|
|
614
684
|
|
|
615
685
|
|
|
@@ -727,6 +797,12 @@ def install_default_gates(pipe):
|
|
|
727
797
|
"""
|
|
728
798
|
from . import linkref
|
|
729
799
|
pipe.register_before("linkref", linkref.before_hook(), position=0)
|
|
800
|
+
# A2 幽灵引用闸(2026-10-05):插在 linkref 之后——判据 ② 要消费
|
|
801
|
+
# ctx["linkref_targets"](linkref 是 targets 的唯一写入点);判据 ① 的
|
|
802
|
+
# 「句内无可解析出处」与 linkref 同源(同一次检测的两个面)。**永不短路**
|
|
803
|
+
# (标记/告警级,不做拒收——设计稿 v0.1 复核修订:幽灵引用检查器限定
|
|
804
|
+
# 短语层标记;回指是现实写作常态,拒收会把正常记忆挡在门外)。
|
|
805
|
+
pipe.register_before("ghostref", _gate_ghostref, position=1)
|
|
730
806
|
pipe.register_before("deps", _gate_deps)
|
|
731
807
|
pipe.register_before("audit", _gate_audit)
|
|
732
808
|
pipe.register_before("consistency", _gate_consistency)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@furongjun1999/dsh-memory",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "灵枢(Lingshu·líng shū)DeepSeek Harness 插件:完整大脑——长期记忆/知识飞轮/自我认知/递归反思接入 DSH,对话自动沉淀进 md_cg 认知图(md 文档)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"build": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
87
87
|
"test": "npm run build && node --import tsx --test \"test/*.test.ts\"",
|
|
88
88
|
"prepare": "node -e \"const fs=require('fs');const tsc='node_modules/typescript/bin/tsc';fs.existsSync(tsc)?(fs.rmSync('lib',{recursive:true,force:true}),require('child_process').execFileSync(process.execPath,[tsc,'-p','tsconfig.json'],{stdio:'inherit'})):console.log('[prepare] 跳过构建:typescript 未安装(NODE_ENV=production 或 --omit=dev 会省略 devDependencies)——需要构建请用 npm install --include=dev')\"",
|
|
89
|
-
"gate": "python scripts/check_unreachable.py && python scripts/check_publish_artifact.py && python scripts/check_publish_smoke.py && python scripts/cogmap_sync.py check && python scripts/link_check.py && python scripts/workspace_index.py --check && python scripts/verify_discipline.py --allow-missing && python scripts/gate_rust_crate_test.py && python scripts/gate_rust_parity.py",
|
|
89
|
+
"gate": "python scripts/check_unreachable.py && python scripts/check_publish_artifact.py && python scripts/check_publish_smoke.py && python scripts/cogmap_sync.py check && python scripts/link_check.py && python scripts/workspace_index.py --check && python scripts/discipline_nodes.py --init --write --cg-root .tmp/discipline-cg && python scripts/verify_discipline.py --allow-missing --cg-root .tmp/discipline-cg && python scripts/gate_rust_crate_test.py && python scripts/gate_rust_parity.py && python scripts/check_local_paths.py",
|
|
90
90
|
"prepublishOnly": "npm run build && npm test && npm run gate"
|
|
91
91
|
},
|
|
92
92
|
"repository": {
|
package/skills/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "lingshu-skills",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.4",
|
|
5
5
|
"description": "灵枢(AEIS)自我认知技能包——白箱条件化知识(Agent Skills 兼容导出)。本质是灵枢了解自身的工具:每个技能描述灵枢在什么条件下能做什么、怎么执行、克制什么(KCCS 四要素),由条件路由图精确路由,由灵枢 MCP 工具执行验证(物理基底)。",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "灵枢(AEIS)· CommonTrustProtocol"
|
package/src/bridge.ts
CHANGED
|
@@ -310,6 +310,15 @@ export class LingshuBridge {
|
|
|
310
310
|
if (!this.disposed) this.spawnAndHandshake()
|
|
311
311
|
}, 300_000)
|
|
312
312
|
this.retryTimer.unref()
|
|
313
|
+
// N267:冷却路径也必须结算状态面——否则子进程已死而 readyState 停在 'ok',
|
|
314
|
+
// isReady() 恒 true、waitReady() 立即 resolve(true)(该值经 MdcgClient 一行
|
|
315
|
+
// 直通宿主门控,调用错误被空 catch 静默吞 → 状态面失真)。只跳过
|
|
316
|
+
// scheduleRetry(冷却定时器上面已安排重试)。
|
|
317
|
+
// flushBootQueue 与另三处退出结算(spawn error / 常规 exit / 握手失败)同形:
|
|
318
|
+
// 该分支的生产可达态为 ok/failed,bootQueue 此时必为空——属对称防御,
|
|
319
|
+
// 不单独承担判据(行为无可观察差异)。
|
|
320
|
+
this.readyState = 'failed'
|
|
321
|
+
this.flushBootQueue(false)
|
|
313
322
|
return
|
|
314
323
|
}
|
|
315
324
|
// 有挂起请求的失败是异常的;仅启动失败的等待者得到 false
|