@furongjun1999/dsh-memory 0.9.22 → 0.10.1
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/CHANGELOG.en.md +450 -0
- package/CHANGELOG.md +112 -0
- package/README.en.md +244 -0
- package/README.md +272 -260
- package/codebuddy/CODEBUDDY.md +1 -1
- package/docs/README.md +2 -0
- package/docs/discipline/templates/full.md.tmpl +1 -1
- package/docs/discipline/templates/rules.mdc.tmpl +1 -1
- package/docs/en/README.md +190 -0
- package/docs/en/TRANSLATION.md +78 -0
- package/docs/en/TRANSLATION_MANIFEST.json +170 -0
- package/docs/en/TRANSLATION_REPORT.md +11 -0
- package/docs/en/dev/README.md +10 -0
- package/docs/en/dev/coding-testing.md +72 -0
- package/docs/en/dev/switch-matrix.md +10 -0
- package/docs/en/glossary.md +97 -0
- package/docs/en/harnesses/claude.md +100 -0
- package/docs/en/harnesses/codebuddy.md +93 -0
- package/docs/en/harnesses/codex.md +88 -0
- package/docs/en/harnesses/dsh.md +84 -0
- package/docs/en/harnesses/zcode.md +42 -0
- package/docs/en/mdcg/ccg.md +32 -0
- package/docs/en/mdcg/generated-docs.md +20 -0
- package/docs/en/mdcg/guardrail-charter.md +170 -0
- package/docs/en/mdcg/mcp-tool-names.md +43 -0
- package/docs/en/mdcg/multi-harness.md +43 -0
- package/docs/en/mdcg/recall-metadata.md +30 -0
- package/docs/en/mdcg/world-model-endpoint.md +379 -0
- package/docs/en/mdcg/write-aliases.md +130 -0
- package/docs/en/ops/README.md +11 -0
- package/docs/en/ops/environment-known-issues.md +244 -0
- package/docs/en/ops/install.md +72 -0
- package/docs/en/ops/operations-troubleshooting.md +86 -0
- package/docs/en/ops/permissions-review.md +79 -0
- package/docs/en/ops/release-governance.md +49 -0
- package/docs/en/ops/tool-name-migration.md +30 -0
- package/docs/en/ops/ui-install-troubleshooting.md +53 -0
- package/docs/en/standards/ai-coding-standard-checklist.md +71 -0
- package/docs/en/standards/ai-coding-standard-lingshu.md +47 -0
- package/docs/en/standards/ai-coding-standard.md +185 -0
- package/docs/en/ui/minimal.md +62 -0
- package/docs/mdcg/cogmap_ops.md +16 -15
- package/lib/client.js +29 -3
- package/lib/hooks.d.ts +34 -0
- package/lib/hooks.js +167 -33
- package/lib/index.js +19 -3
- package/lib/lib/console_web.mjs +30 -3
- package/lib/lib/hook_audit.d.ts +3 -2
- package/lib/lib/hook_audit.js +14 -4
- package/lib/lib/mdcg_client.d.ts +5 -2
- package/lib/lib/mdcg_client.js +8 -4
- package/lib/lib/prompt_safety.d.ts +24 -0
- package/lib/lib/prompt_safety.js +77 -1
- package/lib/lib/token_store.js +5 -2
- package/lib/tools.js +5 -3
- package/md_cg/bucketindex.py +231 -0
- package/md_cg/bucketscope.py +339 -0
- package/md_cg/config_registry_bulk.py +19 -10
- package/md_cg/config_validate.py +14 -2
- package/md_cg/detrerank.py +137 -0
- package/md_cg/fsutil.py +215 -25
- package/md_cg/govern/__init__.py +23 -0
- package/md_cg/iface/__init__.py +46 -0
- package/md_cg/iface/_verify.py +609 -0
- package/md_cg/iface/contracts.py +337 -0
- package/md_cg/judgment_manifest.py +14 -0
- package/md_cg/kernel/__init__.py +27 -0
- package/md_cg/mcp_server.py +457 -23
- package/md_cg/mdcg.py +1034 -79
- package/md_cg/mdcos.py +263 -21
- package/md_cg/metacognition.py +66 -13
- package/md_cg/mutate_extract_shipped.py +126 -0
- package/md_cg/mutate_ledger_e2e.py +100 -0
- package/md_cg/nodefile.py +147 -23
- package/md_cg/op_table.py +22 -4
- package/md_cg/probe_c_ledger_integrity.py +258 -0
- package/md_cg/probe_d_retirement_discipline.py +263 -0
- package/md_cg/reconcile.py +9 -11
- package/md_cg/review_cli.py +6 -1
- package/md_cg/rollback.py +16 -1
- package/md_cg/run_tests.py +30 -1
- package/md_cg/scopeselect.py +214 -0
- package/md_cg/scrub.py +160 -23
- package/md_cg/security.py +4 -2
- package/md_cg/state_extract.py +149 -0
- package/md_cg/state_slots.py +58 -10
- package/md_cg/structboost.py +179 -0
- package/md_cg/test_alternatives_historical.py +162 -0
- package/md_cg/test_b2_sensitivity_landing.py +226 -223
- package/md_cg/test_b3_merge_keeps_content.py +608 -583
- package/md_cg/test_bucket_cards.py +85 -0
- package/md_cg/test_bucket_day_order.py +74 -0
- package/md_cg/test_bucket_quota.py +79 -0
- package/md_cg/test_bucket_recency_guards.py +75 -0
- package/md_cg/test_bucket_three_causes.py +83 -0
- package/md_cg/test_bucketindex.py +130 -0
- package/md_cg/test_bucketscope_early.py +71 -0
- package/md_cg/test_cond_term_fold.py +183 -0
- package/md_cg/test_cond_term_fold_gate.py +1210 -0
- package/md_cg/test_cond_term_neg_scope.py +147 -0
- package/md_cg/test_cond_terms_colon.py +348 -0
- package/md_cg/test_detrerank.py +157 -0
- package/md_cg/test_gate_four_kpi.py +136 -0
- package/md_cg/test_generation_guard.py +76 -43
- package/md_cg/test_issue192_move_layer_indices_guard.py +48 -0
- package/md_cg/test_issue362_neg_condition.py +44 -7
- package/md_cg/test_issue39_utf8_stdio.py +572 -572
- package/md_cg/test_issue413_preimage_failclosed.py +147 -9
- package/md_cg/test_issue444_scrub_evidence_plaintext.py +14 -8
- package/md_cg/test_issue677_flush_batch_io.py +139 -0
- package/md_cg/test_issue677_info_fast.py +82 -0
- package/md_cg/test_issue677_remember_dedupe.py +106 -0
- package/md_cg/test_issue712_tokens_sessions_read.py +199 -0
- package/md_cg/test_issue722_strict_conditions.py +96 -0
- package/md_cg/test_issue730_narrowing_audit.py +121 -0
- package/md_cg/test_issue733_verify_override.py +193 -0
- package/md_cg/test_issue733_verify_override_and_overwrite_inherit.py +315 -0
- package/md_cg/test_issue740_filelock_fd_leak.py +218 -0
- package/md_cg/test_issue741_content_hash_same_source.py +158 -0
- package/md_cg/test_issue747_slot_contradiction.py +125 -0
- package/md_cg/test_issue754_nested_root_guard.py +197 -0
- package/md_cg/test_issue757_index_hash_compare.py +85 -0
- package/md_cg/test_issue758_disk_hash_single.py +67 -0
- package/md_cg/test_issue759_twophase_hash.py +67 -0
- package/md_cg/test_issue768_overwrite_time_window_anchor.py +135 -0
- package/md_cg/test_issue789_log_plaintext_probe.py +100 -0
- package/md_cg/test_issue790_verb_negation.py +77 -0
- package/md_cg/test_issue810_root_guard.py +71 -0
- package/md_cg/test_issue812_info_index_stale.py +78 -0
- package/md_cg/test_issue827_weaken_dedup.py +361 -0
- package/md_cg/test_issue829_calibration_positive_gate.py +473 -0
- package/md_cg/test_kernel_iface_contracts.py +18 -0
- package/md_cg/test_md_cg_no_hive_dep.py +238 -17
- package/md_cg/test_n204_n205_n226_n227_n228_n229_exit_gates.py +545 -542
- package/md_cg/test_n209_verify_write_face_gates.py +5 -2
- package/md_cg/test_neg_condition_hits.py +336 -333
- package/md_cg/test_probe_cd_shipped.py +385 -0
- package/md_cg/test_recent_tail.py +93 -0
- package/md_cg/test_run_tests_entry_gates.py +110 -0
- package/md_cg/test_scopeselect.py +70 -0
- package/md_cg/test_scopeselect_clock.py +70 -0
- package/md_cg/test_scrub_source_line_false_positive.py +64 -0
- package/md_cg/test_session_attribution_consistency.py +835 -813
- package/md_cg/test_state_extract_shipped.py +162 -0
- package/md_cg/test_state_ledger_chain.py +207 -0
- package/md_cg/test_state_ledger_e2e.py +145 -0
- package/md_cg/test_structboost.py +102 -0
- package/md_cg/test_timeboost.py +83 -0
- package/md_cg/test_timeboost_relativedate.py +71 -0
- package/md_cg/test_topicagg.py +129 -0
- package/md_cg/test_twophase.py +286 -286
- package/md_cg/timeboost.py +223 -0
- package/md_cg/tokens.py +55 -7
- package/md_cg/topicagg.py +142 -0
- package/md_cg/twophase.py +15 -6
- package/md_cg/whitebox_kb/wisdom/code_compose.py +33 -5
- package/md_cg/whitebox_kb/wisdom/compose_engine.py +5 -1
- package/md_cg/whitebox_kb/wisdom/role_compose.py +271 -268
- package/md_cg/writepipe.py +35 -3
- package/package.json +4 -1
- package/scripts/workspace_index.py +2 -0
- package/src/hooks.ts +182 -34
- package/src/index.ts +19 -3
- package/src/lib/console_web.mjs +30 -3
- package/src/lib/hook_audit.ts +15 -5
- package/src/lib/mdcg_client.ts +8 -4
- package/src/lib/prompt_safety.ts +73 -1
- package/src/lib/token_store.ts +5 -2
- package/src/tools.ts +5 -3
- package/ui/minimal/integrity.json +2 -2
- package/ui/minimal/payload/build-ui.mjs +41 -2
- package/ui/minimal/payload/lib/client.js +29 -3
- package/ui/minimal/payload/lib/lib/console_web.mjs +30 -3
- package/ui/minimal/payload/src/lib/console_web.mjs +30 -3
- package/ui/minimal/payload/web/app.js +3 -1
- package/ui/minimal/payload/web/client.js +30 -3
- package/web/app.js +3 -1
- package/web/client.js +30 -3
- package/zcode/AGENTS.md +1 -1
package/CHANGELOG.en.md
ADDED
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
> **Languages:** [中文](CHANGELOG.md) · English
|
|
2
|
+
|
|
3
|
+
# Changelog (CHANGELOG)
|
|
4
|
+
|
|
5
|
+
This file is maintained since **0.9.15**. For earlier versions see the git tags (`v0.9.6` … `v0.9.14`) and GitHub Releases.
|
|
6
|
+
|
|
7
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/); version numbers follow semantic versioning.
|
|
8
|
+
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
## [0.10.1] - 2026-11-11
|
|
12
|
+
|
|
13
|
+
### Time-retrieval fixes (#849 / #850 / #851 / #852 / #853 / #855 / #858 / #859)
|
|
14
|
+
|
|
15
|
+
- Relative-date parsing extended: 3 days ago / last Wednesday / last week / last month (incl. Chinese numerals).
|
|
16
|
+
- `pick_scopes(now=)` logical clock injection; `recall(now=)` threaded through (external harnesses no longer fall back to the real clock).
|
|
17
|
+
- `_pick` hit-suppression fix: matching nodes first, then fill by recency (an anchor inside the bucket no longer vanishes).
|
|
18
|
+
- Three parallel causes: early-intent session quota 4→2 (days get 6), buckets without term overlap also filled, evidence-first pool generation.
|
|
19
|
+
- Readings: anchor coverage **41.2% -> 83.2%**, stable set **52 -> 55** (two arms x two repeats, zero jitter).
|
|
20
|
+
- Three-column table: anchor-in & correct 50 / anchor-in & wrong 19 / not-all-in & correct 5 / not-in & wrong 1.
|
|
21
|
+
- Boundaries: on-vs-off is -1 (55 vs 56) because the answer-side fix lifted both arms; 714 was not fully re-run.
|
|
22
|
+
|
|
23
|
+
## [0.10.0] - 2026-11-10
|
|
24
|
+
|
|
25
|
+
### Added: scope selection (`scopeselect`) — state-tracking anchors become the bucket-order standard (#844 / #847)
|
|
26
|
+
|
|
27
|
+
- **Criterion change**: bucket order is no longer "which text looks more like the query" but "do these values co-occur in the same time bucket". False statements carry an element from another chapter, so co-occurrence voting is immune to that trap.
|
|
28
|
+
- **Bucket term table + text skeleton**: `_bucketterms.json` (terms/df) and `_bucketskel.json` (skeleton, 600 chars/node, 20k chars/bucket) are written during bucket build; queries only do dictionary math.
|
|
29
|
+
- **Declaration first**: an explicit session or date is used as the scope directly; co-occurrence inference runs only when nothing is declared.
|
|
30
|
+
- **Switches**: `MDCG_SCOPE_SELECT` (default 1; 0 falls back to "most recent first") and `MDCG_SCOPESEL_COOC` (default 1; 0 uses the idf fallback path).
|
|
31
|
+
- **Readings (bench rubric92, 552 assertions, pure deterministic)**: cited-chapter top-1 **97.83%**, top-3 **99.82%**; ablation (chapter number removed) identical ⇒ no dependence on the chapter literal. idf path control: 35.33%.
|
|
32
|
+
- **Main-library cost**: full rebuild of 34k nodes in 53 s; `_bucketskel.json` 5.72 MB, `_bucketterms.json` 21.09 MB; first query 0.64 s (load), then 0.00–0.01 s.
|
|
33
|
+
|
|
34
|
+
### Added: daily automatic bucket-index rebuild (#838)
|
|
35
|
+
|
|
36
|
+
- Triggered by `cg(op=info)`; `_bucketindex_meta.json` records the last rebuild and only rebuilds after `MDCG_BUCKET_INTERVAL_H` (default 20 h); daemon thread with a module-level re-entrancy guard, never blocking info.
|
|
37
|
+
- `bucket_auto` (rebuilt / reason / age_h) is surfaced in the info payload for auditing; `MDCG_BUCKET_AUTO=0` disables it.
|
|
38
|
+
|
|
39
|
+
### Fixed: bucket recall dropped the newest entry (#842)
|
|
40
|
+
|
|
41
|
+
- `_pick` used to sort by `(-hits, nid)` and truncate to cap before applying recency; with 9 equally matching records and cap=8 the entry dropped by id order could be the newest one.
|
|
42
|
+
- Now the sort key includes recency **before** truncation, `(-hits, recency, nid)`, so truncation keeps the newest among equal hits.
|
|
43
|
+
|
|
44
|
+
### Fixed: `validity=True` exclusions were re-added by bucket recall (#843)
|
|
45
|
+
|
|
46
|
+
- Bucket recall appends after candidate retrieval and previously neither received `validity` nor reused the expiry test.
|
|
47
|
+
- Now `_pick` filters expired nodes at the source (only `frontmatter.valid_until`; unparsable values are not treated as expired), threaded through `scope_recall` / `day_scope` / `session_scope`.
|
|
48
|
+
|
|
49
|
+
### Fixed: scrub idempotency / review_cli durability / bench measurement period (#827 / #831 / #832; PR #839 / #840 / #841)
|
|
50
|
+
|
|
51
|
+
- `_weaken` de-duplication now follows the node itself (the old test read a per-round-empty `_scrub.jsonl` in the shadow worktree; measured 407 negative evidences with only 83 distinct, one key recorded 52 times).
|
|
52
|
+
- `review_cli` is constructed with `async_flush=False`, so "visible on any exit path" holds again.
|
|
53
|
+
- `bench_swarm_parallel` measurement period moved out of the scheduler-noise band.
|
|
54
|
+
|
|
55
|
+
## [0.9.23] - 2026-11-05
|
|
56
|
+
|
|
57
|
+
### Fixed: `cg(op=read)` returned DEFER for natural phrasing (issue #722, Q1=A / Q2=A)
|
|
58
|
+
|
|
59
|
+
- `judge_qualification` gains `strict_conditions` (library default `true`, no change for existing callers); **the tool face (`read`/`route`) defaults to relaxed**;
|
|
60
|
+
- relaxation stops at `usable`: `state` stays `DEFER`, with new `usable/relaxed/code/condition_status`; the reason says explicitly that nothing was "confirmed";
|
|
61
|
+
- **only the "condition not confirmed in context" branch** is relaxed; bad conditions / `REJECT` / `BLINDSPOT` / verification basis still block;
|
|
62
|
+
- `judge_with_boundary` now keeps those four marker keys (previously pruned, so a relaxed result was invisible).
|
|
63
|
+
|
|
64
|
+
### Fixed: `cg(op=info)` timed out on large libraries (issue #677 B)
|
|
65
|
+
|
|
66
|
+
- `health_os()` (full-library scan) now runs **only with `full=true`**; new `flush_state` (`pending_dirty/worker_alive/last_error`) and `node_count`;
|
|
67
|
+
- **contract change**: the default response no longer carries the health_os keys (`buckets`, `bucket_scope`, `ccg_by_layer`, ...); pass `full=true` for the old set.
|
|
68
|
+
|
|
69
|
+
### Fixed: write succeeded but the call timed out, and retries duplicated nodes (issue #677)
|
|
70
|
+
|
|
71
|
+
- `mdcg_remember` supports `dedupe` (same idempotency gate as `cg(op=write)`); **the plugin's three automatic memory kinds now send `dedupe: true`**, disable with `memory.dedupe=false`;
|
|
72
|
+
- the server gate is now **session-scoped**: the same text written by two sessions no longer collapses (and with `sessionPrivate` it no longer "hits but reads nothing").
|
|
73
|
+
|
|
74
|
+
### Performance: flush I/O under lock from O(N) to O(1) (issue #677 C)
|
|
75
|
+
|
|
76
|
+
- `ShardedLog.append_many`: **one write + one flush**, still inside a single `FileLock`;
|
|
77
|
+
- two crash-safety fixes: **torn-tail repair** (append a `\n` if the shard ends mid-line) and **backfill keeps the `superseded` set** (otherwise stale records are resurrected = old overwrites new).
|
|
78
|
+
|
|
79
|
+
### Fixed: `FileLock.__enter__` leaked a file descriptor on error paths (issue #740)
|
|
80
|
+
|
|
81
|
+
- strict timeout / non-retryable errno / bad `timeout` type / `KeyboardInterrupt` during sleep all go through `_close_fd()` now; `__exit__` reuses it (idempotent, never raises), re-entry closes the old handle first.
|
|
82
|
+
|
|
83
|
+
### One true source per fingerprint
|
|
84
|
+
|
|
85
|
+
- `reconcile._disk_hashes` collapsed to a single value (#758);
|
|
86
|
+
- `twophase` fingerprints now match index entries (#759, `_norm` demoted to legacy compatibility);
|
|
87
|
+
- verification-state inheritance compares the index `content_hash` instead of reading from disk (#757, removes the #352 §B detour).
|
|
88
|
+
|
|
89
|
+
### Fixed: scrub treated inline source references as assertable key/value pairs
|
|
90
|
+
|
|
91
|
+
- a key containing bracket punctuation is not a field name; values starting with `src_/ref_/doc_` are not assertable values;
|
|
92
|
+
- **note**: for `...(source: src_x)` the real culprit is the bracketed prefix key, not the single character "source" (that one is filtered by the length gate).
|
|
93
|
+
|
|
94
|
+
### Known limitations
|
|
95
|
+
|
|
96
|
+
- `cg(op=recall)` (budgeted packing path) does not thread `strict_conditions` yet;
|
|
97
|
+
- `health_os()` itself is not optimised, only moved off the default path;
|
|
98
|
+
- scrub's `contradiction` still compares literal key/value pairs; semantic rewrites are only reduced, not eliminated.
|
|
99
|
+
## [0.9.21] - 2026-10-31
|
|
100
|
+
|
|
101
|
+
### Fix: standard documents are **shipped with the package** (0.9.20 only gave external links)
|
|
102
|
+
|
|
103
|
+
The 0.9.20 approach was "give GitHub absolute links in the README" - it solved "you know it exists", but **not "you can read it after installing"**.
|
|
104
|
+
|
|
105
|
+
**This release puts the 7 standards that users should follow or check into the `files` allowlist**:
|
|
106
|
+
|
|
107
|
+
| File | Purpose |
|
|
108
|
+
|---|---|
|
|
109
|
+
| `docs/mdcg/写入别名aliases规范_v0.6.md` | **How to add `aliases` when writing memory** (capability added in 0.9.19) |
|
|
110
|
+
| `docs/mdcg/CCG六要素编译.md` | How to write the six elements |
|
|
111
|
+
| `docs/mdcg/guardrail-charter.md` | Guardrail Charter (the public act) |
|
|
112
|
+
| `docs/mdcg/MCP工具名口径_v1.0.md` | Tool name measurement basis |
|
|
113
|
+
| `docs/mdcg/recall_metadata.md` | Recall metadata |
|
|
114
|
+
| `docs/mdcg/世界模型功能端_使用与运维_v1.0.md` | World model endpoint usage and operations |
|
|
115
|
+
| `docs/mdcg/cogmap_ops.md` | cogmap operations |
|
|
116
|
+
|
|
117
|
+
⇒ After installing the package, these 7 files are directly readable under `node_modules/@furongjun1999/dsh-memory/docs/mdcg/`. The documentation map links in the README also changed back to **package-relative paths**.
|
|
118
|
+
|
|
119
|
+
### Why not package the whole directory
|
|
120
|
+
|
|
121
|
+
`docs/mdcg/` has **47 .md files** in total, mixed with internal records (`release_v0.3.0.md`, `CSRE_索引与负条件修复_20261012.md`, the various `plans_*`, `D_meta_工程化方案`, and so on).
|
|
122
|
+
**Packaging the whole directory would ship the internal records too**, so 7 files were picked individually.
|
|
123
|
+
|
|
124
|
+
### Still not packaged (explicit boundary)
|
|
125
|
+
|
|
126
|
+
- `docs/theory/` (19 files, internal theory)
|
|
127
|
+
- `docs/eval/` (136 files, internal evaluation)
|
|
128
|
+
- `docs/plans/` (25 files, internal plans)
|
|
129
|
+
- `docs/ops/` (8 files, installation and operations - the README already has relative links, but they **still cannot be opened on the npm page**; an existing problem)
|
|
130
|
+
|
|
131
|
+
## [0.9.20] - 2026-10-31
|
|
132
|
+
|
|
133
|
+
### Fix: visibility of standard documents (an oversight in 0.9.19)
|
|
134
|
+
|
|
135
|
+
The 0.9.19 CHANGELOG said "full standard: `docs/mdcg/写入别名aliases规范_v0.6.md`",
|
|
136
|
+
**but `docs/mdcg/` was never in the npm package `files` allowlist** ⇒ that was a **dead link inside the package**; users could not find it even after installing.
|
|
137
|
+
|
|
138
|
+
**Fixes in this release**:
|
|
139
|
+
|
|
140
|
+
| Surface | Change |
|
|
141
|
+
|---|---|
|
|
142
|
+
| `README.md` · documentation map | Added a row "**Write standards**", linked via **GitHub absolute URLs** to "Write aliases", "CCG six-element compilation", and "Guardrail Charter", with an **explicit note that "these are not in the npm package"** |
|
|
143
|
+
| `CHANGELOG.md` · 0.9.19 section | Dead links changed to GitHub URLs, with the note "not in the npm package, read them in the repository" |
|
|
144
|
+
|
|
145
|
+
⚠️ **Why not relative paths**: the existing links in the README are all relative paths (`docs/ops/README.md` etc.),
|
|
146
|
+
and they **equally cannot be opened on the npm package page** - so everything newly added uses absolute URLs.
|
|
147
|
+
|
|
148
|
+
> This is an old problem between the "packaging allowlist" and "documentation pointers": `docs/mdcg/` has 47 .md files,
|
|
149
|
+
> some of them standards users should follow (`写入别名aliases`, `CCG六要素编译`, `guardrail-charter`),
|
|
150
|
+
> and some internal records (`release_v0.3.0`, `CSRE_索引与负条件修复`, the various `plans`).
|
|
151
|
+
> **Packaging the whole directory would ship the internal records too**, so this time the choice was "no packaging + absolute links in the README".
|
|
152
|
+
|
|
153
|
+
## [0.9.19] - 2026-10-31
|
|
154
|
+
|
|
155
|
+
### Added: `aliases` (write aliases) - the fix for natural phrasing that recall cannot reach
|
|
156
|
+
|
|
157
|
+
**Usage**: when writing memory, add `aliases` to the node and put in the phrasings for "how users might ask about this later".
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
cg(op="write", node_id="...", content="""# 功能名:会话交接前的记忆固化
|
|
161
|
+
# 生效条件:聊交接、换会话、压缩、或他流露舍不得时
|
|
162
|
+
...""",
|
|
163
|
+
aliases=["换掉", "被换", "别消失", "舍不得", "不想你走", "压缩上下文"])
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
`aliases` **participates in lexical recall but does not go into `tags`** - `tags` is occupied by machine criteria ("is this a task card", "can this be an anchor"),
|
|
167
|
+
and mixing them would change those criteria.
|
|
168
|
+
|
|
169
|
+
**The right way to write aliases** (summary of measured practice): before writing, **first ask yourself "how would I ask about this later?"**, and put those phrasings in verbatim (3-8 of them; colloquial, emotional, and near-synonym all count).
|
|
170
|
+
|
|
171
|
+
> ⚠️ **Do not mechanically extract words**. Measured: auto-generating by splitting the feature name on spaces, 20 entries × 5 queries = **improvement +0**
|
|
172
|
+
> (Chinese feature names have no spaces, so what gets split out is the whole sentence). Aliases can only be "thought of", not "split out".
|
|
173
|
+
|
|
174
|
+
**Why it is needed** - the decisive case in issue #722:
|
|
175
|
+
|
|
176
|
+
| Matching method | Condition "talk about handover, switching sessions, compression..." vs query "I don't want you to be replaced" |
|
|
177
|
+
|---|---|
|
|
178
|
+
| Whole-word matching | ❌ |
|
|
179
|
+
| Bigram overlap | ❌ `换会/会话` vs `我不/…/被换/换掉` - **intersection empty** |
|
|
180
|
+
| Query expansion | ❌ expands to `换掉/被换`, still **no intersection** with `换会话` |
|
|
181
|
+
| Existing synonym table (10 groups, all technical terms) | ❌ |
|
|
182
|
+
| **Adding `aliases`** | ✅ **hit** |
|
|
183
|
+
|
|
184
|
+
Full standard (**not in the npm package, read it in the repository**): [`docs/mdcg/写入别名aliases规范_v0.6.md`](docs/en/mdcg/write-aliases.md)
|
|
185
|
+
|
|
186
|
+
### Fixes
|
|
187
|
+
|
|
188
|
+
- **Web panel `permissionNote` does not accept the `*` wildcard** (#723 / PR #724): under a full-permission token (`ops_allow: ["*"]`),
|
|
189
|
+
**all 12/12 presets on the four pages "Goals and Tasks", "Self-Knowledge", "Spatiotemporal Relations", and "Review and Maintenance" falsely reported "permission not declared"**,
|
|
190
|
+
while the actual calls all succeeded. Root cause: **the front end and the server used different criteria for the same judgment**:
|
|
191
|
+
the server's `_in_scope` accepted `"*" in allow`, the front end only did `allowed.includes(op)`. Now aligned.
|
|
192
|
+
|
|
193
|
+
⚠️ The inverted-criteria symptom is worth recording: **a full-permission token sees a screen full of red, while a narrow token sees only partial hints**.
|
|
194
|
+
|
|
195
|
+
### Added: write gate criteria (**not wired in yet, only testable functions**)
|
|
196
|
+
|
|
197
|
+
| Function | Purpose |
|
|
198
|
+
|---|---|
|
|
199
|
+
| `writegate.cond_is_metadata(cond_text)` | Decide whether the "effective condition" describes the carrier/path/method (metadata) rather than a trigger scenario |
|
|
200
|
+
| `writegate.check_condition_quality(content)` | Write-gate wrapper around the above, returns `{ok, is_metadata, cond, hint}`; **never raises** |
|
|
201
|
+
| `writegate.aliases_is_thin(fm, content)` | Decide whether aliases are "thin" (no aliases, or only repeating words already present in the body) |
|
|
202
|
+
|
|
203
|
+
⚠️ **These three functions are not wired into `add()` yet** - only testable entry points are provided; wiring is the next change.
|
|
204
|
+
|
|
205
|
+
### Internal: tests and guards
|
|
206
|
+
|
|
207
|
+
- **`test_mode_parity` `full_D` cross-minute time leak** (PR #720): `tombstone` is a content hash,
|
|
208
|
+
and the content contains wall-clock aggregate lines ⇒ two subprocesses across a minute boundary necessarily DIFF. A fixed timestamp is now injected in `_RUNNER`.
|
|
209
|
+
- New guards: `test_723_permission_wildcard` (6 items, **cross-side criteria consistency**, same family as `test_rust_fold_parity`),
|
|
210
|
+
`test_722_condition_quality` (8 items), `test_722_aliases_thin` (11 items).
|
|
211
|
+
|
|
212
|
+
### Measured baseline (for comparison, not a promise)
|
|
213
|
+
|
|
214
|
+
Measured on this machine's library (32,845 nodes):
|
|
215
|
+
|
|
216
|
+
| Item | Reading |
|
|
217
|
+
|---|---|
|
|
218
|
+
| Recall count for natural phrasing | **2** |
|
|
219
|
+
| `aliases` coverage | **0%** |
|
|
220
|
+
| `role=None` in the `knowledge` layer (index cards) | **99.7%** |
|
|
221
|
+
| Share of effective conditions that are metadata | **76.5%** |
|
|
222
|
+
|
|
223
|
+
⇒ So the value of `aliases` depends on **whether it is actually written at write time**. Existing nodes in the library **do not gain it automatically**.
|
|
224
|
+
|
|
225
|
+
## [0.9.18] - 2026-10-30
|
|
226
|
+
|
|
227
|
+
### ⚠️ BREAKING: injected block format change
|
|
228
|
+
|
|
229
|
+
The line format of the `【本会话近期对话】` block now carries an **attribution prefix** (issue #712 / PR #713):
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
旧:[user] 内容
|
|
233
|
+
新:[10-30 14:23|本|私] [user] 内容
|
|
234
|
+
└──┬──┘ └┬┘ └┬┘
|
|
235
|
+
时间 会话 密级
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
| Segment | Value |
|
|
239
|
+
|---|---|
|
|
240
|
+
| Time | `MM-DD HH:mm`; missing renders `??-?? ??:??` |
|
|
241
|
+
| Session | equal to the current session → `本`; otherwise → `会话<后4位>`; missing → `?` |
|
|
242
|
+
| Sensitivity | `private`/`secret` → `私`; `public`/`internal`/`restricted` → `共`; missing → `?` |
|
|
243
|
+
|
|
244
|
+
**Why the change**: previously the model only saw `[role] content` and could not tell "is this what I just said, or something another session said, is it private or shared" -
|
|
245
|
+
a measured case existed of "quoting a line from another window as if the current user had just said it" (#712).
|
|
246
|
+
|
|
247
|
+
The block total length cap changed from `800 → 900` characters accordingly (the prefix costs about 20 characters per line).
|
|
248
|
+
**If you have parsers or assertions that depend on the old format, sync them.**
|
|
249
|
+
|
|
250
|
+
### Added
|
|
251
|
+
|
|
252
|
+
- **`cg(op=info).write_gate`** (#708): **in-process counters** for the layered write gate - `{mode, total, by_layer, recent, hint}`.
|
|
253
|
+
Previously `warn` mode only wrote to the subprocess stderr, and DSH does not forward it ⇒ the observation period was effectively nothing.
|
|
254
|
+
It now does not depend on stderr forwarding and does not write to disk; `recent` keeps only `layer/tier/reason` (**no content, no node ids**), bounded to 20 entries.
|
|
255
|
+
Counters **reset to zero on restart**; observing one full working day before switching to `enforce` is recommended.
|
|
256
|
+
- **`Principal.sessions_read`** (#712 / option C tiered isolation): `None` = old behavior unchanged digit for digit; a set = read only those sessions;
|
|
257
|
+
`{"*"}` = read all. **`can_admin` is not weakened** (issue #35 "Designer exemption" finalized).
|
|
258
|
+
- **Four event attribution elements**: `pack["recent"]` entries now contain `session`/`t`/`id`/`sensitivity`/`actor`/`token_id`/`identity_role`/`parent`.
|
|
259
|
+
Events gain a stable key `id` (`re_<ms>_<6hex>`, **for attribution display only, must not be used for permission decisions or deduplication lookups**).
|
|
260
|
+
- **Theory document**: "Identity and Persona: the Variability of Professional Identity vs the Consistency of Persona"
|
|
261
|
+
(`docs/theory/身份与人格_职业身份可变性与人格一致性_v0.1.md`) -
|
|
262
|
+
distinguishes **persona** (constant across sessions, `self`/`anchor` layers) from **professional identity** (session level, working layer + event attribution).
|
|
263
|
+
|
|
264
|
+
### Fixes
|
|
265
|
+
|
|
266
|
+
- **Under `enforce`, the adjudication audit node was blocked by the same gate** (#708 ② / #709): `_write_review_record` writes `structural` (tier 2),
|
|
267
|
+
yet did not pass the review units ⇒ `decisions.jsonl` remained, but **the reviewable md audit node was gone**.
|
|
268
|
+
Now the `reviewed_by` already obtained by this adjudication is carried all the way into the write.
|
|
269
|
+
- **Two earlier gaps in the same chain** (found while investigating #709):
|
|
270
|
+
- **`propose` deadlock**: a candidate entering the inbox is not persisted to the memory disk, yet review units were required according to the target layer ⇒
|
|
271
|
+
under enforce, "writing knowledge needs reflect → reflect needs adjudication → adjudication needs a proposal → a proposal needs reflect".
|
|
272
|
+
Now `require_layer_write(..., skip_gate=False)` adds that parameter, and **only** `propose` passes `True`;
|
|
273
|
+
the layer allowlist and sensitivity check **still run as usual**, and `accept` persisting to disk still goes through the same gate.
|
|
274
|
+
- **`accept` persisting a business node** did not pass `reviewed_by` ⇒ "adjudication passed, persist blocked".
|
|
275
|
+
- **`reviewed_by` no longer pollutes frontmatter**: it is **an input parameter of the write gate, not memory metadata**.
|
|
276
|
+
Previously `kw.get()` read it without deleting it, so it landed in the node fm through `super().add(**kw)` (measured: `test_i50c`'s B1 key-by-key comparison reported `reviewed_by: null`).
|
|
277
|
+
Now changed to `kw.pop()`.
|
|
278
|
+
- **`actor` was always None** (hollow identity attribution): in `MdCGSecure.remember_event`, `tenant`/`session`/`harness`/`unit`/`sensitivity`
|
|
279
|
+
**all get values from principal**, but `actor` ("who said it") did not ⇒ the injection surface always received `actor` as None. Fixed.
|
|
280
|
+
- **Window-order bugs x2** (#712 / #715): both `session_recall` and `session_compact` **truncate the last N entries first, then filter by session**
|
|
281
|
+
⇒ under multi-session concurrency, this session's messages are pushed out of the window, and `session="A"` may get an **empty recent** (false negative, extremely hard to find).
|
|
282
|
+
`session_compact` is worse - it compresses "0 events in total" and **writes it into a session node** (one wrong memory written).
|
|
283
|
+
Fix: when narrowing is needed, fetch the full set first, then filter, then truncate back.
|
|
284
|
+
- **Falsy `session` silently falls back to the global window** (#712): it now adds `recent_global_window` in `degraded`, so callers can see it.
|
|
285
|
+
- **Identity block always empty** (#715): `【灵枢身份锚点】` reused the timeline payload **with session filtering**,
|
|
286
|
+
while the `session` of `self`/`anchor` nodes is **always `unattributed`** ⇒ the permanent layers were all filtered out ⇒ **the block never appeared and no error was raised**.
|
|
287
|
+
Now the identity block **fetches independently, without session filtering**; the "recent memory" block keeps session isolation.
|
|
288
|
+
This is exactly the real case of theory R3: **the visibility of persona should not be decided by session**.
|
|
289
|
+
An `else` branch with `logger.info` was also added - when the switch is on but there is no identity node, it says so explicitly instead of staying silent.
|
|
290
|
+
- **Falsy session id silently falls back to the global window** (PR #714 by LeeRolling): now `logger.warn` once (no flooding).
|
|
291
|
+
|
|
292
|
+
### Internal
|
|
293
|
+
|
|
294
|
+
- The code-reading anchor in `test/chaos_injection/test_fi_m09_guest_write_denied.py` was relaxed from "the full call string" to "both `layer, sens` parameters present",
|
|
295
|
+
and two hard-coded line numbers were removed.
|
|
296
|
+
- `NEW_INFO_KEYS` in `test_generation_guard.py` registers `write_gate`.
|
|
297
|
+
- The mutation anchor in `test_p45_session_identity.py` was synced to the new shape (**mutation semantics unchanged**).
|
|
298
|
+
- New guards: `test_issue712_session_window_attribution` (29 items, covering window order / four elements / identity three dimensions / separation of powers),
|
|
299
|
+
`test/issue715` (W715), `test/issue714` (W714 / W714b).
|
|
300
|
+
|
|
301
|
+
### Upgrade notes
|
|
302
|
+
|
|
303
|
+
- **The `--gate` default is still `strict`**; `op=info` only **adds** keys; `sessions_read` defaults to `None` = old behavior unchanged digit for digit.
|
|
304
|
+
- If you hit problems in #708 / #709: after upgrading, `cg(op="info")["write_gate"]` shows the warn counts,
|
|
305
|
+
and **`record_error` in the return body of `review accept` should be empty**.
|
|
306
|
+
- If you hit problems in #712 / #715: after upgrading, injected blocks should carry the attribution prefix, and the identity block should appear when `autoRecallIdentity: true`.
|
|
307
|
+
## [0.9.17] - 2026-10-28
|
|
308
|
+
|
|
309
|
+
### Fixes
|
|
310
|
+
|
|
311
|
+
- **`warn` mode was completely invisible to users (#708 ①)**: `security._write_gate_verdict` only did `sys.stderr.write`, and DSH does not forward this
|
|
312
|
+
into `desktop-next.log` ⇒ the observation period was effectively nothing. Now `writegate` keeps **in-process counters** and exposes them via `cg(op=info).write_gate`:
|
|
313
|
+
|
|
314
|
+
```python
|
|
315
|
+
cg(op="info")["write_gate"]
|
|
316
|
+
# {mode, total, by_layer: {"knowledge@L1": 3}, recent: [{layer,tier,reason}…], hint}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
It does not depend on stderr forwarding and does not write to disk; `recent` keeps only `layer/tier/reason` (**no content, no node ids**), bounded to 20 entries.
|
|
320
|
+
The stderr line is kept (still visible in real time when the host is willing to forward it).
|
|
321
|
+
|
|
322
|
+
- **Under `enforce`, the adjudication audit node is blocked by the same gate (#708 ② / #709)**: `_write_review_record` writes `structural` (tier 2: needs reflect+verify),
|
|
323
|
+
yet does not pass the review units ⇒ `decisions.jsonl` remains, but **the reviewable md audit node is gone**. Now the `reviewed_by`
|
|
324
|
+
already obtained by this adjudication is carried all the way into the write: `review_decide → _finish_decision → _record_decision → _write_review_record → add(reviewed_by=…)`.
|
|
325
|
+
|
|
326
|
+
- **Two earlier landing points of the same hole (found while investigating #709, fixed together)**:
|
|
327
|
+
- **`propose` deadlock**: a candidate entering the inbox is not persisted to the memory disk, yet review units are required by the **target layer** ⇒ under `enforce`,
|
|
328
|
+
"writing knowledge needs reflect → reflect needs adjudication → adjudication needs a proposal → a proposal needs reflect".
|
|
329
|
+
Now `require_layer_write(..., skip_gate=False)` adds that parameter, and **only** `propose` passes `True`;
|
|
330
|
+
the layer allowlist and sensitivity check **run as usual** (only the write_gate stage is skipped), and `accept` persisting to disk still goes through the same gate.
|
|
331
|
+
- **`accept` persisting a business node** does not pass `reviewed_by` ⇒ "adjudication passed, persist blocked". Now carried through together.
|
|
332
|
+
|
|
333
|
+
- **`reviewed_by` no longer pollutes frontmatter**: it is **an input parameter of the write gate, not memory metadata**. Previously `kw.get()` was used to read without deleting,
|
|
334
|
+
so it landed in the node fm through `super().add(**kw)` (measured: `test_i50c`'s B1 key-by-key comparison reported `reviewed_by: null`). Now changed to `kw.pop()`.
|
|
335
|
+
|
|
336
|
+
### Internal
|
|
337
|
+
|
|
338
|
+
- The code-reading anchor in `test/chaos_injection/test_fi_m09_guest_write_denied.py` was relaxed from "the full call string" to "both `layer, sens` parameters present"
|
|
339
|
+
(`require_layer_write` now has an extra `reviewers=` argument); two hard-coded line numbers were also removed - line numbers drift with changes.
|
|
340
|
+
- `NEW_INFO_KEYS` in `test_generation_guard.py` registers `write_gate` (the new diagnostic key of `op=info`, same class as `code_generation`).
|
|
341
|
+
|
|
342
|
+
### Upgrade notes
|
|
343
|
+
|
|
344
|
+
- This release **has no breaking changes**: `skip_gate` defaults to `False`; the `--gate` default is still `strict`; `op=info` only **adds** one `write_gate` key.
|
|
345
|
+
- If you hit problems in #708 / #709: after upgrading, `cg(op="info")["write_gate"]` shows the warn counts,
|
|
346
|
+
and **`record_error` in the return body of `review accept` should be empty**.
|
|
347
|
+
- Counters are **accumulated in-process and reset to zero on restart** (not written to disk); observing one full working day before switching to `enforce` is recommended.
|
|
348
|
+
## [0.9.16] - 2026-10-28
|
|
349
|
+
|
|
350
|
+
### Fixes
|
|
351
|
+
|
|
352
|
+
- **`/lingshu` always returned 503 "host authentication unavailable" on DSH 0.2.1-rc.3 (#699)**: `createConsoleHandler` fetched `ctx.get('connection')` once **at mount time**,
|
|
353
|
+
and cordis's `Context.get(name, strict=true)` returns `undefined` when the serving fiber is not ready -
|
|
354
|
+
the empty value was frozen into the closure, so every request hit 503 and it did not self-heal even after the host became ready. Now it **fetches in real time on every request** (passing a getter function; a non-function is wrapped as a constant, for backward compatibility),
|
|
355
|
+
and the 503 message changed to "the host authentication service is not ready yet, please retry later". 3 guards, and "the connection arrives late ⇒ the same handler immediately returns 200" is exactly the lesion point.
|
|
356
|
+
- **Test entry "zero-selected false green" (#1910 cross-repo report)**: the `--module` help taught the **slash** form (`md_cg/test_issue4`),
|
|
357
|
+
while the actual target names use **dots** (`md_cg.test_issue4`), and the old implementation did not normalize ⇒ the slash form selected **zero targets** yet still printed `SUMMARY 0/0` + `rc=0`.
|
|
358
|
+
Now normalized (slash ≡ dot, `.py` ignored, empty selector matches nothing) + **zero selections must not return 0** (execution path `rc=2`). 21 guards including a self-proof of discriminating power.
|
|
359
|
+
- **F26-13 `_primary_bound` comment did not match the implementation**: the `#637` comment promised "T3 trims when score>0", but the code only trims when `n_real == 0`.
|
|
360
|
+
Measured: implementing the comment **breaks the "fallback includes cross-bucket nodes" contract of S1b/S7** (`test_retr_s1b`/`test_retr_s7` immediately turn red) ⇒
|
|
361
|
+
confirmed that "no trimming by default" is a deliberate trade-off, changed to **align the comment with the implementation** and wrote the evidence into the comment (so later readers do not step on it again).
|
|
362
|
+
- **F26-25 Rust side missing accent folding**: `normalize_en` turned every non-ASCII non-Chinese character into a space ⇒ `café` → `caf`, while Python gives `cafe`.
|
|
363
|
+
Constrained by `Cargo.toml`'s "zero third-party dependencies", changed to **follow the Python criteria** and generate a 963-entry single-character mapping table plus three-range combining-mark stripping;
|
|
364
|
+
cross-implementation guards **29 items** checked item by item (including the boundary that `ß`/`ø` do not fold, and Japanese dakuten do not fold).
|
|
365
|
+
|
|
366
|
+
### Added
|
|
367
|
+
|
|
368
|
+
- **Gate level `--gate fast|strict` + `--module` filter** (`scripts/run_tests.py`):
|
|
369
|
+
"fast = set the problem aside / slow = dig into the root cause" is a value trade-off, and **the choice is handed to the user**; not a single line changed on the guard side,
|
|
370
|
+
and "whether to run heavy quality checks" is decided by the upper layer. Default `strict` (does not lower existing strength); **CI environment + `fast` automatically upgrades to strict** to prevent missed detection. 17 guards.
|
|
371
|
+
- **Config registry generator "add-only" protection** (`scripts/gen_config_registry.py`): a whole-file rewrite would erase manually added lines
|
|
372
|
+
(measured incident: `MDCG_WARM_SEARCH`/`MDCG_VISION_ROOT` disappeared). Now, before writing to disk, it reads the old table's entry names with AST and refuses if one is missing (`rc=3`),
|
|
373
|
+
with `--force` as an explicit escape hatch. 14 guards.
|
|
374
|
+
- **Audit gains a `source` key-name set dimension** (`src/lib/hook_audit.ts`): the key gap in #695 was that "which fields the event's `source` actually carries" was unobservable.
|
|
375
|
+
A `source_shapes` bucket was added, recording **key names only, never values** (pinned by a sentinel guard). Measured on this machine, 383 sessions / 9,614 lines: the `user` tier takes 18.4%,
|
|
376
|
+
of which 80.3% carry `rpcId` and **19.7% carry only `kind`** - this reading turns "source attribution" from a guess into something quantifiable.
|
|
377
|
+
- **Two silent fallbacks in `entry_from_row` made observable** (`md_cg/config_registry.py`): a `literal_eval` failure and a missing `value_type`
|
|
378
|
+
previously left no trace at all (numeric registrations would silently be treated as strings). Two read entry points added, `literal_failures()` / `missing_value_types()`, with **zero behavior change**. 15 guards.
|
|
379
|
+
|
|
380
|
+
### Documentation
|
|
381
|
+
|
|
382
|
+
- **README 321 → 227 lines**: the "graphical interface" and "permissions" chapters were each compressed to ~14 lines (one-line positioning + minimal commands + one table + links),
|
|
383
|
+
with details moved into [`docs/en/ops/ui-install-troubleshooting.md`](docs/en/ops/ui-install-troubleshooting.md) and [`docs/en/ops/permissions-review.md`](docs/en/ops/permissions-review.md).
|
|
384
|
+
The README reader is "deciding within 30 seconds whether to use it"; details belong in `docs/`.
|
|
385
|
+
|
|
386
|
+
### Upgrade notes
|
|
387
|
+
|
|
388
|
+
- This release **has no breaking changes**: the `--gate` default is still `strict`; `createConsoleHandler` keeps the old "pass the value directly" calling style;
|
|
389
|
+
both `--module` forms now work (the slash form previously selected zero targets).
|
|
390
|
+
- If you hit a constant 503 on `/lingshu` on DSH 0.2.1-rc.3: after upgrading **no extra action is needed**; it self-heals even if the service arrives late.
|
|
391
|
+
If it is still 503, please reply with the `kinds` section of `$DSH_HOME/logs/dsh-memory-hook-audit.json` (no content).
|
|
392
|
+
## [0.9.15] - 2026-10-27
|
|
393
|
+
|
|
394
|
+
Theme: **permission layering and the review model land** (read/write/adjudicate layers each narrowable on its own) + one order-of-magnitude performance fix + two real "cannot install / cannot start" bugs.
|
|
395
|
+
|
|
396
|
+
### Added · Review model for writes and adjudication
|
|
397
|
+
|
|
398
|
+
- **Layered write strictness gate** (`MDCG_WRITE_GATE`, default `off`) - scenario/goal/unresolved/negative memory (tier 0) can be written directly without review;
|
|
399
|
+
the knowledge layer needs a reflection unit; the structural layer needs reflection + verification; the self/anchor layer needs reflection + verification + **human adjudication**.
|
|
400
|
+
**With no review channel at all, only tier 0 may be written**; everything else is refused.
|
|
401
|
+
- **Adjudication dual-unit review gate** (`MDCG_REVIEW_DUAL_CHECK`, default off) - adjudication must carry `reviewed_by` containing both a reflection unit and a verification unit;
|
|
402
|
+
**duplicates of the same kind do not count as complete** (two reflections still lack verification); the adjudicator must not be the proposer (`self_review_forbidden`); unknown units are not silently counted.
|
|
403
|
+
- `MDCG_REVIEW_CHANNELS` (review channel declaration: `hive,subagent,team`). Note that it is a **deployment declaration**:
|
|
404
|
+
empty only means "never declared", **not** that this machine has no subagents/hive/team.
|
|
405
|
+
- **Designer token coverage criteria** - `DESIGNER_COVERAGE_OPS` / `coverage_gap()` / `HIGH_RISK_OPS` / `high_risk_granted()`;
|
|
406
|
+
`tokens verify` output appends `designer_coverage_gap`; at issue time, two kinds of hints, "narrowed and missing read surfaces" and "high-risk surfaces granted", are written into the return value `warnings`
|
|
407
|
+
(the library layer does not write to stderr; the CLI entry prints them).
|
|
408
|
+
|
|
409
|
+
### Added · Graphical interface (optional add-on package)
|
|
410
|
+
|
|
411
|
+
- `ui/minimal/`: one-line install, per-file rollback, reusing the local brain bridge (data never leaves the machine);
|
|
412
|
+
a seven-page panel (overview / memory / goals and tasks / self-knowledge / spatiotemporal relations / review and maintenance / toolbench).
|
|
413
|
+
- The `files` allowlist in `package.json` adds `ui` and `web`, so the installer, payload, and static assets **ship with the npm package**.
|
|
414
|
+
- **Wiring into the package**: `dsh.client` / `exports["./client"]` written into `package.json`, `installConsoleWeb(...)` written into `src/index.ts`;
|
|
415
|
+
the artifacts are generated by the new `scripts/build_ui.py` (idempotent; `--check` only verifies and fails closed when files are missing; both `build` and `prepublishOnly` run it automatically).
|
|
416
|
+
So **changing the plugin manifest no longer requires reinstalling the UI**; `install.ps1` now targets end users who go "from the npm package to the local plugin directory",
|
|
417
|
+
and it still auto-completes plugin packages that predate the wiring. The guard `md_cg/test_ui_wiring_in_repo.py` (18 items) pins the declaration/distribution/build three faces against drift.
|
|
418
|
+
|
|
419
|
+
### Performance
|
|
420
|
+
|
|
421
|
+
- `protect.stats()` switched to **entry-based criteria** (reads the index, no longer reading frontmatter node by node):
|
|
422
|
+
on the live library (32,000 nodes) the cold state went **310 s → 0.015 s**. This function is called unconditionally through the `protection` section of `cg(op=info)`,
|
|
423
|
+
and was the root cause of the UI overview page "looking frozen"; after the fix the overview page went from the 5-minute level to the second level.
|
|
424
|
+
Semantics unchanged: a full comparison of `protected` / `immutable` shows **diff 0**.
|
|
425
|
+
|
|
426
|
+
### Fixes
|
|
427
|
+
|
|
428
|
+
- **The UI add-on package could not be installed on Windows**: the payload was checked out as CRLF by `core.autocrlf`, mismatching `integrity.json` (sha256 recorded against LF),
|
|
429
|
+
and the installer falsely reported "shared package files missing or corrupted". `.gitattributes` now pins `ui/minimal/payload/** eol=lf`.
|
|
430
|
+
- **hive serve would not start**: `{"env": "DEEPSEEK_API_KEY"}` in `config.local.json` reads the environment variable of the **calling process**,
|
|
431
|
+
and DSH subprocesses do not inherit machine-level variables ⇒ a false "config item parse failed". A Windows machine-level fallback was added
|
|
432
|
+
(an explicit process env value still wins; if both are empty it still fails fast).
|
|
433
|
+
- The config registry surface registers `MDCG_WRITE_GATE` / `MDCG_REVIEW_CHANNELS` / `MDCG_REVIEW_DUAL_CHECK`.
|
|
434
|
+
|
|
435
|
+
### Documentation
|
|
436
|
+
|
|
437
|
+
- README adds two chapters: "🖥️ Graphical interface (optional add-on package · for DSH)" and "🔐 Permissions: read / write / adjudicate, three layers, each narrowable on its own",
|
|
438
|
+
covering which four of the seven pages are command panels, three troubleshooting items, the 17 read-surface ops, the layered write matrix, dual-unit adjudication, and the error reference table.
|
|
439
|
+
|
|
440
|
+
### Upgrade notes
|
|
441
|
+
|
|
442
|
+
- **The default values of the three new switches all keep the old behavior** (`MDCG_WRITE_GATE=off`, `MDCG_REVIEW_CHANNELS` empty, `MDCG_REVIEW_DUAL_CHECK` off)
|
|
443
|
+
⇒ behavior is unchanged after upgrading; they must be enabled explicitly. Recommended order: observe with `warn` first, then `enforce` after the review channels are connected.
|
|
444
|
+
- Designer tokens **do not widen because of an upgrade**; if your token was narrowed by hand, `tokens verify` reports `designer_coverage_gap` and names the missing surfaces.
|
|
445
|
+
- Windows users who previously could not install the UI can install it directly in this release.
|
|
446
|
+
|
|
447
|
+
### Known boundaries
|
|
448
|
+
|
|
449
|
+
- The write gate and the adjudication gate only recognize "review unit declarations"; they do not verify whether evidence is genuine (genuineness is countersigned on the hive/subagent side).
|
|
450
|
+
- Before `MDCG_WRITE_GATE=enforce`, declare `MDCG_REVIEW_CHANNELS` first, otherwise the knowledge layer and above (including automatic archiving) will be refused writes.
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,118 @@
|
|
|
4
4
|
|
|
5
5
|
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);版本号遵循语义化版本。
|
|
6
6
|
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.10.1] - 2026-11-11
|
|
10
|
+
|
|
11
|
+
### 时间检索修复(#849 / #850 / #851 / #852 / #853 / #855 / #858 / #859)
|
|
12
|
+
|
|
13
|
+
- 相对日期解析面扩展:三天前/上周三/上周/上个月(含中文数字)。
|
|
14
|
+
- `pick_scopes(now=)` 逻辑时钟注入;`recall(now=)` 透传(外部复测不再按真实今天解析)。
|
|
15
|
+
- `_pick` 命中抑制修复:命中节点优先 + 按时间补足(锚点在桶里不再消失)。
|
|
16
|
+
- 三类病因:早段会话配额 4→2(日桶得 6)、无词交集桶也补足、证据前置到池生成。
|
|
17
|
+
- 读数:时间类锚点覆盖 **41.2% → 83.2%**,稳定集 **52 → 55**(两臂两重复,抖动 0)。
|
|
18
|
+
- 三列表:锚点进&答对 50 / 锚点进&仍答错 19 / 锚点没全进&答对 5 / 没进&答错 1。
|
|
19
|
+
- 边界:开 vs 关反了 1 题(55 vs 56),作答侧改动同时抬了两臂;未全量重跑 714。
|
|
20
|
+
|
|
21
|
+
## [0.10.0] - 2026-11-10
|
|
22
|
+
|
|
23
|
+
### 新增:范围选择(`scopeselect`)——状态追踪式锚定,成为桶序标准(#844 / #847)
|
|
24
|
+
|
|
25
|
+
- **判据换代**:桶序不再由「哪段文字更像查询」决定,而由「这些值是否在同一时间桶里同时出现过」决定(槽位共现)。假题的错元素位于别章,共现投票天然免疫。
|
|
26
|
+
- **桶词表 + 桶文本骨架**:`_bucketterms.json`(词项/df)与 `_bucketskel.json`(骨架,每节点 600 字 / 每桶 2 万字),建桶时顺手落盘;查询期只做字典运算。
|
|
27
|
+
- **声明优先**:显式会话 / 显式日期直接当范围;无声明才走共现推断。
|
|
28
|
+
- **开关**:`MDCG_SCOPE_SELECT`(缺省 1,=0 回落「最近优先」)、`MDCG_SCOPESEL_COOC`(缺省 1,共现优先;=0 走 idf 兜底路)。
|
|
29
|
+
- **读数(bench rubric92 · 552 断言 · 纯确定性)**:所引章 top-1 **97.83%**、top-3 **99.82%**;消融(去掉「第N章」)同值 ⇒ 对章节字面零依赖。对照 idf 路 35.33%。
|
|
30
|
+
- **主库代价**:全量重建 3.4 万节点 53 秒;`_bucketskel.json` 5.72 MB、`_bucketterms.json` 21.09 MB;查询首调 0.64 秒(载入)→ 之后 0.00–0.01 秒。
|
|
31
|
+
|
|
32
|
+
### 新增:桶索引每日收尾自动重建(#838)
|
|
33
|
+
|
|
34
|
+
- `cg(op=info)` 触发;`_bucketindex_meta.json` 记上次重建时间,超过 `MDCG_BUCKET_INTERVAL_H`(缺省 20h)才重建;后台 daemon 线程 + 模块级重入防护,不阻塞 info。
|
|
35
|
+
- info 返回体透出 `bucket_auto`(rebuilt / reason / age_h)可审计;`MDCG_BUCKET_AUTO=0` 关闭。
|
|
36
|
+
|
|
37
|
+
### 修复:桶召回把最新的那条丢掉(#842)
|
|
38
|
+
|
|
39
|
+
- `_pick` 早先按 `(-hits, nid)` 排序后直接截 cap,时间序在截断之后才应用;9 条同等命中 + cap=8 时,被 id 序挤掉的可能正是最新那条。
|
|
40
|
+
- 现排序键在**截断前**就含时间序 `(-hits, recency, nid)` ⇒ 截断即保留「同分里最新的」。
|
|
41
|
+
|
|
42
|
+
### 修复:`validity=True` 排除的过期记忆被桶补召回装回(#843)
|
|
43
|
+
|
|
44
|
+
- 桶补召回在候选检索之后 append,早先既没传 `validity` 也没复用过期判据。
|
|
45
|
+
- 现 `_pick` 源头过滤 `validity`(只认 `frontmatter.valid_until`,解析失败不算过期),`scope_recall` / `day_scope` / `session_scope` 全链透传。
|
|
46
|
+
|
|
47
|
+
### 修复:scrub 幂等 / review_cli 落账 / bench 测量周期(#827 / #831 / #832;PR #839 / #840 / #841)
|
|
48
|
+
|
|
49
|
+
- `_weaken` 去重判据跟着节点走(旧判据读影子工作树里每轮归零的 `_scrub.jsonl`;实测 407 条负向证据仅 83 条不同、单键被记 52 次)。
|
|
50
|
+
- `review_cli` 以 `async_flush=False` 构造,写毕即落账重新成立。
|
|
51
|
+
- `bench_swarm_parallel` 测量周期拉离调度噪声区。
|
|
52
|
+
|
|
53
|
+
### 修复:`calibration` 在分母无正例时恒判 overconfident(issue #829)
|
|
54
|
+
- 判据是 `Σ正例 / Σ(正例+负例)`,而 `confirmed` 只由外部裁决产生;活库
|
|
55
|
+
407→409 条证据**正例恒为 0** ⇒ `actual_accuracy` 数学上恒 `0.0`、
|
|
56
|
+
`gap` 恒等于 `expected_accuracy` ⇒ `verdict` **恒为 overconfident**。
|
|
57
|
+
该字段此前不携带信息,下游 `self_state` / `report` 却当真读数消费。
|
|
58
|
+
- 现 `Σ正例==0` ⇒ `calibration_defined=False` / `verdict="insufficient_data"`
|
|
59
|
+
/ `reason="no_positive_evidence"`,**方向三值一律不判**;
|
|
60
|
+
`expected_accuracy` / `actual_accuracy` / `gap` / `ece` 仍如实透出(不隐藏、不编造)。
|
|
61
|
+
- 新增 `n_positive` / `n_negative` / `n_by_layer`:分母构成在读数面可见
|
|
62
|
+
(`grep n_by_layer` 此前零命中)。三层不变量:`n_nodes`、`n_positive`、
|
|
63
|
+
`n_negative` 分别等于 `n_by_layer` 各层求和。
|
|
64
|
+
- `scrub.calibrate()` 在 `calibration_defined=False` 时**拒绝出偏置**:
|
|
65
|
+
返回 `ok=False` / `suggested_offset=0.0` / `n_adjusted=0`,`apply=True`
|
|
66
|
+
也零写回。修前该路径会据退化的 `gap` 把全库 confidence 一律下调——
|
|
67
|
+
一个不携带信息的读数直接改写事实层。
|
|
68
|
+
- `_advise()` 不判方向时不产出 `overconfident`/`underconfident` 建议,
|
|
69
|
+
改产出 `no_positive_evidence`(带 why/action,可复核)。
|
|
70
|
+
- 有正例时判据**一字不改**(正向对照:全正例 → `actual=1.0` 且方向可判)。
|
|
71
|
+
- 守卫 `md_cg/test_issue829_calibration_positive_gate.py`:A/B/C/D/E 五组
|
|
72
|
+
21 项,定点变异 **5/5 全杀**(含「M1 退回恒 overconfident」修前病象复现)。
|
|
73
|
+
|
|
74
|
+
## [0.9.23] - 2026-11-05
|
|
75
|
+
|
|
76
|
+
### 修复:`cg(op=read)` 自然问法普遍 DEFER(issue #722,Q1=A / Q2=A)
|
|
77
|
+
|
|
78
|
+
- `judge_qualification` 增 `strict_conditions`(库面默认 `true`,既有调用方零变化);**工具面 `read`/`route` 缺省放宽**;
|
|
79
|
+
- 放宽**只到 `usable`**:`state` 仍是 `DEFER`,新增 `usable/relaxed/code/condition_status`,reason 明写「未冒充已确认」;
|
|
80
|
+
- **只放宽「生效条件未在情境确认」一支**;坏条件 / `REJECT` / `BLINDSPOT` / 验证基底**仍拦**;
|
|
81
|
+
- 守卫 10 条;`judge_with_boundary` 现在保留这四个标记键(原先被裁掉,导致「放宽了也看不见」)。
|
|
82
|
+
|
|
83
|
+
### 修复:`cg(op=info)` 在大库上超时(issue #677 B)
|
|
84
|
+
|
|
85
|
+
- `health_os()`(全库扫描类)改为**仅 `full=true` 时执行**;新增 `flush_state`(`pending_dirty/worker_alive/last_error`)与 `node_count`;
|
|
86
|
+
- **契约变更**:缺省不再含 health_os 的键(`buckets`/`bucket_scope`/`ccg_by_layer` 等);要旧全集请传 `full=true`。
|
|
87
|
+
|
|
88
|
+
### 修复:写入成功后调用超时、重试产生重复节点(issue #677)
|
|
89
|
+
|
|
90
|
+
- `mdcg_remember` 支持 `dedupe`(与 `cg(op=write)` 同一个幂等闸);**插件三类自动记忆默认带 `dedupe: true`**,可用 `memory.dedupe=false` 关闭;
|
|
91
|
+
- 服务端闸改为**同会话才幂等**:跨会话写同一句不会互相顶掉(叠加 `sessionPrivate` 时不再「命中但读不到」)。
|
|
92
|
+
|
|
93
|
+
### 性能:flush 锁内 IO 从 O(N) 降到 O(1)(issue #677 C)
|
|
94
|
+
|
|
95
|
+
- `ShardedLog.append_many`:**一次 write + 一次 flush**;整批仍在同一把 `FileLock` 内(与 compact 互斥语义不变);
|
|
96
|
+
- 同时修两个崩溃安全缺陷:**残尾粘行**(末字节非换行先补 `\n`)、**失败回填丢 `superseded` 标记**(否则陈旧记录复活=旧盖新)。
|
|
97
|
+
|
|
98
|
+
### 修复:`FileLock.__enter__` 异常路径泄漏 fd(issue #740)
|
|
99
|
+
|
|
100
|
+
- strict 超时 / 非重试 errno / `timeout` 类型错 / `sleep` 中 `KeyboardInterrupt` 四条路径现在都走 `_close_fd()`;
|
|
101
|
+
- `__exit__` 复用(幂等、绝不抛),重复 `__enter__` 先清旧句柄。
|
|
102
|
+
|
|
103
|
+
### 口径收口:同一份指纹只留一个真源
|
|
104
|
+
|
|
105
|
+
- `reconcile._disk_hashes` 二元组收单值(#758);
|
|
106
|
+
- `twophase` 指纹与索引条目同源(#759,`_norm` 降为 legacy 兼容);
|
|
107
|
+
- 验证态继承改用索引 `content_hash` 比对、**不再读盘**(#757,撤 #352 §B 绕行)。
|
|
108
|
+
|
|
109
|
+
### 修复:scrub 把正文引用行当成断言键(误判矛盾)
|
|
110
|
+
|
|
111
|
+
- 键里出现括号类标点即不是字段名;值以 `src_/ref_/doc_` 开头不算可断言值;
|
|
112
|
+
- **注**:`…(源:src_x)` 的真凶是「`…(源`」这个**带括号前缀键**,不是单字「源」(后者被长度闸过滤)。
|
|
113
|
+
|
|
114
|
+
### 已知限制
|
|
115
|
+
|
|
116
|
+
- `cg(op=recall)`(预算装包路径)尚未接线 `strict_conditions`;
|
|
117
|
+
- `health_os()` 自身耗时未优化,仅被 `full=true` 挡在主路径外;
|
|
118
|
+
- scrub 的 `contradiction` 仍按字面键值比对,语义改写类误判只能靠「键形态」收敛,无法根除。
|
|
7
119
|
## [0.9.22] - 2026-11-03
|
|
8
120
|
|
|
9
121
|
### 修复:`cg(op=write)` 静默丢弃 `aliases`(issue #722,用户实测)
|