feat(runtime): combine global profile with workspace memory - #103
Merged
Conversation
Grivn
force-pushed
the
codex/issue-77-composite-storage-scope
branch
2 times, most recently
from
August 27, 2026 14:02
a673669 to
b5ea8ac
Compare
Grivn
force-pushed
the
codex/issue-77-composite-storage-scope
branch
from
August 27, 2026 15:09
b5ea8ac to
2f666f3
Compare
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
新增独立的
runtimeUserScope,允许全局 USER.md 用户档案与工作区/自定义根中的 MEMORY.md 项目记忆同时投影和维护。默认仍让 USER.md 跟随storageScope;设置页新增明确的双选项,并同步更新双语文档与设置截图。Adds an independent
runtimeUserScopeso a global USER.md profile can be projected and maintained together with project MEMORY.md from a workspace or custom root. The default still followsstorageScope; the Web settings surface, bilingual documentation, and settings screenshot now expose the opt-in split scope.关联 Issue 或背景 / Related Issue or Context
Closes #77
涉及区域 / Affected Areas
PR 类型 / PR Type
最新代码确认 / Latest Codebase Confirmation
main分支开发,或在提交前已 rebase 或合并最新main。 / I developed from the latestmain, or rebased or merged the latestmainbefore submitting.同步命令 / Sync command:
git fetch origin --prune && git rebase origin/mainAI 编码披露 / AI Coding Disclosure
使用的 AI 模型 / AI model used: OpenAI GPT-5 Codex
使用的编码 Agent 工具 / Coding Agent tool used: Codex
仓库规范检查 / Repository Rules
@deepseek-ai/*NPM 契约。 / I did not modify DSH source or point tsconfig at a DSH source checkout, and used only published@deepseek-ai/*NPM contracts.src/shared/contracts.ts为准,没有在两侧重复定义 wire DTO。 / The Client and Host boundary still usessrc/shared/contracts.tsas the single source for wire DTOs.lib/文件。 / I did not commit tokens, credentials, private memory, unredacted logs, or generatedlib/files.兼容性与数据安全 / Compatibility and Data Safety
runtimeUserScope默认为storage,因此现有安装、全局模式与旧配置保持原行为。选择global时,有效 Runtime 仅组合全局事实源的target=user与所选项目事实源的target=memory;用户写入及 USER 压缩只写全局根,项目写入及 MEMORY 压缩只写项目根。两个memories.json及其 Markdown 投影均保持原格式,不复制、不合并、不删除;切回默认模式即可重新看到所选根原有的 USER 条目。工作区 Mnemon Pack 不会带入独立的全局 USER,避免跨项目备份泄漏;全局档案需要单独备份。回滚到旧版本时,新键被忽略,磁盘数据仍完整可读。runtimeUserScopedefaults tostorage, preserving every existing installation, global mode, and legacy configuration. Inglobalmode, the effective Runtime combines onlytarget=userfrom the global source withtarget=memoryfrom the selected project source. User writes and USER compaction route only to the global root; project writes and MEMORY compaction route only to the project root. Bothmemories.jsonfiles and Markdown projections retain their existing format, with no copy, merge, or deletion; switching back reveals the selected root's original USER entries. A workspace Mnemon Pack excludes the separate global USER to avoid cross-project backup leakage, so the global profile must be backed up separately. Older versions ignore the new key and all on-disk data remains readable.本地验证 / Local Validation
执行的命令 / Commands run:
结果摘要 / Result summary:
publint --strict, and AreTheTypesWrong passed.用户可见变更证据 / Local Feature Evidence
证据 / Evidence:
在隔离的 DSH Web profile、临时
DSH_HOME、临时MNEMON_DATA_DIR和临时工作区中运行本分支。左图是 v0.3.3main只有单一“记忆范围”的设置页;右图是本 PR 已保存并实时生效的“工作区 + 全局用户档案”,新增的独立范围清晰可见。保存后 Host 同时将 Mnemon Native 标记为工作区范围,设置状态显示“已保存并实时生效”。页面控制台无 warning/error;截图不含凭据、私有记忆或敏感路径。The branch ran in an isolated DSH Web profile with temporary
DSH_HOME,MNEMON_DATA_DIR, and workspace. The left image is v0.3.3main, where settings expose only one Memory scope. The right image is this PR with the saved, live Workspace + Global user profile selection and its new independent scope. After Save, the Host also reported Mnemon Native as workspace-scoped and the settings status confirmed the live update. The browser console had no warnings/errors; screenshots contain no credentials, private memory, or sensitive paths.main: 单一范围 / one scope