dsh-prime-memory 0.25.0 → 0.26.0

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 CHANGED
@@ -7,6 +7,23 @@
7
7
 
8
8
  This file covers the **0.12.0** release notes and the current **unreleased** changes in English. For the full history, see [CHANGELOG.md](./CHANGELOG.md) (Chinese).
9
9
 
10
+ ## [0.26.0] — 2026-10-14
11
+
12
+ ### Added
13
+
14
+ - **Existing-memory re-distillation reshaping (`redistill`)**: new independent batch scan `src/redistill-backfill.ts` (mirrors wing/keyword backfill: single-flight / background / bounded / failures leave records untouched) rewrites the body of **active, skeleton-incomplete** L1 records into the G2 per-type "cause→effect" sectioned form, and produces `metadata.dsh_keywords` / `metadata.dsh_usage_scenario` in the same pass. New endpoint `dsh-memory/redistill-backfill` (returns `{started,running,enabled,updated,skipped,failed}` immediately); a "Re-distill & Reshape" button in the WingWheel panel. Config `redistill.enabled` defaults **off** — off means no reshaping and content/FTS/projection byte-for-byte unchanged (zero drift).
15
+ - **Quality gate**: writes back only when the reshaped body's `scoreSkeleton` hit count is **strictly better**, and stamps the reshape version `dsh_reshape_ver` (excluded from later runs); otherwise it keeps the original **unstamped** so it stays eligible for a retry — never fakes a label or fabricates content just to "look structured".
16
+ - **Active only**: retired/superseded records are not touched.
17
+ - **Durable write-back for content edits**: reshaping writes via `L1Store.appendNew`, which in one shot appends to the JSONL fact source, recomputes the embedding, re-indexes `l1_fts`, and overwrites the `.memory.md` projection (the exporter re-renders from the DB and overwrites on any difference). Entry requires `vectorsReady()` — the whole run is skipped when embeddings aren't ready, to avoid silently dropping a record's vector.
18
+ - **`dsh-memory/records-meta` endpoint**: batch lookup (≤50) by `record_id` returning full metadata *and* body (name/type/priority/content/maturity/createdAt/updatedAt/scene/scope/workspaceId/keywords/usageScenario/filePath/retired) straight from SQLite via `stores.l1.getByIds`. The memory viewer therefore **no longer reads `.memory.md` files** — the earlier fileViewer approach (a fake `<id>.memory` path) was resolved by the host's EditorHost as a physical file and always hit ENOENT. Contract lives in `contract.ts`; endpoint count 62→63 (`tests/contract-keys.test.ts` pins it).
19
+ - **Display titles stop guessing from the body**: `memoryRecall` and slot `refViews` prefer the record's `name` (the short title the name-distillation produces) and only fall back to the first body line. `firstLine()` is now markdown-aware: H1 (`# xxx`) is a document title and is kept, H2+ (`## Findings`) is a section marker and is skipped — previously `## Findings` was rendered as the memory's "name" although it is plainly body text.
20
+ - **Single source of truth for projection paths, `relPathFor()`**: `renderRecord` (disk write), `records-meta`'s `filePath` and slot `refViews.filePath` now share one algorithm. The projection had copied its own sanitizing regex, so a single record could yield two different file names — the address the projection reports would not match the file on disk, which is exactly what those three consumers exist to cross-check. `refViews` also carry `filePath`/`workspaceId` so callers can build `<workspaceId>/.agents/memory/<filePath>` (workspace scope) or resolve against the projection root (global).
21
+ - **Markdown-rendered bodies in the records panel** (client): expanded record bodies go through the new `client/src/ui/MarkdownBody.tsx` (heading levels / bold / inline code / lists, zero external deps), so `## Findings` is no longer a bare line of text.
22
+
23
+ ### Fixed
24
+
25
+ - **`client-session-recalled-bundle` regression guard**: after 0.25.0 handed the pill's "this-session recalled" rendering to dsh-brief-sidebar, this test still asserted the pill contained the recalled strings (missed in that release). Now asserts the prime-memory pill does **not** re-render recalled, keeping the projection-wiring assertions.
26
+
10
27
  ## [0.25.0] — 2026-10-14
