Commit Graph
19 Commits
Author SHA1 Message Date
nyaKazuha 30d1cd77e8 fix(release): 修复发布一致性与并发边界
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s
2026-09-12 16:35:55 +08:00
nyaKazuha 8d57a63697 feat(release):完成双 release 运维闭环
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s
2026-09-12 11:08:04 +08:00
nyaKazuha 8a77502272 feat(patch):统一清单驱动汉化发布
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s
2026-09-12 01:35:29 +08:00
nyaKazuha 69b6e36bf0 feat(assetbundle): 完成已验证结构的重建发布闭环
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s
2026-09-10 00:46:48 +08:00
nyaKazuha bd1e1a06f2 feat(resource): 增加历史 release 与 CAS 复用
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s
Closes #47
2026-09-02 01:26:53 +08:00
nyaKazuha 90083302a2 fix(unityfs): 加固基础容器解析校验
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s
补充 UnityFS 总大小、block/directory 计数、目录路径、重复项和边界校验,覆盖 LZMA 数据块与损坏输入回归。新增隔离真实 UnityPy bundle 测试入口,并用 /tmp 中的 char_118_yuki.ab 完成实际回归。复杂对象解析与发布级重打包继续保留在 G-005 后续范围。

Fixes #3
2026-08-20 12:13:04 +08:00
nyaKazuha 2079c6a307 feat(sync): 接入解析缓存与汉化发布前置
补齐官方 release 解析缓存、TextUnit 明细索引、资源变更集、Crowdin handoff 预留、ResourceRepository 导入元数据和 localized release patch 前置链路。

同时开放文件级 patch.apply 与 UnityFS TextAsset/string/semantic field patch CLI/RPC 入口,并保留官方原版资源与汉化产物双目录发布状态。

验证:cargo test -p bat-assetbundle --locked;cargo clippy -p bat-assetbundle --all-targets --locked -- -D warnings;cargo test -p bat-infrastructure --locked。
2026-07-31 00:38:45 +08:00
nyaKazuha f4880a71bd feat(patch): 补齐通用补丁引擎基础
实现 Binary、JSON、Text patch 与通用 manifest 校验基础。

验证:cargo test -p bat-patch --locked;cargo clippy -p bat-patch --all-targets --locked -- -D warnings。
2026-07-31 00:21:50 +08:00
nyaKazuha 3e9bb20d79 feat(assetbundle): 完善官方资源解析与双目录发布 2026-07-25 20:51:01 +08:00
nyaKazuhaandClaude Fable 5 fd86eafebd chore(deps): 移除占位 crate 中零引用的依赖
bat-patch 的 bsdiff/json-patch、bat-assetbundle 的 byteorder/lz4/lzma-rs 在
源码中完全未使用,占位阶段白增编译负担。移除并留注释说明待对应引擎/解析器真正
实现时再按需引入。

对应 issue #18 维护清单 3-6。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 09:12:40 -07:00
nyaKazuhaandClaude Fable 5 48ffc08cdf fix(cas): exists 返回 Result 以区分不存在与存储故障
CasRepository::exists(core trait)与底层 Storage::exists 原返回裸 bool,
FileSystemStorage 用 try_exists(...).unwrap_or(false)、infra 适配层吞掉解析/
初始化错误返回 false,调用方无法区分“对象不存在”和权限/IO/初始化故障。

将整条链改为 Result<bool>:
- storage trait 与 FileSystemStorage:try_exists 的 IO 错误经 ? 传播;
- repository FileSystemCasRepository::exists 及 store/add_reference 内部调用;
- core CasRepository::exists trait;
- infra 适配层:解析失败→InvalidArgument、初始化/引擎错误经 map_error 传播。
Ok(false) 仅表示确实不存在。

新增单测:合法但不存在的对象返回 Ok(false),非法 ObjectId 返回 Err(而非静默
false);同步更新各层 exists 断言。

对应 issue #18 维护清单 2-1。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 08:53:54 -07:00
nyaKazuhaandClaude Fable 5 02d5bc537e fix(patch): 占位函数返回未实现错误而非空结果
apply_patch / apply_json_patch 原返回 Ok(空 Vec/空 String),调用方会把未实现
的占位误当成一次成功的补丁应用。改为返回 PatchError::ApplyFailed,让占位状态
显式可见。新增单测确认返回错误。

对应 issue #18 维护清单 2-4。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 08:00:31 -07:00
nyaKazuhaandClaude Fable 5 1c4debbaa7 fix(cas): 消除 store/gc 之间的引用计数竞态
store() 原来先 ensure_object(建行 ref_count=0)再 add_reference,两条语句
非事务;即使连接池 max_connections=1,两语句间的 await 也会释放连接,让并发
gc() 在 ref_count=0 窗口删掉刚存的对象文件与元数据(静默丢数据),或使 store
返回 ObjectNotFound。

- 新增 store_reference:单条 UPSERT 原子建行为 ref_count=1 或 +1,对象行不再
  出现 ref_count=0 的可见窗口;store() 与 repository add_reference() 均改用它。
- 新增 delete_zero_ref_metadata:gc 先原子执行 DELETE ... WHERE ref_count=0,
  仅当 rows_affected>0 才删对象文件;被并发递增抢先时跳过,绝不删除仍被引用对象。
  元数据先删、文件后删,最坏只留无元数据的孤儿文件(可覆盖,无数据丢失)。

新增单测:store 后不暴露 ref_count=0(gc_candidates 为空)、候选被重新引用后
gc 跳过、store_reference 原子建行/递增、delete_zero_ref_metadata 守卫。

对应 issue #18 维护清单 1-5。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 07:39:07 -07:00
nyaKazuha b4b4f25cb3 refactor(ffi): 降级 FFI 为可选兼容层并整理文档
将 bat-ffi 明确收敛为无状态 C ABI 兼容层,默认集成路径改为 bat --json 进程边界或未来稳定 SDK。

同步 README、当前状态、项目计划、架构文档、开发指南和缺口清单,移除 FFI 作为主集成边界的表述。

新增 AGENTS.md 和 CONTRIBUTING.md,压缩 CLAUDE.md 为兼容入口,并归档阶段性报告、同步 .gitignore 规则。
2026-07-15 21:12:17 +08:00
nyaKazuha 789402c887 feat: add official resource sync pipeline
Add the production-facing official update service and bat-official-sync watch CLI for unattended resource synchronization.

Support launcher-resource discovery without installing the launcher, remote marker snapshots, local manifest audit and repair, official seed hash validation, bootstrap caching, richer Addressables coverage, SQLite resource persistence, and FFI JSON helpers.
2026-07-05 23:49:56 +08:00
nyaKazuha 3c00659691 refactor: reduce quality findings 2026-06-28 15:42:12 +08:00
nyaKazuha 02716d3ccd refactor: address quality findings 2026-06-28 13:04:53 +08:00
nyaKazuha b202d7b231 feat: implement production cas v1 2026-06-28 12:39:17 +08:00
nyaKazuha dd53e3054e chore: establish development baseline 2026-06-28 01:27:09 +08:00