Repository navigation
Python WASM 初检接入稳定原生确认任务 - #18
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bfba7fea9e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return Err("request_deadline_or_cancelled"); | ||
| } | ||
| save_local_report(root, &report)?; | ||
| let summary = sync_local_workspace(root)?; |
There was a problem hiding this comment.
Honor the deadline while synchronizing the confirmation report
For a bound lint python --file ... --timeout ... fallback, this call occurs after the last deadline check and invokes sync_local_workspace, which scans every queued JSON report—up to 1,000 reports of 16 MiB each—without receiving or checking the command deadline or cancellation state. A large report queue can therefore make the editor-oriented command run well past its advertised timeout; the synchronization path needs to remain deadline-aware or be limited to the newly written report.
Useful? React with 👍 / 👎.
| if summary.failed_reports != 0 { | ||
| return Err("syntax_confirmation_sync_incomplete"); |
There was a problem hiding this comment.
Do not hide a task imported beside an unrelated bad report
If any unrelated malformed or stale report is already present in .codeguard/reports, sync_local_workspace can successfully import this new confirmation report and create its task while also returning a nonzero aggregate failed_reports. This branch then reports task_persistence=unavailable with a null task ID even though the task exists, and the queued bad report causes the same false failure on every rescan. Success should be determined from the receipt/task for this report rather than failures elsewhere in the queue.
Useful? React with 👍 / 👎.
| "report_type":"python_syntax_confirmation_observation", | ||
| "workspace_binding":"bound", | ||
| "workspace_id":workspace, | ||
| "run_id":format!("python-syntax-{}-{nanos}",std::process::id()), |
There was a problem hiding this comment.
Recognize Python syntax run IDs when ordering task events
After task verify records a native observation, a later candidate rescan writes an observed event using this python-syntax-<pid>-<nanos> run ID. Both event-ordering implementations in work_sync.rs and next_command.rs only parse the existing run-ID prefixes, so the latter skips this newer event and continues presenting the older native verification as current—even when the source changed or Ruff became unavailable again. Use a recognized run-ID format or extend both sequence parsers so subsequent candidate observations invalidate stale verification guidance.
Useful? React with 👍 / 👎.
| let (priority, disposition, step) = if checker_id == "python.ruff" | ||
| && reason == "python_syntax_confirmation_needed" | ||
| { | ||
| ( | ||
| 1, | ||
| "actionable", | ||
| "核对候选 Python 疑似位置,使用当前源码和适用原生语法能力复检;未完成前不按候选观察修改源码或关闭任务", | ||
| ) |
There was a problem hiding this comment.
Point syntax tasks at the task verification command
This special case changes the guidance text but leaves the previously computed generic recheck_argv as codeguard lint python .. Running that command only produces another candidate scan and does not record the native verification event for this task; the generated task Markdown correctly requires codeguard task verify <id> . --ruff-tool .... Set the repair brief's argv accordingly so users following codeguard next can actually perform the requested confirmation.
Useful? React with 👍 / 👎.
启用
wasm-precheck的 Python 单文件初检此前只能返回疑似位置,已初始化工作区也没有稳定任务可供智能体跟进。现在它在保留原生 Ruff 阻塞的同时,经现有 work sync 保存脱敏候选证据并返回真实的原生确认任务 ID。重复扫描和后续零恢复节点不会关闭任务;报告目录不可用时明确返回持久化原因和空 ID。新增 Python 对话反馈 0.15.0 与本地确认报告 0.1.0 的封闭 Schema。导入核对工作区、当前源码摘要、固定 grammar 和位置范围,拒绝重复 JSON 键、伪造 grammar 与越界位置。默认二进制可读取特性版写出的历史报告。文档和 OpenSpec 仅记录 14.7/14.9/14.10 的局部进展,能力匹配的原生关闭、多文件任务和真实宿主交付仍未完成。
验证:默认工作区测试通过;特性版 Python 8 个端到端用例、相关 Python 16 个常规用例及 TypeScript 14 个回归用例通过;本机 Ruff 0.16.8 的原生优先和 task verify 用例通过。实际 0.15.0 与本地 0.1.0 报告通过 JSON Schema,伪造同步成功被拒绝;默认二进制再同步历史报告
failed_reports=0。默认/特性版 Clippy、格式、分层检查及 OpenSpec strict 通过。