11
28
 
12
29
  ### Added
package/CHANGELOG.ja.md CHANGED
@@ -9,6 +9,24 @@
9
9
 
10
10
  本ファイルは **0.12.0** リリースノートと現在の**未リリース**変更の日本語版です。全履歴は [CHANGELOG.md](./CHANGELOG.md)(中文)を参照してください。
11
11
 
12
+ ## [0.26.0] — 2026-10-14
13
+
14
+ ### 追加
15
+
16
+ - **`dsh-memory/records-meta` 端点**:`record_id` の一括照会(≤50)で単条記憶の全量メタデータ+本文(name/type/priority/content/maturity/createdAt/updatedAt/scene/scope/workspaceId/keywords/usageScenario/filePath/retired)を `stores.l1.getByIds` で SQLite から直接返す。記憶ビューアはこれで **`.memory.md` を読まなくてよい**——以前の fileViewer 方式(`<id>.memory` を偽装)は宿主 EditorHost に物理パスとして解決され必ず ENOENT。契約は `contract.ts`、端点数 62→63(`tests/contract-keys.test.ts` が固定)。
17
+ - **表示タイトルを本文から推測しない**:`memoryRecall` と槽位 `refViews` の title は `name`(名称蒸留の短題)を優先し、無い時だけ本文先頭行へ回退。`firstLine()` は markdown 対応になり、H1(`# xxx`)は文書タイトルとして保持、H2+(`## 結論/事実`)は分節マーカーとしてスキップ——以前は明らかに本文の `## 結論/事実` が記憶「名称」として表示されていた。
18
+ - **投射パスの単一事実源 `relPathFor()`**:`renderRecord`(ディスク書込)、`records-meta` の `filePath`、槽位 `refViews.filePath` の三箇所が同一アルゴリズムに集約。以前は投射側が独自のサニタイズ正規表現を写しており、同一記憶から二つの異なるファイル名が生じ得た——投射が示すアドレスとディスク上の実ファイルが一致せず、まさにこの三箇所が照合すべき事実そのもの。`refViews` は `filePath`/`workspaceId` も透出し、消費側は `<workspaceId>/.agents/memory/<filePath>`(workspace 範囲)または投射ルート(global)で絶対パスを組む。
19
+ - **検索パネルの本文を markdown 化**(client):RecordsTab の展開本文は新し `client/src/ui/MarkdownBody.tsx`(見出し階層 / 太字 / インラインコード / リスト、外部依存ゼロ)を経由し、`## 結論/事実` は裸のテキスト行ではなくなる。
20
+
21
+ - **既存記憶の再蒸留整形(`redistill`)**:独立バッチスキャン `src/redistill-backfill.ts`(wing/keyword 回填を镜像:単飛/後台/有界/失敗時原記録不変)が、**アクティブかつ骨格不全**の L1 本文を G2 類型別の「前因後果」分節形式に再編し、同時に `metadata.dsh_keywords` / `metadata.dsh_usage_scenario` を産出。新端点 `dsh-memory/redistill-backfill`(`{started,running,enabled,updated,skipped,failed}` を即返)、パネル(WingWheel)に「再蒸留整形」ボタン。設定 `redistill.enabled` はデフォルト**关**——关時は整形せず content/FTS/投射が逐字不変(ゼロドリフト)。
22
+ - **品質ゲート**:整形後 `scoreSkeleton` の命中数が**厳密に優れる**時だけ書き戻し、整形バージョン `dsh_reshape_ver` を刻印(次回以降は対象外);未達なら原文を残し**刻印せず**、次回も再試行可能——「見かけ上フォーマット付き」のために偽ラベルを貼ったり捏造したりは一切しない。
23
+ - **アクティブのみ**:退場/取代会済みは対象外。
24
+ - **本文変更の永続書込経路**:整形の書込は `L1Store.appendNew` を経由し、JSONL 事実源追記 + 埋め込み再計算 + `l1_fts` 再インデックス + `.memory.md` 投射上書き(エクスポータは库から再レンダし差分があれば上書き)を一度に完了。入口は `vectorsReady()` を要求——埋め込み未就绪時はラン全体をスキップし、ベクトルの静默消失を防ぐ。
25
+
26
+ ### 修正
27
+
28
+ - **`client-session-recalled-bundle` 回帰ガード**:0.25.0 で「本会話召回」の pill レンダリングを dsh-brief-sidebar へ移管した後、このテストは依然 pill に召回文字列があると主張していた(リリース時の更新漏れ)。現在は prime-memory pill が召回を**重複レンダリングしない**ことを主張し、投影接線の主張は保持。
29
+
12
30
  ## [0.25.0] — 2026-10-14
