fix(ragfs): enforce mount containment and write-flag semantics in LocalFS (#3402)
- fix(ragfs): enforce mount containment and write-flag semantics in LocalFS
Sweep findings: E-01, E-04. Reject lexical traversal and honor LocalFS write contracts.
- fix(review): reject absolute localfs remainders
Addresses blocking review finding on #3402.
- fix(ragfs): close LocalFS glob mount-escape gap
LocalFS::glob_directory only called validate_virtual_path(path), which rejects
..but accepts an absolute remainder. A//-double-slash mount path (e.g./local//etc) survives normalize_path, and find_mount hands the remainder//etcto glob_directory; validate_virtual_path passes it (components are [RootDir, Normal(“etc”)], no ParentDir), and glob_via_walk’s resolve_virtual_path strips one slash to/etcand joins it over the base — an absolute join that overrides the base and lists the host directory.Every other op (read/write/stat/rename/remove/grep) routes through resolve_path, which adds the is_absolute check. glob now calls the same resolve_path guard (discarding the returned PathBuf) so it shares the containment contract. Directory-listing info leak only; content reads were already covered.
Adds test_localfs_glob_mount_rejects_absolute_remainder mirroring the read regression test.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01RbWx1T81KkNV4nucxWsPXZ
Co-authored-by: Claude Opus 4.8 (1M context) noreply@anthropic.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
OpenViking:AI 智能体的上下文数据库
English / 中文 / 日本語
官网 · 在线体验 · GitHub · 问题反馈 · 文档
👋 加入我们的社区
📱 飞书群 · 微信群 · Discord · X
OpenViking 是什么
OpenViking 是面向 AI 智能体的开源上下文数据库。记忆、资源、技能统一存放在
viking://协议下的虚拟文件系统里,智能体用ls、tree、find浏览自己的上下文,不必去查一个黑盒向量库。内容写入时会处理成三层——L0 摘要、L1 概览、L2 详情——按需加载。每次检索都留下轨迹,可以查看,也可以调试。完整介绍见入门文档。OpenViking Studio 实验场——在线 Demo,打开浏览器就能试,无需安装。
为什么用 OpenViking
viking://URI。智能体像开发者操作文件一样,确定地定位和操作上下文。→ Viking URI · 上下文类型各部分如何配合:见架构。设计思路:The Database Paradigm for Context Engineering(页内可切换中文)。
三个加载层级:
每个目录都带自己的 L0/L1 层,读完整文件之前就能判断相关性:
评测结果
OpenViking 0.3.22 的评测覆盖长对话用户记忆(LoCoMo)和多轮智能体任务(tau2-bench)。完整结果和实验设置(含知识库问答)见评测报告,复现脚本在 ./benchmark。
快速开始
需要 Python 3.10 或更高版本。
或者在后台运行:
init引导你完成提供商配置,并写入~/.openviking/ov.conf。它支持火山引擎、OpenAI、Codex OAuth、Kimi、GLM 和本地 Ollama——选 Ollama 时还能检测并安装运行时,按你的硬件拉取合适的模型。doctor检查配置文件、Python 版本、提供商连通性和磁盘空间,不需要先启动服务器。手写
ov.conf的模板、各提供商示例、环境变量、Windows 配置和 CLI/客户端配置,见配置指南和快速入门文档。服务器跑起来之后:
重建已有索引:
ov reindex <uri> --mode vectors_only只刷新向量;--mode semantic_and_vectors先重新生成语义产物(.abstract.md、.overview.md)再刷新向量;--mode prune_orphans清理源文件已不存在的向量记录(加--dry-run可预览)。没有semantic或full这样的模式别名。客户端配置可以用
ov config交互式初始化;有多台服务器时,用ov config switch切换。Rust CLI 通过
npm i -g @openviking/cli安装,也可以从源码构建:cargo install --git https://github.com/volcengine/OpenViking ov_cli,见 CLI 安装。官方 Docker 镜像也已提供,见部署指南。接入你的 Agent
集成会把 OpenViking 的召回注入 Agent 上下文,并自动提交会话记忆:
各 Agent 的接入步骤:Agent 集成总览。
OpenViking Helper(Beta)
OpenViking Helper 是一个桌面控制台,目前处于 Beta 阶段,支持 macOS 和 Windows x64:
SKILL.md技能,并同步到 OpenViking。下载:
VikingBot
VikingBot 是构建在 OpenViking 之上的 AI 智能体框架:
官方 Docker 镜像内置 VikingBot,默认随服务器和控制台 UI 一起启动。详情见 VikingBot 指南。
生产部署
生产环境建议把 OpenViking 作为独立 HTTP 服务运行——见服务器部署和部署指南。
不想自己运维?OpenViking Personal 由官方托管、开箱即用,借助 VikingDB 获得远超本地硬件的扩展能力,并提供至多 50 个文件的免费试用;开源版用户可以用迁移工具平滑迁移。→ openviking.ai
研究
OpenViking 开源了 VikingMem 论文中描述的部分核心能力:
社区与贡献
OpenViking 还在早期阶段,要做的事还很多。
安全与隐私
本项目重视安全问题。 漏洞报告方式和受支持的版本,见 SECURITY.md
许可证
OpenViking 各组件采用不同的许可证: