Repository navigation
refactor(architecture): retire resolved deslop baseline findings - #36
xinvxueyuan wants to merge 1 commit into
Conversation
Resolve version inheritance from the chain module and let the instance panel consume installation and launch tasks without those tasks depending on the view. Keep catalog and asset state behind the types that own it. Remove seven resolved architecture findings and four stale entries. Keep the existing gate and narrow the remaining frontend tangle to its current members. Link: #23 Assisted-by: OpenAI Codex CLI 0.172.0 Acted-By: 新v学员 <xinvxueyuan@yeah.net> Signed-off-by: 新v学员 <xinvxueyuan@yeah.net>
审查者指南数据结构将资源索引对象和 Minecraft 目录存储设为私有,同时向调用方提供迭代和查找操作。
将已解析版本的加载移至 chain 模块,因为继承解析由该模块负责。
API让安装和启动入口返回任务状态,而不是将后台工作与根视图耦合。
API 的使用更新安装检查、转换、目录使用方和资源处理逻辑,使其使用新的所属模块接口。
实现让活动状态负责活动内容的渲染和清除,同时由根视图委托渲染工作。
将实例行和启动模块移至 instances 面板下,并在面板根部集中处理检查失效和配置文件提交。
通过专用操作和通知公开加载器目录状态,并更新其视图,使其使用这些接口,而不是直接操作状态。
配置移除已解决和过时的架构允许名单条目,不添加豁免项。
测试调整测试,使其适配私有资源存储以及新的目录和已解析版本接口,并将启动测试移至对应模块。
其他更改未归入其他类别的文件。
提示和命令与 Sourcery 互动
自定义使用体验访问你的控制面板,以便:
获取帮助Original review guide in EnglishReviewer's GuideData structuresKeep asset-index objects and Minecraft catalog storage private while exposing iteration and lookup operations for their callers.
Move resolved version loading into the chain module, where inheritance resolution is owned.
APIMake installation and launch starters return task state instead of coupling background work to the root view.
Uses of the APIUpdate installation checks, conversion, catalog consumers, and asset handling to use the new owning-module interfaces.
ImplementationKeep activity rendering and clearing within the activity state while the root view delegates rendering.
Move instance-row and launch modules under the instances panel and centralize inspection invalidation and profile submission in the panel root.
Expose loader catalog state through focused operations and notices, and update its view to consume those instead of manipulating status directly.
ConfigurationRemove resolved and stale architecture allowlist entries without adding exemptions.
TestsAdapt tests to private asset storage and the new catalog and resolved-version interfaces, and relocate launch tests with their module.
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR Summary by QodoRetire resolved architecture findings and decouple desktop tasks from the view
AI Description
Merge Risk
|
Impact analysisRisk: Critical 26 files, 104 indexed symbols, 67 affected processes Note The changed-symbol list is capped. The counts and risk were computed over the full set. 5 per-symbol caller lookups could not resolve callers; confirm those symbols with a text search. Changed symbols
Affected processes
Upstream callers
Note Upstream callers were traced for 10 symbols; 58 further eligible symbols were not queried. Analyzed The draw.io mind map, Mermaid source and SVG preview are in the |
Code Review by Qodo
1. Gate breaks on removed Library entries
|
There was a problem hiding this comment.
嘿——我发现了 1 个问题
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tests/apps/core/install/src/prepare.rs" line_range="163" />
<code_context>
.expect("index");
- assert!(index.objects.is_empty());
+ assert_eq!(index, AssetIndexDocument::default());
let path = temp.0.join("assets/indexes/34.json");
assert_eq!(fs::read(path).expect("written index"), body);
</code_context>
<issue_to_address>
**Cache test accepts an unread index**
When the cached index is empty and `ensure_asset_index` returns a default without reading the file, `an_index_already_on_disk_is_not_fetched_again` compares the result with the default at line 163, so an implementation that skips reading the cached file and returns a default passes despite not using the cache.
Seed a cached index with at least one object and assert that the returned document contains that object.
</issue_to_address>Sourcery 评估
待批准。 请先处理 1 项发现。
阻塞性发现:tests/apps/core/install/src/prepare.rs:163
Original comment in English
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tests/apps/core/install/src/prepare.rs" line_range="163" />
<code_context>
.expect("index");
- assert!(index.objects.is_empty());
+ assert_eq!(index, AssetIndexDocument::default());
let path = temp.0.join("assets/indexes/34.json");
assert_eq!(fs::read(path).expect("written index"), body);
</code_context>
<issue_to_address>
**Cache test accepts an unread index**
When the cached index is empty and `ensure_asset_index` returns a default without reading the file, `an_index_already_on_disk_is_not_fetched_again` compares the result with the default at line 163, so an implementation that skips reading the cached file and returns a default passes despite not using the cache.
Seed a cached index with at least one object and assert that the returned document contains that object.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: tests/apps/core/install/src/prepare.rs:163
| .expect("index"); | ||
|
|
||
| assert!(index.objects.is_empty()); | ||
| assert_eq!(index, AssetIndexDocument::default()); |
There was a problem hiding this comment.
🟡 中等 · 缓存测试接受未读取的索引
当缓存索引为空,并且 ensure_asset_index 未读取文件而直接返回默认值时,an_index_already_on_disk_is_not_fetched_again 会在第 163 行将结果与默认值进行比较。因此,即使实现跳过了读取缓存文件并返回默认值,没有使用缓存,也能通过测试。
请在缓存索引中预先写入至少一个对象,并断言返回的文档包含该对象。
给 AI 智能体的提示
在 `tests/apps/core/install/src/prepare.rs` 第 163 行:
**缓存测试接受未读取的索引**
当缓存索引为空,并且 `ensure_asset_index` 未读取文件而直接返回默认值时,`an_index_already_on_disk_is_not_fetched_again` 会在第 163 行将结果与默认值进行比较。因此,即使实现跳过了读取缓存文件并返回默认值,没有使用缓存,也能通过测试。
请在缓存索引中预先写入至少一个对象,并断言返回的文档包含该对象。Original comment in English
🟡 Medium · Cache test accepts an unread index
When the cached index is empty and ensure_asset_index returns a default without reading the file, an_index_already_on_disk_is_not_fetched_again compares the result with the default at line 163, so an implementation that skips reading the cached file and returns a default passes despite not using the cache.
Seed a cached index with at least one object and assert that the returned document contains that object.
Prompt for AI agents
In `tests/apps/core/install/src/prepare.rs` at line 163:
**Cache test accepts an unread index**
When the cached index is empty and `ensure_asset_index` returns a default without reading the file, `an_index_already_on_disk_is_not_fetched_again` compares the result with the default at line 163, so an implementation that skips reading the cached file and returns a default passes despite not using the cache.
Seed a cached index with at least one object and assert that the returned document contains that object.
Summary
Reduce the architecture allowlist from 18 entries to seven without adding any exemptions or relaxing the gate. Instance installation and launch continue to use the same desktop services.
Motivation
PR #23 allowed pre-existing
deslop-pleasefindings so new violations would still fail CI. Four entries no longer match any finding, and seven more can be removed by fixing their causes.Changes
chainand keep asset index objects and version catalog storage private.RootView. Preserve the launch job's game root for isolated instances and keep activity and loader catalog state with their owners.Libraryfield-leak entries. The remaining frontend tangle is smaller; five shallow modules and one wide directory remain out of scope.Testing
Passed locally on Windows:
Nextest: 539 passed, seven skipped. A scan without the allowlist reported exactly the seven retained findings. No manual desktop session or local Linux build was run; GitHub Actions covers the Linux architecture gate.
Breaking Changes
None for launcher users. Within the workspace, use
chain::load_resolvedin place ofversion::load_resolvedandMinecraftCatalog::entries()in place ofversions(). Asset index maps are no longer directly accessible; construct an index from its document withAssetIndexDocument::parse. All in-tree callers are migrated. No data migration is required.Related
Refs #23
Sourcery 总结
清理已解决的架构基线问题,同时保留启动器行为并减少模块间耦合。
错误修复:
功能增强:
测试:
杂项:
Original summary in English
Summary by Sourcery
Retire resolved architecture baseline findings while preserving launcher behavior and reducing cross-module coupling.
Bug Fixes:
Enhancements:
Tests:
Chores: