feat(memory): add hybrid memory foundation - #1263
Merged
Merged
Conversation
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary / 概要
Why / 背景
Kun previously had a basic file-backed memory surface, but it did not provide the lifecycle, scope isolation, diagnostics, ranking evidence, or recovery guarantees needed for dependable long-lived memory. This change establishes those P0 contracts without introducing semantic/vector retrieval or making the native index a new source of truth.
The implementation was rebased onto
develop@53fc235b, after #1257 and #1260 landed. That keeps the Memory work on top of the current quality and cross-platform packaging baseline.Architecture and behavior / 架构与行为
Canonical records and backward compatibility
type,authority,importance, evidence sources, temporal validity, disabled/deleted lifecycle fields, and audit timestamps.Hybrid storage and recovery
ready.file://paths from degraded reasons while retaining useful platform/ABI diagnostics.Retrieval and safety
Settings UI and portable import/export
[0,1]validation.kun-memory-v2block for portable round-trip of business fields, bounded sources, temporal fields, expiry, and disabled state.Backward-compatibility guarantees / 向后兼容保证
Media / 截图或录屏
Tests / 测试
Local validation after the final rebase:
npm run lint: 0 errors (30 pre-existing React Hooks warnings).npm run check:file-lines: 6,659 tracked files passed the 700-line gate.npm run typecheck: passed.npm run build:kun: passed.npm run build: passed.openspec validate add-kun-memory-foundation --strict: passed.git diff --check: passed.Windows-local aggregate notes:
npm testreaches two upstream-identical, non-Memory Windows/POSIX harness assertions: NTFS does not expose the asserted0700directory mode, and the daily workflow test invokes/bin/bashwithout a Windows-visiblenode.Validation / 验证
npm run test— local component suites passed; awaiting this PR's Ubuntu Quality job for the standard aggregate command.npm run typechecknpm run buildnpm run dev(real-Electron acceptance completed)Review guidance / 评审提示
The change is organized as four commits:
feat(memory): add hybrid memory foundationfix(memory): complete foundation recovery gatesfix(memory): close foundation UI acceptance gapsdocs(memory): record final rebase validationThe OpenSpec proposal, design, two capability specs, task checklist, bilingual architecture documentation, and reproducible retrieval evaluation are included in the diff. Please pay particular attention to scope filtering, tombstone behavior, legacy normalization, V2 import validation, and degraded/recovery semantics.