Repository navigation
v0.10.2 — three hardening passes: feedback loop fixed, concurrency races closed, embeddings ordered
LatestChangelog
Two full hardening passes (black-box probing against a live instance — including a 50-thread burst that froze it — and a read-through of the v0.9.x feature modules) plus a Windows-side audit round. Every fix ships with its own regression test.
Fixed
- The feedback loop never worked —
loci asknever wrote.last_ask.jsonsince v0.5.0, sofeedback good|badalways answered "no recent ask to rate"; both ask entry points now share the writer, and the rater tolerates torn files loci synclied on failure — every git returncode was swallowed and a rejected push still printed "push done"; failures now print the git error tail and exit non-zero- Watch loops broke forever after an embedding model change —
ingest_oncelacked the vector-space guard - Immediate-index write paths lacked the guard too — remember / chat auto-extract / harness summaries hit raw chroma errors, and a console upload deleted the user's file on the mismatch (now 409 with the file kept)
brain_remembercrashed after saving the note when indexing failed — it now answers "stored: … not indexed: …" with the reason- Memory API rejected uppercase extensions —
.MDmemories returned 404 on read/delete and vanished from listings on case-insensitive volumes - Hit-card titles were hijacked by quoted yaml — a prose line starting
title: …in the body beat the real first heading /memoriesdropped titles behind long frontmatter — a 400-char head cap cut offtitle:lines- Uploads accepted Windows reserved device names (CON.md, NUL.pdf …) — refused now
loci doctormisreported a healthy LOCI_HOME deployment as "config.toml missing"- A concurrent burst froze serve-http to connection resets — pipeline work is serialized under a lock, the server sheds load past 16 concurrent handlers (503), and query lengths are capped
loci governancescanned machine state —.trashnotes as live candidates, AppleDouble sidecars as duplicate-truth evidence- The supersession cache never expired on deletion and missed coarse-clock edits — key is now
(mtime_ns, size) - ChatGPT chat-log imports scrambled conversation order — untimed turns keep the export's insertion order now
- An identifier query with explicit
kwas silently truncated totop_k*4by the literal-match channel expand_queriesturned a bare-string LLM reply into junk single-character "variants" — non-list replies abort the rewrite/search//askJSON arrays in string params pierced.lower()as a bare 500 — params are coerced nowremembertags crashed on non-string items (tags: ["a", 123]→ AttributeError, note never written)- One malformed
[[sources]]entry crashed every command — bad entries are skipped with a pointer instead - harness
paths = "~/notes"(bare string) was iterated per character, poisoning chunk attribution - The overlap clamp was the bug it claimed to prevent — anything past half the size now clamps to size // 2
- graph.json kept the edges of deleted files forever — retired decisions' triples kept steering
brain_graphand wiki context split_markdownhad no defensive clamps — per-source overrides, the demo and harness digests bypassed config's clamps- Concurrent same-name uploads silently overwrote each other, and concurrent chroma PersistentClient initialization raced the Rust bindings — O_EXCL name claiming + one shared client per directory
- state/graph/wiki atomic replace still failed with WinError 5 on Windows when another thread held the target open for reading — all write paths share
fsutil.atomic_write: unique per-writer tmp name plus retry backoff loci benchdied on the first malformed cases line — bad lines are skipped with a pointer- Embedding vectors were assigned by response order, not input index — out-of-order endpoints silently stored chunk B's vector under chunk A; responses are reassembled by
index, gapped index lists are refused - A blank
loci search ""/loci ask ""reached the embedding endpoint and came back as a raw provider 400 traceback — the CLI now rejects blank queries before any work quality pinwrote the baseline non-atomically andstore exportstaged through a shared.partname that concurrent exports interleavedwrite_memorylost one note in eight when agents remembered concurrently — shared staging name, a check-then-create window that overwrote same-second notes (80 writes left 79), and empty bodies dying onsplitlines()[0]
Install and upgrade
pip install "loci-rag[pdf,docx,ocr]"Or from the attached files (Python 3.11+):
python -m pip install --upgrade ./loci_rag-0.10.2-py3-none-any.whl.whl— cross-platform Python package..tar.gz— Python source distribution (sdist).
Verified
- Offline suite: 501 passed, 4 skipped (Windows, Python 3.13) and CI green across the 3.11–3.13 matrix, native Rust, macOS desktop shell and the retrieval regression gate.
更新日志
两轮完整加固(对活实例黑盒探测——包括一次把它打成连接重置的 50 线程突发——加 v0.9.x 功能模块通读),外加一轮 Windows 侧审计。每个修复都带自己的回归测试。
修复
- 反馈循环从未生效——自 v0.5.0 起
loci ask从不写.last_ask.json,feedback good|bad永远回答"没有可评分的提问";两个 ask 入口现在共用写入器,评分器容忍撕裂文件 loci sync失败也说谎——git 返回码全部被吞,推送被拒仍打印 "push done";失败现在打印 git 错误尾部并以非零退出- 换 embedding 模型后 watch 循环永久损坏——
ingest_once缺cmd_ingest有的向量空间守卫 - 即时索引写路径同样缺守卫——remember / chat 自动抽取 / harness 摘要撞裸 chroma 错误,同一失配下控制台上传误删用户文件(现 409 且保留文件)
brain_remember在保存笔记后崩溃(索引失败时)——现在回答 "stored: … not indexed: …" 并带原因- 记忆 API 拒绝大写后缀——大小写不敏感卷上
.MD记忆读/删 404 且从列表消失 - 命中卡标题被正文 yaml 劫持——正文里以
title: …开头的散文行压过真实一级标题 /memories在长 frontmatter 后丢标题——400 字符截断切掉了title:行- 上传接受 Windows 保留设备名(CON.md、NUL.pdf…)——现在拒绝
loci doctor把健康的 LOCI_HOME 部署误报为 "config.toml missing"- 并发突发把 serve-http 冻成连接重置——管线工作加锁串行,服务超 16 并发处理即卸载(503),查询长度封顶
loci governance扫描机器状态——.trash笔记当存活候选、AppleDouble 边车当重复真相证据- supersede 缓存删除后永不失效且漏粗时钟编辑——键改为
(mtime_ns, size) - ChatGPT 聊天记录导入对话顺序错乱——无时间戳的轮次保持导出的插入顺序
- 标识符查询带显式
k被静默截断到top_k*4(字面匹配通道) expand_queries把裸字符串 LLM 回复变成垃圾单字符"变体"——非列表回复中止改写/search//ask的 JSON 数组穿进字符串参数成裸 500——参数现在强制归一remember的 tags 撞非字符串项崩溃(tags: ["a", 123]→ AttributeError,笔记没写进去)- 一条畸形
[[sources]]条目崩掉全部命令——坏条目带指引跳过 - harness
paths = "~/notes"(裸字符串)被逐字符迭代,污染块归属 - overlap clamp 本身就是它声称要防的 bug——超过一半的 size 现在 clamp 到 size // 2
- graph.json 永久保留已删除文件的边——退役决策的三元组继续左右
brain_graph与 wiki 上下文 split_markdown无防御 clamp——per-source 覆盖、demo 和 harness 摘要绕过 config 的 clamp- 并发同名上传静默互相覆盖,chroma PersistentClient 并发初始化竞态 Rust 绑定——O_EXCL 占名 + 每目录一个共享 client
- state/graph/wiki 的原子替换在 Windows 上仍报 WinError 5(另一线程正读目标文件时)——全部写路径共用
fsutil.atomic_write:每写者唯一 tmp 名 + 退避重试 loci bench第一条畸形用例行即崩——坏行带指引跳过- embedding 向量按响应序而非输入序分配——乱序端点把 B 块向量静默存进 A 块;响应按
index重排,缺口/重复的索引直接拒绝 - 空白
loci search ""/loci ask ""穿到 embedding 端点,拿回裸 400 traceback——CLI 现在在任何工作前拒绝空白查询 quality pin非原子写基线、store export用共享.part名被并发导出交错写入write_memory在 8 个 agent 并发记忆时丢 1 条——共享暂存名、检查后创建窗口覆盖同秒笔记(80 写剩 79)、空正文死在splitlines()[0]
安装与升级
pip install "loci-rag[pdf,docx,ocr]"或从附件安装(Python 3.11+):
python -m pip install --upgrade ./loci_rag-0.10.2-py3-none-any.whl.whl:跨平台 Python 安装包。.tar.gz:Python 源码发行包(sdist)。
验证
- 离线套件:501 passed, 4 skipped(Windows / Python 3.13),CI 全绿(3.11–3.13 矩阵、native Rust、macOS desktop shell、检索回归门)。