Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
b54aa93
feat: unify provider factory, protocol surface and credential boundar…
MisonL Sep 23, 2026
7f86aec
chore: configure and apply ruff format (#2)
MisonL Sep 23, 2026
02c2b62
docs: 在 1.4.0 条目补入本轮的审查修复说明
MisonL Sep 23, 2026
60c7570
fix: 收敛检索与快照边界的形态校验,补齐多处异常分类泄漏
MisonL Sep 28, 2026
c728f59
fix: 收敛配置映射的取值与容器形态校验,修复注释触发 mypy 语法错误
MisonL Sep 28, 2026
d91ce4e
fix: 补齐配置编辑器模型菜单的容器形态校验
MisonL Sep 28, 2026
ed5ae50
fix: 补齐向量载入侧的非有限值校验
MisonL Sep 28, 2026
0d47547
fix: 补齐父块索引写入侧的顶层形态守卫
MisonL Sep 28, 2026
cea0765
fix: 补回 GoogleProvider.embed_query 丢失的空结果兜底
MisonL Sep 28, 2026
17c4cb7
fix: 流式工具调用的 JSON 完整性判据覆盖 type 的两种取值
MisonL Sep 28, 2026
1f7ade7
fix: 收敛流式工具调用校验的 type 形态与 json.loads 的另两类失败
MisonL Sep 29, 2026
ff3bfb1
fix: 把流式工具调用完整性校验的判据统一为黑名单
MisonL Sep 29, 2026
747d1b9
docs: 修正 CHANGELOG 中 Unreleased 条目的段落归属
MisonL Sep 29, 2026
a1f3c0f
fix: 收敛 24 处边界缺陷,补齐回归测试
MisonL Sep 29, 2026
7d67099
fix: 补齐分片重叠比例上界与 anthropic/volcengine 渠道的 5 处边界缺陷
MisonL Sep 29, 2026
2077ca4
fix: 补齐 anthropic 请求头取值与 embedding 配置取值的校验
MisonL Sep 29, 2026
c920e04
fix: 补齐 anthropic user/betas 的取值校验
MisonL Sep 29, 2026
6af0586
fix: 补齐工具定义、消息、rerank 与 embedding 入口的入参形态校验
MisonL Sep 29, 2026
4c6e3ab
fix: 补齐 ETL 三个阶段的入参形态校验
MisonL Sep 29, 2026
8b4f9dd
fix: 补齐配置写入入口的容器形态校验
MisonL Sep 29, 2026
0b58b5f
fix: 补齐 retrieval_method 的取值收敛
MisonL Sep 29, 2026
979251a
fix: 补齐 chat_temperature 收敛并修正阈值过滤的兜底判据
MisonL Sep 30, 2026
6d04463
fix: 补齐模型配置展示路径的 provider 与裸插值收敛
MisonL Sep 30, 2026
f7f03e4
fix: 补齐配置编辑器动态上界的规模字段收敛
MisonL Sep 30, 2026
344be18
fix: 补齐 markup_text 的模板形态校验
MisonL Sep 30, 2026
8bc023f
fix: 补齐 Google 与 Ark 响应顶层容器的形态守卫
MisonL Sep 30, 2026
086d5d2
fix: 补齐 OpenAI 兼容渠道响应容器的形态守卫
MisonL Sep 30, 2026
07e87c3
fix: 补齐 rerank_enabled 读取侧的判据(此前只有写入侧)
MisonL Sep 30, 2026
693140b
fix: 修正 top_k 在同一个函数里被重读
MisonL Sep 30, 2026
1e49a67
fix: 补齐 _require_model_detail 的不可哈希键守卫
MisonL Sep 30, 2026
8b2349d
fix: 补齐退出钩子的系统目录清单
MisonL Sep 30, 2026
f66119f
fix: 补齐嵌套响应容器的形态守卫
MisonL Sep 30, 2026
57476ed
fix: 统一权重报错的渲染并恢复 bandit 质量门
MisonL Sep 30, 2026
84b31b7
fix: 补齐子分片的 50% 比例上界
MisonL Sep 30, 2026
716f8b8
fix: 补齐 Pipeline 三个阶段的返回值形态守卫
MisonL Sep 30, 2026
389c716
fix: 补齐 ChatService 标量入参与 embed_in_batches 批次规模的形态守卫
MisonL Sep 30, 2026
fd5cfb3
fix: 补齐公开诊断入口的 provider_name 与 role 形态守卫
MisonL Sep 30, 2026
271a405
fix: 修正 /config 分支的异常分类泄漏
MisonL Oct 1, 2026
b87e4d5
fix: 修正 cleanup.py 的 /private 符号链接解析漏洞
MisonL Oct 1, 2026
4bb4767
fix: 去掉 _normalize_request_timeout 重复的 @classmethod
MisonL Oct 1, 2026
66e70d4
fix: 收敛路径解析里符号链接环的裸 RuntimeError
MisonL Oct 1, 2026
5d1edb1
fix: 可选值列表在混合类型键下不再抛裸 TypeError
MisonL Oct 1, 2026
735fa7f
fix: provider options 的非字符串键不再抛裸 TypeError
MisonL Oct 1, 2026
c1509fa
fix: ExcelLogger 的 query 列未收敛,超大整数会丢掉整批记录
MisonL Oct 2, 2026
94bbda1
fix: Google 拒答消息在非字符串取值下抛裸 ValueError
MisonL Oct 2, 2026
65274b6
fix: 非字符串键的判据只加在顶层,嵌套层级与四个兄弟校验器仍漏
MisonL Oct 2, 2026
9119c54
fix: 模型配置菜单把原始键直接交给 questionary,非字符串键让菜单崩掉
MisonL Oct 2, 2026
8428838
fix: 检索参数菜单的融合策略 default= 未归一,未归一取值让菜单崩掉
MisonL Oct 2, 2026
7f61693
fix: Google 消息 content 的标量回退用裸 str(),超大整数让 _contents 崩掉
MisonL Oct 2, 2026
987d3f2
fix: Anthropic 响应文本块的拼接对真值非字符串抛裸 TypeError
MisonL Oct 2, 2026
8ae7b45
fix: Anthropic 流式增量的文本字段原样透传非字符串,打破 Generator[str] 契约
MisonL Oct 2, 2026
92c2d9e
fix: Ark Chat Completions 流式工具参数未收敛,与另两条路径判据不一致
MisonL Oct 2, 2026
7390482
fix: legacy 导入分支缺 embedding 配置时抛裸 KeyError
MisonL Oct 2, 2026
d9b8b65
fix: split_hierarchical 绕过尺寸守卫,与 split 判据不一致
MisonL Oct 2, 2026
aca95eb
fix: ensure_trusted_source 的字符串信任根被逐字符拆开,边界失效
MisonL Oct 2, 2026
9c29bd7
fix: 路径形态判据只做了一半,resolve_within/FaissStore.load 抛裸 TypeError
MisonL Oct 2, 2026
bfd020c
fix: Google 流式拒答兜底文案未收敛 block_reason,与 _extract_refusal 不一致
MisonL Oct 2, 2026
4987152
fix: Anthropic text_stream 兜底分支原样透传非字符串,打破 Generator[str] 契约
MisonL Oct 2, 2026
0b169e4
fix: chat_async 内联分支自造 prompt,绕开 _build_prompt 的字段收敛
MisonL Oct 2, 2026
cc06e8e
fix: Responses 路径的 choices 形态守卫只覆盖一个提取器,另三个抛裸 TypeError
MisonL Oct 2, 2026
bc71346
fix: Responses 流式拒答的 delta 原样插值,位数超限时抛裸 ValueError
MisonL Oct 2, 2026
6906257
fix: _require_snapshot_id_within_root 对非路径形态的快照 id 抛裸 TypeError
MisonL Oct 2, 2026
6a8d630
fix: FaissStore.load_snapshot 对非路径入参抛裸 TypeError,与 load 判据不一致
MisonL Oct 2, 2026
ab210d1
fix: FaissStore.save/save_snapshot 无形态守卫,整数会被当成文件描述符
MisonL Oct 2, 2026
556e517
fix: RunConfig 路径字段无校验,SnapshotRepository/legacy 分支抛裸 AttributeError/…
MisonL Oct 2, 2026
404b44d
fix: build 对非 Path 的 knowledge_base_path 抛裸 AttributeError
MisonL Oct 2, 2026
17149e9
fix: 建 provider 的入口未判 provider/model_name 形态
MisonL Oct 2, 2026
5377f44
fix: normalize_messages 只判 messages,prompt/system_prompt 无形态判据
MisonL Oct 2, 2026
71eb29c
fix: build 把名为 *.md 的目录当成知识库文件,抛裸 IsADirectoryError
MisonL Oct 2, 2026
34599b1
fix: ACTIVE_SNAPSHOT 标记读取未收敛,目录/非 UTF-8 时启动抛裸异常
MisonL Oct 2, 2026
ce2ac9a
fix: Responses background 轮询超时消息原样插值网关 id,抛裸 ValueError
MisonL Oct 2, 2026
5708da4
fix: Ark Responses failed 分支原样 str() 网关 error,位数超限抛裸 ValueError
MisonL Oct 2, 2026
ea8b061
fix: 流错误事件兜底原样插值网关 code,位数超限抛裸 ValueError
MisonL Oct 2, 2026
f5ec45f
fix: Google partial_args 的 json_path 拒绝消息用 !r 插值,位数超限抛裸 ValueError
MisonL Oct 2, 2026
8207de8
fix: _chat_status_is_error 对容器形态 status 抛裸 ValueError,错误分类被打断
MisonL Oct 2, 2026
4078ead
fix: local-hash 的 model_name 无形态守卫,非字符串构造期抛裸 AttributeError
MisonL Oct 2, 2026
d591f15
fix: 六个 provider 构造器漏了 model_name 形态判据
MisonL Oct 2, 2026
54d994b
fix: OpenAI 兼容构造器的 provider 参数无形态守卫
MisonL Oct 2, 2026
70dd6e1
fix: ExcelLogger.log_results 对非列表 results 静默写出垃圾行
MisonL Oct 2, 2026
109f15b
fix: ChatService._build_prompt 的 documents 入参缺形态判据
MisonL Oct 2, 2026
5aafaa4
fix: FaissStore.upsert_embeddings 的 documents 顶层容器缺形态判据
MisonL Oct 2, 2026
27042d8
fix: display_results 对非列表 documents 静默渲染伪结果
MisonL Oct 2, 2026
2ae2e3f
fix: FaissStore.upsert_embeddings 的 embeddings 入参缺形态判据
MisonL Oct 3, 2026
e658aa6
fix: SnapshotRepository.activate_snapshot 漏掉快照 id 判据
MisonL Oct 3, 2026
f2b7348
fix: SnapshotRepository.finalize_snapshot 的 temp_dir 入参缺形态判据
MisonL Oct 3, 2026
4f3d2fe
fix: SnapshotRepository.validate_snapshot_dir 对字符串路径抛裸 AttributeError
MisonL Oct 3, 2026
dc6ad04
fix: SnapshotRepository.write_manifest 的 snapshot_dir 入参缺形态判据
MisonL Oct 3, 2026
26747b9
fix: Chatbot._display_retrieved_docs 对非列表 docs 静默渲染伪结果
MisonL Oct 3, 2026
2b8ff0a
fix: SessionConfig.__getitem__ 与 __setitem__ 判据不一致,破坏 Mapping 协议
MisonL Oct 3, 2026
cdf2dfc
fix: SnapshotRepository.load_manifest 把路径形态错误误报成快照不自洽
MisonL Oct 3, 2026
1d189ca
fix: FaissStore.__init__ 的 file_path 缺形态判据,整数被当成文件描述符
MisonL Oct 3, 2026
feda42f
fix: RetrievalService._rerank_if_needed 的 ranked_results 缺形态判据
MisonL Oct 3, 2026
88d15da
fix: ensure_trusted_source 的 trusted_roots 不可迭代时抛裸 TypeError
MisonL Oct 3, 2026
d712b33
fix: HybridReranker.rerank 的 documents 入参缺形态判据
MisonL Oct 3, 2026
b9393cc
fix: _merge_hybrid_results 的两个入参缺形态判据
MisonL Oct 3, 2026
7f37c44
fix: _rerank_if_needed 的两个关键字入参只做了「默认值」那一半判据
MisonL Oct 3, 2026
ad7b688
fix: _should_apply_score_threshold 的 fusion_strategy 形参只做了「兜底分支」那一半判据
MisonL Oct 3, 2026
4331b36
fix: 清单计数字段读写两侧判据不一致,读取侧把写入侧拒绝的值静默改写
MisonL Oct 3, 2026
cd51e66
fix: 读取侧的权重与阈值只判形态没判值域,负权重/越界阈值静默出错
MisonL Oct 3, 2026
2031df6
fix: embedding 配置的两个入口对不可哈希的 provider key 抛裸 TypeError
MisonL Oct 4, 2026
f9a3cd4
fix: chat_temperature 读取侧只判下界,漏了 1.0 上界,与配置边界给相反结论
MisonL Oct 4, 2026
532e4df
test: 补 HybridReranker 构造期五处守卫的测试覆盖缺口
MisonL Oct 4, 2026
27256c6
test: 补 Settings 六处整数/数值守卫的测试覆盖缺口
MisonL Oct 4, 2026
d30e6a8
test: 补 FaissStore.upsert_embeddings 二维守卫的测试覆盖缺口
MisonL Oct 4, 2026
bcb3d70
test: 补 _get_provider_class 白名单守卫的覆盖缺口,缺口被 autouse 夹具的替身掩盖
MisonL Oct 4, 2026
6f0fb2f
test: 补两个 Rerank provider _validate_inputs 前半段守卫的覆盖缺口
MisonL Oct 4, 2026
ac5a9a4
test: 补 _create_provider 两条守卫的覆盖缺口
MisonL Oct 4, 2026
3f1c2f8
test: 补 Anthropic 工具转换三条守卫的覆盖缺口
MisonL Oct 4, 2026
9c5c9c5
test: 补 Responses 工具转换五条元素级守卫的覆盖缺口
MisonL Oct 4, 2026
5185e62
test: 补 _build_chat_request 三条重复字段守卫的覆盖缺口
MisonL Oct 4, 2026
0378c6e
test: 补 _build_responses_request 五条守卫的覆盖缺口
MisonL Oct 4, 2026
07f9163
test: 补 VolcengineProvider._build_responses_request 九条守卫的覆盖缺口
MisonL Oct 4, 2026
2284985
test: 补 Google 工具转换两条守卫的覆盖缺口
MisonL Oct 4, 2026
cc9cb2d
test: 补 GoogleProvider._contents 两条守卫的覆盖缺口
MisonL Oct 5, 2026
032d360
test: 补 Anthropic 采样与 Google 媒体 URI/MIME 共五条守卫的覆盖缺口
MisonL Oct 5, 2026
6dfb75a
test: 补 Anthropic _build_message_params 与 _convert_messages 共九条守卫的覆盖缺口
MisonL Oct 5, 2026
652dca4
test: 补 GoogleProvider._merge_tool_call 三条守卫的覆盖缺口
MisonL Oct 5, 2026
ee7c307
test: 补 _responses_content_part 二十六条形态判据的覆盖缺口
MisonL Oct 5, 2026
b6722f9
test: 补 normalize_embedding_vector 三条 base64/类型判据的覆盖缺口
MisonL Oct 5, 2026
b0c1a75
test: 补工具调用归一化六条形态判据的覆盖缺口
MisonL Oct 5, 2026
d9862f8
test: 补两个 Rerank provider 响应解析八条形态判据的覆盖缺口
MisonL Oct 5, 2026
8574cfb
test: 补 GoogleProvider._validate_http_options 四条形态判据的覆盖缺口
MisonL Oct 5, 2026
4c093ab
test: 补流终止与拒答守卫三十条的覆盖缺口
MisonL Oct 5, 2026
e8b5075
test: 补 _guard_provider_resource_method 五条 TypeError 收敛判据的覆盖缺口
MisonL Oct 5, 2026
d546778
test: 补消息归一化与三条基础判据共十条的覆盖缺口
MisonL Oct 5, 2026
01580a1
test: 补 Ark Responses 转换与 Chat/Embedding/Classification 十三条判据的缺口
MisonL Oct 5, 2026
e8b1e4f
test: 补 ModelProviderFactory 诊断与导入路径七条守卫的覆盖缺口
MisonL Oct 5, 2026
444d784
test: 补 Anthropic 十四条判据的覆盖缺口
MisonL Oct 5, 2026
799d610
test: 补 GoogleProvider 配置边界与响应格式十八条判据的覆盖缺口
MisonL Oct 5, 2026
3869b4b
test: 补 provider 基类 sdk_client/async_sdk_client 三条守卫的覆盖缺口
MisonL Oct 5, 2026
e55147c
test: 补 GoogleProvider._contents 工具调用与工具结果四条判据的覆盖缺口
MisonL Oct 5, 2026
2d24b80
test: 补 OpenAICompatibleProvider 二十九条判据的覆盖缺口
MisonL Oct 5, 2026
e6510e9
test: 补 VolcengineProvider 二十八条判据的覆盖缺口
MisonL Oct 5, 2026
b008231
test: 补 GoogleProvider 五十四条判据的覆盖缺口
MisonL Oct 5, 2026
508b259
test: 补 Anthropic、Rerank、资源代理等二十五条判据的覆盖缺口
MisonL Oct 6, 2026
383d310
test: 补检索信任边界、运行期配置与 ETL 边界五十四条判据的覆盖缺口
MisonL Oct 6, 2026
ed0482e
test: 补发布脚本与入口自检六条判据的覆盖缺口
MisonL Oct 6, 2026
f814266
test: 补已执行无断言与宽松 match 掩盖的十一条判据覆盖缺口
MisonL Oct 6, 2026
ea1bb1b
test: 补非 raise 守卫变异扫描的六十一条判据覆盖缺口
MisonL Oct 6, 2026
5a7a7f9
test: 收口非 raise 守卫扫描的二十六条判据覆盖缺口
MisonL Oct 6, 2026
8f16b4a
test: 补交互循环空查询与安静关闭两条判据覆盖缺口
MisonL Oct 6, 2026
535d42c
test: 补吞掉型 except 五十条 fail-open 判据的覆盖缺口
MisonL Oct 7, 2026
a191dab
fix: 对齐 Ark 与 OpenAI 兼容渠道的伪造 schema 判据
MisonL Oct 7, 2026
1334a18
fix: 补齐 Ark 四条调用路径的失败日志包装
MisonL Oct 7, 2026
fb1c059
test: 补 except 元组收窄扫描的三十三条判据覆盖缺口
MisonL Oct 7, 2026
7c9795d
test: 补边界比较符互换扫描的二十四条 off-by-one 覆盖缺口
MisonL Oct 7, 2026
f2ec4ff
test: 补布尔运算符互换扫描的二十条判据覆盖缺口
MisonL Oct 7, 2026
c7977d4
test: 补调用名互换扫描的二十九条判据覆盖缺口
MisonL Oct 7, 2026
3e280f2
test: 补否定变异扫描的二十七条判据覆盖缺口
MisonL Oct 8, 2026
d73d04e
fix: 完成否定变异扫描复核与缺口覆盖
MisonL Oct 8, 2026
90ff675
chore: 新增变异审计验证工具链 scripts/audit
MisonL Oct 8, 2026
44ded55
fix: 变异验证驱动隔离 pytest 字节码缓存
MisonL Oct 8, 2026
3d48289
test: 补等值比较互换扫描的二十七条判据覆盖缺口
MisonL Oct 8, 2026
a960802
feat: 变异器新增 cmpdir(比较运算符方向反转)
MisonL Oct 8, 2026
3fbcae2
test: 补比较运算符方向反转扫描的三处判据缺口
MisonL Oct 8, 2026
d642058
feat: 变异器新增 boolc(布尔字面量互换)
MisonL Oct 8, 2026
5b32749
test: 补布尔字面量互换扫描在公共请求层的判据缺口
MisonL Oct 8, 2026
875fcd8
test: 补布尔字面量互换扫描在 Anthropic 入口的判据缺口
MisonL Oct 8, 2026
f5a5366
test: 补布尔字面量互换扫描的 46 处判据缺口
MisonL Oct 8, 2026
1c3d61c
test: 补布尔字面量互换扫描在请求层与工具/服务/检索批的 50 处判据缺口
MisonL Oct 9, 2026
e62a40e
docs: 修正 CHANGELOG 中 boolc 扫描的存活点账目
MisonL Oct 10, 2026
6770c50
docs: CHANGELOG 补记 boolc 前置提交自报覆盖数与复扫的对账
MisonL Oct 10, 2026
5299e0a
chore: 死代码消融删除 _chat_stream_event 兼容包装
MisonL Oct 10, 2026
fc6a7ab
chore: 死代码消融删除孤立的 _AsyncOnlyResourceFacade
MisonL Oct 10, 2026
e1a4597
chore: 死代码消融删除 ChatService.retrieve
MisonL Oct 11, 2026
bce5d6b
fix: 全维度审查修复 6 处守卫不对称与安全/入口缺陷
MisonL Oct 11, 2026
af2ec0d
fix: 审计工具链补基线对照/pytest 缺失嗅探/AST 选择器,夹具重新基线化
MisonL Oct 11, 2026
4acecb9
test: 修复 6 处假绿断言与 parse_sites 数值防呆
MisonL Oct 11, 2026
2112031
fix: 异常兜底分支补脱敏、embeddings object dtype 收敛、夹具二次基线化
MisonL Oct 11, 2026
d8c4969
fix: Responses 后台轮询补上界,green39 夹具三次基线化
MisonL Oct 11, 2026
f5cf21e
fix: 检索服务退出路径首个关闭失败不再中断后续资源释放
MisonL Oct 11, 2026
3384319
fix: 配置重载清理 stale rerank 实例时首个关闭失败不再中断
MisonL Oct 11, 2026
1cb7625
fix: 检索兼容入口的关闭失败不再顶替检索结果或原始异常
MisonL Oct 11, 2026
47193b0
fix: 流关闭异常不再顶替消费异常,避免污染重试分类
MisonL Oct 11, 2026
aca5250
fix: ETL 日志插值改用安全渲染,metadata 形态异常不再让建库崩溃
MisonL Oct 11, 2026
2b58602
fix: Document.__repr__ 对不受控 metadata 不再抛,保住兜底渲染
MisonL Oct 11, 2026
3a574ce
fix: 知识快照源码摘要的第二次读取补带文件名契约
MisonL Oct 12, 2026
7edab34
feat: 变异器新增 arith(算术运算符互换)
MisonL Oct 12, 2026
ff3f443
test: 补算术运算符互换扫描的 5 组判据覆盖缺口
MisonL Oct 12, 2026
322ba9a
fix: 审计验证器排除读源码文本的自指测试,green39 夹具重基线
MisonL Oct 12, 2026
258407f
fix: 变异验证器补自指测试清单的完整性核对
MisonL Oct 12, 2026
08e3f82
feat: 变异器新增 boolop(and/or 互换)
MisonL Oct 12, 2026
5ce635d
docs: 记录 boolop 判据陷阱(or 链冗余项与互斥条件)
MisonL Oct 12, 2026
9eb4d47
test: 补 boolop 扫描确认的协议白名单接受路径缺口
MisonL Oct 12, 2026
b0f1b18
test: 补 rerank 响应的 bool 分数误报超范围缺口
MisonL Oct 12, 2026
19beca2
test: 补 rerank 响应的 bool index 被当作整数下标缺口
MisonL Oct 12, 2026
2053add
test: 补索引文本对非字符串 source 的容忍缺口
MisonL Oct 12, 2026
018c011
test: 补 faiss_store 两处 boolop 扫描确认的守卫缺口
MisonL Oct 12, 2026
3850c11
test: 补 boolop 扫描确认的 security 与 display_utils 三处缺口
MisonL Oct 12, 2026
3ce35ac
test: 补关闭路径双失败「保留首个错误」与畸形 URL 普通 query 键缺口
MisonL Oct 12, 2026
d121494
docs: 记录 boolop 全量扫描的 8 组真缺口与等价变异
MisonL Oct 12, 2026
50d6cad
fix: 剔除 Linux 上必然失败的 macOS 专属断言,消除 GitGuardian base64 误报
MisonL Oct 13, 2026
a92ea87
fix: 修 CodeRabbit 复核的 3 处 major——旧快照父块键兼容、测试全局泄漏、夹具重复位点
MisonL Oct 13, 2026
dc4179f
fix: CodeRabbit 复核 minor 全量收口——google safe_repr 误用、载入原子性、测试健壮性
MisonL Oct 13, 2026
7f9b86f
Merge remote-tracking branch 'origin/main' into fix/retrieval-boundar…
MisonL Oct 13, 2026
264e00c
fix: CodeRabbit 第二轮复核收口——Mapping 协议、菜单会话存活、两处测试名实不符
MisonL Oct 13, 2026
dad5e9a
fix: 四维 agents 终审收口——凭证脱敏、键塌缩、/config 会话存活、流清理
MisonL Oct 13, 2026
6be10c4
fix: 第二轮四维 agents 复查收口——legacy pkl 误退出、method 子菜单、快照残缺组合
MisonL Oct 13, 2026
c76a169
fix: 第三轮四维 agents 复查收口——ReDoS、守卫原子性、context 顶替、双 close
MisonL Oct 13, 2026
8ece612
fix: 第四轮收尾复查——re-raise 跳过补刀、启动横幅裸抛、消息与显示统一
MisonL Oct 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 118 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,34 @@ jobs:
release_artifacts/*.tar.gz
if-no-files-found: error

test:
# 发布流程此前从不跑测试:打标签的提交若没走过 PR 门禁,产物会在测试全红
# 的情况下被发出去。刻意用单独的 job 而不是塞进 build:build 是五平台矩阵,
# 其中四个平台(Windows 与 macOS/linux arm64)本仓库从未在 CI 上跑过测试,
# 拿它们当发布门禁等于用一个没人验证过的信号去拦发布。这里固定在
# ubuntu-24.04——与 quality.yml 同一环境,覆盖已验证的路径。
runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@v6.0.2

- name: Setup Python
uses: actions/setup-python@v6.2.0
with:
python-version: "3.11"

- name: Setup uv
uses: astral-sh/setup-uv@v7.6.0

- name: Sync dependencies
run: uv sync --group dev

- name: Run tests
run: uv run pytest -q

publish:
needs: build
needs: [build, test]
runs-on: ubuntu-24.04

steps:
Expand Down Expand Up @@ -126,12 +152,102 @@ jobs:
- name: Extract release notes
run: python scripts/extract_release_notes.py --version "${{ steps.release_meta.outputs.version }}" --output RELEASE_NOTES.md

- name: Verify archive contents
shell: bash
run: |
set -euo pipefail
# 发布包必须自证两件事,否则坏包会直接流到用户手里:
# 1) 不含凭证文件(.env / config.toml)——它们由用户从示例复制,
# 打进包里等于把某台机器的配置发给所有人;
# 2) 含离线分词兜底(tiktoken_cache)——缺失时首次构建知识库
# 会在无网环境下失败,而构建期的 --validate 有网、看不出来。
# download-artifact 把每个 artifact 解到 release_artifacts/<name>/,
# 所以归档在下一层,必须用 find 递归(与 publish 步骤的 maxdepth 2 一致)。
# 用 glob 会一个都匹配不到,循环体不执行、fail 保持 0,整步静默通过。
archives=()
while IFS= read -r archive; do
archives+=("${archive}")
done < <(find release_artifacts -maxdepth 2 -type f \
\( -name "PyRAG-Kit-*.tar.gz" -o -name "PyRAG-Kit-*.zip" \) | sort)
if [ "${#archives[@]}" -eq 0 ]; then
echo "未找到任何归档,无法校验(下载步骤是否失败?)。" >&2
exit 1
fi

fail=0
for archive in "${archives[@]}"; do
echo "== ${archive}"
if [[ "${archive}" == *.zip ]]; then
listing="$(python -c "import sys,zipfile;print('\n'.join(zipfile.ZipFile(sys.argv[1]).namelist()))" "${archive}")"
else
listing="$(tar -tzf "${archive}")"
fi

# 判据必须写成 `grep -E ... >/dev/null`,**不能**用 `grep -q`。
# `grep -q` 命中即退出,上游 `printf` 收到 SIGPIPE 后以 141 退出;
# `set -o pipefail` 让整条管道返回 141,而 `if` 只把 0 当成功——
# 于是「命中」被判成「未命中」。触发条件是归档列表超过管道缓冲区
# (Linux 上 64 KiB):实测真实 v1.4.0 产物的列表已是 75–79 KB,
# 也就是这条检查自发布起就一直是失效的。
#
# 两个方向都会给出与事实相反的结论:凭证检查静默跳过(含 `.env`
# 的包被放行发布),tiktoken_cache 检查误报缺失(正常包被拦下)。
# `>/dev/null` 让 grep 读完整个输入,不产生 SIGPIPE。
if grep -E '/(\.env|config\.toml)$' >/dev/null <<<"${listing}"; then
echo " ✗ 归档内含凭证文件" >&2
grep -E '/(\.env|config\.toml)$' >&2 <<<"${listing}"
fail=1
fi
if ! grep -F '/tiktoken_cache/' >/dev/null <<<"${listing}"; then
echo " ✗ 归档内缺少 tiktoken_cache(离线分词兜底)" >&2
fail=1
fi
done

if [ "${fail}" -ne 0 ]; then
exit 1
fi
echo "归档校验通过(${#archives[@]} 个)。"

- name: Generate checksums
shell: bash
run: |
set -euo pipefail
# 只对归档取校验和,便于用户核对下载内容与发布产物一致。
# 输出用 basename:download-artifact 会多一层 <artifact-name>/ 目录,
# 带上它会让用户拿单个下载文件对不上号。sha256sum 是 coreutils 标配,
# shasum 只在装了 perl 的机器上有,所以优先前者。
if command -v sha256sum >/dev/null 2>&1; then
hash_cmd=(sha256sum)
else
hash_cmd=(shasum -a 256)
fi

# 落在 release_artifacts/ 内:publish 步骤按该前缀查找待上传文件,
# 写到工作区根目录的话这个文件不会随 release 一起发布。
sums=release_artifacts/SHA256SUMS.txt
: > "${sums}"
while IFS= read -r archive; do
"${hash_cmd[@]}" "${archive}" | sed "s|\([^ ]*\) .*/|\1 |" >> "${sums}"
done < <(find release_artifacts -maxdepth 2 -type f \
\( -name "PyRAG-Kit-*.zip" -o -name "PyRAG-Kit-*.tar.gz" \) | sort)

if [ ! -s "${sums}" ]; then
echo "未找到任何归档,无法生成校验和。" >&2
exit 1
fi
cat "${sums}"

- name: Publish GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
mapfile -t files < <(find release_artifacts -maxdepth 2 -type f \( -name "PyRAG-Kit-*.zip" -o -name "PyRAG-Kit-*.tar.gz" \) | sort)
files=()
while IFS= read -r file; do
files+=("${file}")
done < <(find release_artifacts -maxdepth 2 -type f \
\( -name "PyRAG-Kit-*.zip" -o -name "PyRAG-Kit-*.tar.gz" -o -name "SHA256SUMS.txt" \) | sort)
if [ "${#files[@]}" -eq 0 ]; then
echo "未找到发布产物。" >&2
exit 1
Expand Down
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Project Structure & Module Organization

- `main.py` 是交互式入口;`src/` 按职责划分为 `chat/`、`etl/`、`models/`、`providers/`、`retrieval/`、`retrieval_test/`、`runtime/`、`services/`、`ui/` 和 `utils/`。
- `scripts/` 放置知识库快照构建、发布打包和发布说明提取脚本;`tests/` 按源码模块组织 pytest 测试。
- `scripts/` 放置知识库快照构建、发布打包、发布说明提取脚本与变异审计验证工具(`scripts/audit/`);`tests/` 按源码模块组织 pytest 测试。
- `knowledge_base/` 保存本地 Markdown 原文;`data/kb/` 和 `data/logs/` 保存运行产物,均不应提交。仓库不再包含 Dify 上游子模块,Dify 相关逻辑以 `src/` 中的移植代码维护。
- 核心流程为 ETL -> embedding -> FAISS 快照 -> 混合检索 -> provider-backed chat。

Expand All @@ -20,6 +20,7 @@ uv run python -m scripts.embed_knowledge_base --mode standard
uv run pytest
uv run pytest tests/providers/test_factory.py
uv run python scripts/build_binary_release.py --target macos-arm64 --validate
uv run python scripts/audit/verify_sites.py --selftest
```

`standard` 也可替换为 `hierarchical`。发布目标支持 `windows-x64`、`macos-x64`、`macos-arm64`、`linux-x64` 和 `linux-arm64`;标签 `v*` 会触发 GitHub Release 工作流。
Expand Down
Loading