feat(tools): 添加可审计的代码定位人工复核闭环#49
Open
Qiyuanqiii wants to merge 1 commit into
Open
Conversation
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.
关联 Issue:#4
背景与定位
Issue #4 的现有相关 PR 主要实现
current -> ±5 -> same file -> repo unique自动搜索,但在无法唯一确认时都停留在导出
needs_human.csv。本 PR 不再实现另一套自动匹配器,而是补齐后续人工复核闭环:将审阅者
选择的位置重新对照固定 commit 源码验证,再安全写回
entries.jsonl并生成完整审计记录。
实现内容
init兼容现有队列中的field_path和node_path两种格式。review_id和expected_node_sha256。apply、keep和 pending 状态,pending 默认阻止写回。verify=1条目默认受保护,需显式--include-verified才能修改。--offline会严格验证该来源记录。与现有方案的边界
本 PR 不排名候选,也不自动选择歧义位置,因此不会扩大自动修复器的
误报范围。原始
data/entries.jsonl永远不会被原地修改。已对 #11、#16、#18、#32、#35、#36、#39 的七种人工队列格式进行
兼容烟测,初始化结果均与原队列行数严格一致。
审阅者复现命令
功能复现
python tools/location_review.py init \ --input data/entries.jsonl \ --queue reports/needs_human.csv \ --decisions reports/location_review_decisions.csv # 填写 decision/new_file/new_line/reviewer/rationale 后执行: python tools/location_review.py apply \ --input data/entries.jsonl \ --decisions reports/location_review_decisions.csv \ --output data/entries.reviewed.jsonl \ --diff reports/location_review_diff.csv \ --audit reports/location_review_audit.csv验证结果
验证截图