Repository navigation
Releases: kiefeng/dsh-lan-memory
Release list
v2.10.1 — experience candidate consolidation
v2.10.1 — experience candidate consolidation
Fixed
- New candidates no longer repeat accepted lessons. The profile prompt now receives the accepted experience list and the pending candidate queue, with an explicit rule to return an empty candidate when it is merely a paraphrase.
- Pending candidates can be consolidated in one click. The Experience tab shows 整理候选 when more than one candidate is pending; the model merges semantic duplicates, keeps the fullest wording, and drops candidates already covered by accepted experience.
- Consolidation only edits the pending queue. It never writes
experience.jsonlautomatically; dismissed entries stay dismissed. - The profile merge prompt now uses the same most-recent-80-facts window it advertises.
Verification
72 node:test checks pass, including a new case for model-driven candidate consolidation. node --check passes on the client and host modules.
Upgrade
Restart DSH Desktop so the host half loads 2.10.1; then refresh the settings page. The current 4 pending candidates can be cleaned with 经验 → 整理候选.
v2.10.0 — fact merge preview + experience candidates
v2.10.0 — fact merge preview + experience candidates
Fact consolidation
- The memory tab now exposes 合并相似事实 / merge similar facts.
- The preview is computed locally with the existing CJK bigram similarity (≥0.85), no model call.
- Each suggested cluster shows the canonical (longest) fact and how many entries it would merge.
- Applying a cluster keeps the longest fact, merges its tags, and tombstones the rest so the next compile cannot resurrect them.
- Snapshots now cover facts, tombstones, and all four profile sections, so 撤销上次整理 restores them together.
Experience candidates
- Compiling the profile now also asks the model for at most 0–1 reusable lesson/method (not user facts, not a diary).
- Candidates are stored in
experience-candidates.json; nothing entersexperience.jsonlautomatically. - The Experience tab shows pending candidates with 接受 / 忽略.
- Dismissed candidates are marked
dismissedand are deduplicated against later compiles, so they do not keep reappearing.
Verification
71 node:test checks pass, including new cases for fact clustering/merge/undo, candidate accept/dismiss, and API authorization. node --check passes on the client and host modules.
Upgrade
Restart DSH Desktop to load the host changes; the settings page is a client bundle and updates on refresh after the host is current.
v2.9.0 — consistency pass
v2.9.0 — consistency pass
A focused pass over feature boundaries, settings, and the compile pipeline. No new memory layer.
Fixed
- Dead UI removed — the old single-page
SettingsPage(about 14 KB, iframe/panel links) was unreachable since the tabbed page landed. It is gone; only the six-tab settings page remains. - Manual profile edits survive —
readMemoryProfile()now parsesmemory.mdback into the four compiled sections. Editing the file by hand no longer lets the next compile or daily rollover overwrite it from a stale in-memory copy. - Deleting a manual memory is consistent —
store.deleteMemory()now tombstones and removes same-text automatic facts, so the settings UI, HTTP API, andlan_forgetbehave alike and the profile cannot resurrect the fact. - Settings API allowlist matches the settings — added
maxManualBytes,maxEntryChars,maxPinnedEntryChars,journalPendingDays,journalPendingMax; removed unusedautoOrganize/organizeThreshold. - Idle compile actually fires — when a batch is below the count threshold, the compiler now reschedules for the moment the oldest item reaches
compileIdleMinutes, instead of checking once and never retrying. - Settings UI covers scheduling — the maintenance tab exposes the compile threshold and idle minutes, with
ifMatchprotection. - Docs and storefront — settings screenshot regenerated for the six-tab UI; the obsolete panel contract moved to
docs/legacy/;lan_recalldescription includes the automatic-fact layer.
Verification
68 node:test checks pass, including new cases for manual profile parsing, settings allowlist writes, manual-memory deletion tombstones, and idle rescheduling. node --check passes on the client and host modules.
Upgrade
Restart DSH Desktop to load the host changes; the settings page is a client bundle and updates on refresh after the host is current.
v2.8.2 — compile stability
v2.8.2 — compile stability and data hygiene
The live 2.8.1 run showed one failed profile compile: the model’s JSON was cut off, the local fallback then wrote raw user questions into today / week.
Fixes
- Profile compile output budget: 4096 → 8192 tokens; facts input 80 → 50 entries.
- Truncated JSON is salvaged field-by-field (
facts/today/week/longterm) instead of discarded wholesale. - Local fallback no longer copies raw user turns into
today/week; it preserves existing sections and only merges facts. health.panelis now alwaysfalse;health.apireports whether the API route is mounted.- 64 tests pass.
Note
Host-side change: restart Desktop to load v2.8.2.
v2.8.1 — docs and legacy panel cleanup
v2.8.1 — docs and legacy panel cleanup
- README rewritten around the current shape: four memory layers (pinned / manual / facts / experience), rolling summary → facts → profile, daily boundary, tombstones, six-tab settings page, no standalone panel.
ui/panel.htmland the panel loader removed./lan-memory/now returns 404; REST API routes remain.cordis.patch.yml,docs/design.md,docs/panel-contract.mdupdated to mark the old panel as historical.- Dev server root redirects to
/lan-memory/api/state. - 64 tests still pass.
v2.8.0 — management cleanup
v2.8.0 — management cleanup
Experience is its own tab
- Tabs: 概览 / 记忆 / 经验 / 收件箱 / 人格 / 维护.
- The 记忆 tab now contains only profile, automatic facts, manual memory, and pinned; experience moved out because it is not user memory and never enters the profile.
Edit in place
- Manual memory, pinned entries, and experience can be edited directly, not just deleted and recreated.
No legacy panel
- The
/lan-memory/HTML route is removed;state.panelUrlisnull. - Settings is the only management surface. API routes remain.
Deleted facts stay deleted
- Deleting an automatic fact writes a normalized tombstone to
fact-tombstones.json. - Subsequent compiles skip that exact text, so it cannot be re-added from a summary.
- Manually adding the same fact removes its tombstone.
Tests
64 node:test checks pass, including the tombstone and manual-memory boundary assertions.
v2.7.0 — memory layer boundaries
v2.7.0 — memory layer boundaries
The counts and the memory tab no longer disagree about what a “memory” is.
Four layers
- 常驻 / pinned — always injected, highest priority; identity and hard constraints only.
- 手动记忆 / memory — things the user explicitly asked to remember; injected every turn via
lan:manual, editable, never auto-created. - 自动事实 / facts — model-extracted from summaries; participates in the compiled profile; editable; never mixed into
memory. - 经验 / experience — reusable methods and lessons; recall-only, never part of the user profile.
memory.md remains the compiled profile, not a fifth input layer.
Behavior changes
lan_remember(layer=memory)no longer copies the entry intofacts.lan_recallseparatesmemory,fact, andexperience; a fact search cannot hit manual memory and vice versa.- Added the
lan:manualcontext, so manual memory does not depend on a recall call. - Settings overview now shows 常驻 / 手动记忆 / 自动事实 / 经验 / 待编译, matching five sections.
- Memory tab splits into: profile, automatic facts, manual memory, pinned, experience, each with its own inclusion rule.
Tests
63 node:test checks pass, including the boundary assertion that manual memory leaves facts empty.
v2.6.0 — tabbed settings page
v2.6.0 — one settings page, tabbed
The standalone panel and the settings page had drifted apart. The settings page now covers the management surface, in tabs.
Tabs
- 概览 — counts, quick actions, runtime/compile status, capture/auto-compile switches.
- 记忆 — compiled profile editor, automatic facts (add/edit/delete), manual memory / pinned / experience lists with add/delete.
- 收件箱 — journal history, status, promote/dismiss actions; normal use does not require it.
- 人格 — SOUL and MOOD contract editors with backup on save.
- 维护 — data directory, backups list with restore, JSON export, model/provider and privacy note.
Other
- The "打开管理面板" entry is gone; the legacy panel route remains only for compatibility.
- Export now includes facts, summaries, memory profile, and compile status.
- 63
node:testchecks pass.
Note
Host-side changes (settings API/export) require a Desktop restart; the tabbed settings UI loads on page refresh.
v2.5.0 — memory management closeout
v2.5.0 — memory management closeout
Daily boundary
- On the first compile of a new logical day, the previous
todayis moved intoweek(### YYYY-MM-DD) andtodayis cleared before new activity is compiled. - No extra model call; this is deterministic state maintenance.
Facts management
- Settings → 澜记忆 now lists automatic facts with add / edit / delete controls.
- New
POST /api/factsactions:add,update,delete; every change schedules a forced recompile. lan_listandlan_forgetacceptlayer=fact.
Model and privacy
- Settings page exposes
memoryProviderandmemoryModelfields; blank means use the DSH default. - The page states clearly that automatic compilation sends journal/summary text to the selected model provider, while capture stays local.
- 63
node:testchecks pass.
Note
Host-side change: restart Desktop to load v2.5.0; the current settings-page client loads on refresh.
v2.4.7 — rolling summary layer
v2.4.7 — rolling summary layer
This closes the biggest structural gap with Hanako: memory no longer extracts facts directly from raw journal text on every pass.
Pipeline
- Rolling summary — merge the previous per-session summary with new journal records into 3–6 sentences (max 300 chars), stored in
summaries.json. - Atomic facts — extract from the summary; fall back to raw journal if the summary call fails.
- Profile compile — merge facts + recent summaries into
facts / today / week / longtermandmemory.md.
Behavior
today/weeknow use the summary as recent activity instead of raw turn-by-turn text.- Summary output has status-pool tags stripped.
- Failures degrade: summary failure → raw journal extraction; extraction failure → local fallback; nothing is discarded.
- 62
node:testchecks pass.
Note
Host-side change: applies on the next Desktop restart or manual compile after loading v2.4.7.