Complete physical analysis → check/verify module migration in rapx#247
Merged
hxuhack merged 3 commits intoMay 12, 2026
Conversation
Agent-Logs-Url: https://github.com/safer-rust/RAPx/sessions/fb8d3c8a-0900-4f89-b904-e1be80f553d7 Co-authored-by: hxuhack <13302178+hxuhack@users.noreply.github.com>
Agent-Logs-Url: https://github.com/safer-rust/RAPx/sessions/fb8d3c8a-0900-4f89-b904-e1be80f553d7 Co-authored-by: hxuhack <13302178+hxuhack@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Move physical module files for analysis, check, and verify
Complete physical May 12, 2026
analysis → check/verify module migration in rapx
616f457
into
copilot/refactor-analysis-check-verify
2 checks passed
hxuhack
added a commit
that referenced
this pull request
May 12, 2026
* Add a new cli option for verification. (#237) * add verify test * feat: add verify command with --scan option * fix compilation errors * fix bugs * refactor verification module to make pipeline clearer (#238) * Add unsafe callee detection for verification targets. (#239) * Extend verify scan to collect unsafe callees * add unsafe callees * * rename scan to collect * add std contracts * add 2 test cases for alignment verification (#240) * extract callee contracts. --------- * Update verify target collector (#242) * add local verify contract module * add local verify helper module * fix verify local module paths and type inference * add English documentation to verify collect module * update * refactor verify (#243) * add struct invariants (#244) * add a struct example * Refactor verify targets into function and struct targets * Support struct field and generic resolution in verify helpers * Simplify verify target collector structure * Fix struct invariant collection for local struct targets * Read struct invariants from local struct HIR items * fix compilation bug * fix bug * Add RAPx attribute parser under verify * Use shared RAPx attribute parser in verify target analysis * Fix RAPx attribute parsing with syn outer attributes * Use method context when parsing struct invariants * update rapx attribute parsing (#245) * merge two get fn proterty functions * delete walk_fn * refactor: simplify RAPx attribute parser flow * refactor: deduplicate RAPx verify attribute collection * refactor: remove requires kind filtering * Associate RAPx kind with preceding property * update attribute parser (#246) * docs: add doc comments and inline comments to attr_parser.rs * docs: clarify requires attribute parser comments and naming * Refactor RAPx requires attribute parsing for semicolon metadata * Simplify RAPx requires attribute parser for single property syntax * Refactor src modules into analysis, check, and verify namespaces with dedicated CLI check args * Complete physical `analysis` → `check`/`verify` module migration in `rapx` (#247) --------- Co-authored-by: ClearLove <98693523+DiuDiu777@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This continues the namespace split by completing the physical relocation of check/verify code out of
analysis, and wiring the crate to compile against the new module tree. The prior refactor introduced top-levelcheck/verifymodules but still depended on files underanalysis/*.Physical module migration
analysis/opt/**→check/opt/**analysis/rcanary/**→check/rcanary/**analysis/safedrop/**→check/safedrop/**analysis/senryx/**→check/senryx/**analysis/verify/{attr_parser.rs, contract.rs, helpers.rs, target.rs, assets/**}→verify/**analysis/verify/mod.rs.Module tree completion
src/verify/mod.rswith the full local tree:mod attr_parser;mod contract;mod helpers;pub mod target;verify/target.rsto import sibling modules viasuper::...(instead of path attributes tied to old layout).Path/import rewiring
crate::analysis::{opt|senryx|...}tocrate::check::{opt|senryx|...}where appropriate.crate::analysis::verifyusage tocrate::verify.crate::analysis::{core,graphs,scan,upg,utils}references unchanged.check::optandcheck::safedropimports).Asset/include path correctness after move
Minor review follow-up
istead→instead).Original prompt
Continue the refactor of repo
safer-rust/RAPxon branchcopilot/refactor-analysis-check-verifyby performing the actual physical module migration for the Rust crate underrapx/.Context:
analysis,check, andverifydeclared inrapx/src/lib.rs.rapx/src/analysis/mod.rswas reduced to analysis-only modules.rapx/src/check/mod.rsandrapx/src/verify/mod.rswere added.rapx/src/cli/check.rswas added andCommands::Check(CheckArgs)introduced.rapx/src/analysis/..., so the module tree is incomplete and paths need to be fixed.Your task:
Physically move files/directories from
rapx/src/analysisinto the new namespaces:rapx/src/analysis/opt/**torapx/src/check/opt/**rapx/src/analysis/rcanary/**torapx/src/check/rcanary/**rapx/src/analysis/safedrop/**torapx/src/check/safedrop/**rapx/src/analysis/senryx/**torapx/src/check/senryx/**rapx/src/analysis/verify/{attr_parser.rs,contract.rs,helpers.rs,target.rs,assets/**}intorapx/src/verify/rapx/src/verify/mod.rswith a complete module tree equivalent to the oldanalysis/verify/mod.rsand able to compile from the new location.Fix module declarations and imports across the crate so the new layout is consistent:
crate::analysis::optreferences tocrate::check::optcrate::analysis::rcanaryreferences tocrate::check::rcanarycrate::analysis::safedropreferences tocrate::check::safedropcrate::analysis::senryxreferences tocrate::check::senryxcrate::analysis::verifyreferences tocrate::verifycrate::analysis::core,crate::analysis::graphs,crate::analysis::scan,crate::analysis::upg, andcrate::analysis::utilsreferences unchanged.Preserve public API names and behavior as much as possible:
Opt,rCanary,SafeDrop,CheckLevel,SenryxCheck, andVerifyTargetAnalysisshould still be reachable from the paths already updated inrapx/src/lib.rs.Clean up transitional leftovers:
rapx/src/analysis/mod.rsif any remain.rapx/src/analysis/verify/*after the migration.rapx/src/verify/target.rsand helpers load assets from the new path correctly.Validation:
Important constraints:
safer-rust/RAPx.copilot/refactor-analysis-check-verify.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: 创建agent,按照命令行analysis, check, verify refactor一下这个项目仓库,不要都放在analysis文件夹下面,src下分别创建check和verify文件夹
Assistant: 我正在等待你对刚才的操作确认/授权,一旦你回应,我就继续为这个仓库完成重构调整。
User: @copilot Accepted Confirmation: Are you sure?
Assistant: 可以,我已经理解你的目标:
analysis / check / verifyanalysis下面src/下分别创建:src/check/src/verify/不过我这条回复里不能继续直接执行仓库修改。
如果你愿意,我下一步可以继续帮你做成一个明确的重构方案,建议按下面方式整理:
建议目录结构
建议拆分原则
analysis/:放静态分析、信息收集、IR/中间表示分析、数据流/控制流分析等check/:放规则检查、lint 类检查、模式匹配检查、违规检测等verify/:放性质验证、约束证明、形式化验证、soundness/安全性验证等推荐重构步骤
src/analysis下各模块职责src/checksrc/verifymod声明和use路径analysischeckverify如果你要我继续,我建议我下一步直接输出:
mod.rs/main.rs/lib.rs示例如果你愿意,我下一条就直接给你一份 面向 RAPx 仓库的具体重构方案。
User: 好的
Assistant: 已按你的要求完成第一步重构,并提交到新分支:
copilot/refactor-analysis-check-verify这次调整做了这些事:
src/analysis/只放“分析类”模块src/check/src/verify/已完成的结构调整
现在核心结构变成了:
具体改动
rapx/src/analysis/mod.rscoregraphsscanupgutils新增
rapx/src/check/mod.rsoptrcanarysafedropsenryx新增
rapx/src/verify/mod.rstargetrapx/src/lib.rspub mod check;pub mod verify;use路径:This pull request was created from Copilot chat.