mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-07-22 01:15:14 +08:00
补齐 issue #1 方法分层中可立即实现的剩余命名空间: - catalog.status:当前已发布版本的 catalog 概览(读取其 snapshot: app/bundle 版本、connection group、addressables 根、端点与 marker 计数、launcher 元数据、GameMainConfig 摘要)。 - catalog.versions:版本历史(current / in_progress / previous / failed,来自 official-version-state.json)。 - catalog.diff:当前 snapshot 相对上一个可用版本的差异(复用 YostarJpSyncSnapshot::diff 与 diff_extended_snapshot;含 changed_endpoint_urls 与 previous_snapshot_missing 标志;无上一版本 时按首次观察处理 is_initial=true)。 - catalog.refresh:经任务执行器的 catalog 更新检查任务(dry-run + plan,不下载不审计;支持 force),返回 task_id 可轮询。 - resource.manifest:当前版本下载 manifest 的分页只读查询(offset 默认 0、limit 默认 100/上限 1000,BTreeMap 按 URL 有序保证分页稳定; 非法 limit → 700002)。infrastructure 公开 OfficialDownloadManifest(Entry) 与 read_download_manifest_at。 约定:只读查询在尚无已发布版本或文件缺失时返回 ok=true 且 data.available=false(正常状态而非错误,便于 Go 层直接分支)。 is_pending_rpc_method 缩减为 task.create / resource.repair / patch.* / unityfs.*(后两者待引擎;repair 待引擎独立修复模式)。 新增 read_daemon_resource_state 供 resource/catalog 只读查询共用。 测试:新增 10 个 dispatch 单测(含 fixture:状态文件 + 版本状态 + snapshot + manifest)与 read_download_manifest_at 单测;调整 pending 断言。真实 daemon 端到端验证(fixture 资源根 + 死代理快速失败): raw socket 依次断言 catalog.status/versions/diff、resource.manifest 分页与参数错误、catalog.refresh 入队与 task.status 轮询、 resource.repair→700003、未知方法→700001,全部通过,daemon.stop 干净 退出。全量 fmt / clippy --workspace --all-targets -D warnings / test --workspace 全绿。 已知后续(另行推进):任务配置校验失败(如缺少 app-version)尚未接入 输入域错误码(应为 100001,现落 900001)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>