13
31
 
14
32
  ### 追加
package/CHANGELOG.ko.md CHANGED
@@ -9,6 +9,24 @@
9
9
 
10
10
  이 파일은 **0.12.0** 릴리스 노트와 현재 **미출시** 변경 사항의 한국어판입니다. 전체 이력은 [CHANGELOG.md](./CHANGELOG.md)(中文)를 참조하세요.
11
11
 
12
+ ## [0.26.0] — 2026-10-14
13
+
14
+ ### 신규
15
+
16
+ - **`dsh-memory/records-meta` 엔드포인트**: `record_id` 일괄 조회(≤50)로 단일 기억의 전량 메타데이터와 본문(name/type/priority/content/maturity/createdAt/updatedAt/scene/scope/workspaceId/keywords/usageScenario/filePath/retired)을 `stores.l1.getByIds` 로 SQLite 에서 직접 반환。기억 뷰어는 이로써 **`.memory.md` 를 읽지 않아도 됨**——이전의 fileViewer 방식(`<id>.memory` 위장)은 호스트 EditorHost 가 물리 경로로 해석해 반드시 ENOENT。계약은 `contract.ts`, 엔드포인트 수 62→63(`tests/contract-keys.test.ts` 고정)。
17
+ - **표시 제목을 본문에서 추정하지 않음**: `memoryRecall` 과 슬롯 `refViews` 의 title 은 `name`(명칭 증류가 만든 짧은 제목)을 우선하고, 없을 때만 본문 첫 줄로 회퇴。`firstLine()` 은 markdown 인지 방식으로 바뀌어 H1(`# xxx`)은 문서 제목으로 보존, H2+(`## 결론/사실`)는 분절 마커로 건너뜀——이전에는 명백히 본문인 `## 결론/사실` 이 기억 “이름”으로 표시됨。
18
+ - **투사 경로의 단일 사실원 `relPathFor()`**: `renderRecord`(디스크 기록), `records-meta` 의 `filePath`, 슬롯 `refViews.filePath` 세 곳이 동일 알고리즘으로 수렴。이전은 투사 측이 자체 정제 정규식을 옮겨 같은 기억에서 두 개의 다른 파일명이 나올 수 있었음——투사가 알려준 주소와 디스크의 실제 파일이 맞지 않는데, 이 세 곳이야말로 사람을 위해 같은 사실을 대조하는 자리다。`refViews` 는 `filePath`/`workspaceId` 도 노출하여 소비자는 `<workspaceId>/.agents/memory/<filePath>`(workspace 범위) 또는 투사 루트(global)로 절대 경로를 조립。
19
+ - **검색 패널 본문의 markdown 렌더**(client): RecordsTab 펼침 본문은 새로 생긴 `client/src/ui/MarkdownBody.tsx`(제목 계층 / 굵게 / 인라인 코드 / 목록, 외부 의존성 없음)를 거치며, `## 결론/사실` 이 맨 텍스트 줄로 보이지 않음。
20
+
21
+ - **기존 기억 재증류 성형(`redistill`)**: 독립 일괄 스캔 `src/redistill-backfill.ts`(wing/keyword 백필 미러: 단일비행/후대/유계/실패시 원 기록불변)가 **활성이고 골격 불비**인 L1 본문을 G2 유형별 “전인후과” 분절 형식으로 재배열하고, 동시에 `metadata.dsh_keywords` / `metadata.dsh_usage_scenario` 를 산출。新 엔드 `dsh-memory/redistill-backfill`(`{started,running,enabled,updated,skipped,failed` 즉시 반환), 패널(WingWheel)에 “재증류 성형” 버튼。설정 `redistill.enabled` **기본关**——关 시 성형 없음、content/FTS/투사 글자 그대로 동일(영 드리프트)。
22
+ - **품질 게이트**: 성형 후 `scoreSkeleton` 적중 수가 **엄격히 우수**할 때만 기입하고 성형 버전 `dsh_reshape_ver` 를 찍어(이후 회차 제외), 미달이면 원문을 보존하고 표시를 남기지 않아 다음 회차에 재시도 가능——“겉보기 형식”을 위해 거짓 라벨이나 날조를 일체 하지 않음。
23
+ - **활성만**: 퇴장/대체됨 기록은 대상 외。
24
+ - **본문 변경의 지속 기입 경로**: 성형 기입은 `L1Store.appendNew` 를 경유해 JSONL 사실원 추기 + 임베딩 재계산 + `l1_fts` 재인덱싱 + `.memory.md` 투사 덮어쓰기(exporter 는库에서 재렌더, 다르면 덮어씀)를 한 번에 완료。입구는 `vectorsReady()` 를 요구——임베딩 미준비 시 런 전체를 건너뛰어 벡터의 조용한 소실을 방지。
25
+
26
+ ### 수정
27
+
28
+ - **`client-session-recalled-bundle` 회귀 가드**: 0.25.0 에서 “본 대화召回” pill 렌더링을 dsh-brief-sidebar 에 넘긴 후, 이 테스트는 여전히 pill 에召回 문자열이 있다고 주장(발판 시 누락)。이제는 prime-memory pill 이召回를 **중복 렌더링하지 않음**을 주장하고, 투사 배선 주장은 보존。
29
+
12
30
  ## [0.25.0] — 2026-10-14
13
31
 
14
32
  ### 신규
package/CHANGELOG.md CHANGED
@@ -17,6 +17,25 @@
17
17
  - **建议状态(`longtask-hint-get`)以纯端点提供**:判定 = 上下文占用达 `contextThresholdPct` 或 todo 漂移达 `driftThreshold`(部署配置可调);配合 `longtask-compress-tail` 作手动压缩入口。
18
18
  - **撤下浮动球 UI(`client/src/longtask-fab.ts`;beta.1 起曾随包发布)**:悬浮建议面板的归属本在 context-compression 侧(「建议启动压缩」是其领域),pm 属误载——2026-10-02 用户裁定撤下。撤下不违座位契约(settings.section 恰一个 + 输入栏 pill,body 单例不占座位),但全应用级 overlay 会与其他插件的悬浮 UI 抢占屏幕角落;长任务开关与手动压缩入口待长任务定版时落记忆设置分节。
19
19
  - **`session-mode-set` 的 `mode` 转为可选**:与 `longTask` 二选一必传——纯切长任务开关不再被迫发送档位(旧客户端恒传 mode,行为不变)。响应 `mode` 改回当前生效值。
20
+
21
+ ## [0.26.0] — 2026-10-14
22
+
23
+ ### 新增
24
+
25
+ - **存量记忆重蒸馏整形(`redistill`)**:新增独立回填批扫 `src/redistill-backfill.ts`(镜像 wing/keyword 回填:单飞/后台/有界/失败原记录不动),把**活跃且骨架不齐备**的存量 L1 正文按 G2 分类型「前因后果」骨架重排,并顺带产 `metadata.dsh_keywords` / `metadata.dsh_usage_scenario`。新端点 `dsh-memory/redistill-backfill`(立即返回 `{started,running,enabled,updated,skipped,failed}`)、面板(WingWheel)加「重蒸馏整形」按钮。配置 `redistill.enabled` **默认关**——关时不整形、content/FTS/投射逐字不变(零漂移)。
26
+ - **质量闸**:只有整形后 `scoreSkeleton` 骨架命中数**严格更优**才写回,并盖整形版本戳 `dsh_reshape_ver`(下轮不再入列);未过闸的留原文**不打标记**、下轮仍可重试——绝不为「看起来有格式」贴假标签或编造。
27
+ - **只碰活跃**:已退场/被取代的记录不补做优化。
28
+ - **改正文的持久写回路径**:整形写回走 `L1Store.appendNew`,一次完成 JSONL 事实源追加 + 重算 embedding + `l1_fts` 重索引 + `.memory.md` 投射覆盖(导出器按库重渲染、不同即覆盖),保证「库改了、检索/向量/磁盘同步跟上」。入口要求 `vectorsReady()`——嵌入未就绪时整轮跳过,避免改正文静默丢向量。
29
+
30
+ - **`dsh-memory/records-meta` 端点**:按 `record_id` 批量(≤50)取单条记忆的全量元数据与正文(name/type/priority/content/maturity/createdAt/updatedAt/scene/scope/workspaceId/keywords/usageScenario/filePath/retired),走 `stores.l1.getByIds` 直读 SQLite。记忆查看器因此**不需要读 `.memory.md` 文件**——旧方案(伪装文件名的 fileViewer)会被宿主 EditorHost 当物理路径 fsRead,必报 ENOENT。契约入 `contract.ts`,端点集 62→63(`tests/contract-keys.test.ts` 同步钉数)。
31
+ - **展示标题不再从正文猜**:召回投影 `memoryRecall` 与槽位 `refViews` 的 title 优先取 `name`(名称蒸馏产出的短标题),无 `name` 才回落正文首行。`firstLine()` 改为 markdown 感知:H1(`# xxx`)是文档标题保留作标题,H2+(`## 结论/事实`)是分节标记一律跳过——此前 `## 结论/事实` 会被当成「记忆名称」显示,而它明显是正文。
32
+ - **投射路径单一事实源 `relPathFor()`**:`renderRecord` 写盘、`records-meta` 的 `filePath`、槽位 `refViews.filePath` 三处收敛到同一算法。此前投影里另抄了一份清洗正则,同一条记忆会算出两个不同文件名——「投影给的地址」与「磁盘上的真文件」对不上,而这三处本就是给人核对同一事实的。`refViews` 同时透出 `filePath`/`workspaceId`,消费方按 `<workspaceId>/.agents/memory/<filePath>`(workspace 范围)或投射根(global)拼绝对地址。
33
+ - **检索面板正文 markdown 化**(client):RecordsTab 展开详情走新增的 `client/src/ui/MarkdownBody.tsx`(heading 层级 / 粗体 / 行内代码 / 列表,零外部依赖),`## 结论/事实` 不再是一行裸文本。
34
+
35
+ ### 修复
36
+
37
+ - **`client-session-recalled-bundle` 回归守卫**:0.25.0 把「本会话召回」pill 渲染移交 dsh-brief-sidebar 后,该测试仍断言 pill 含召回串(发版时漏更)。改为断言 prime-memory pill **不**再重复渲染召回,保留投影接线断言。
38
+
20
39
  ## [0.25.0] — 2026-10-14
21
40
 
22
41
  ### 新增