Skip to content

Python 缺少 Ruff 时提供有界 WASM 语法候选反馈 - #17

Merged
loong10k merged 2 commits into
mainfrom
feat/rust-hook-prompt-guidance
Sep 29, 2026
Merged

loong10k merged 2 commits into
mainfrom
feat/rust-hook-prompt-guidance

Conversation

@loong10k

Copy link
Copy Markdown
Contributor

当项目 Ruff 不可用或未明确声明 Ruff 配置时,lint python 原先只给出环境缺口,没有可供智能体定位的语法线索。可选 wasm-precheck 构建现在先保留 Ruff 原生结果,再用固定 Python WASM grammar 和有界 Rust worker 补充疑似语法位置;无效配置和原生诊断不被兜底覆盖。候选结果始终是 incomplete,不能批准交付。

增加 python_lint_feedback 0.14.0 封闭 Schema、五个端到端反例、中英文文档和 OpenSpec 局部验收记录。公开 npm 0.1.2 仍不含这一路径;grammar 版本/方言、稳定确认任务及完整语言覆盖仍未验收。

验证:默认工作区测试通过;特性版 Python/TypeScript 相关测试 35 通过、5 忽略;真实 Ruff 0.16.8 原生优先用例通过;默认和特性版 Clippy、格式、分层检查、OpenSpec 严格校验通过。实际 0.14.0 JSON 经 Schema 验证,伪造 clean 被拒绝。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T07:10:44.310480Z cbc5385 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@loong10k
loong10k merged commit 30e7237 into main Sep 29, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbc5385ca9

ℹ️ 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".

Comment on lines +786 to +790
println!(
"内置 Python 语法候选初检:已检查 {} / {},疑似位置 {},状态 incomplete;候选涉及文件的原生 Ruff 未运行。",
precheck["checked_files"],
precheck["selected_files"],
precheck["observations"].as_array().map_or(0, Vec::len)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Surface unavailable syntax files in human output

When a candidate cannot be checked—for example because it exceeds 1 MiB, changes during the scan, or the worker times out—the default human renderer prints only aggregate counts and suspected observations. It never renders syntax_precheck.unavailable, so users cannot identify the skipped file or its reason even though the JSON report contains both; include the bounded unavailable paths and reasons in this section.

Useful? React with 👍 / 👎.

Comment on lines +97 to +98
) else {
unavailable.push(json!({"path":path,"reason":"worker_incomplete"}));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve timeout cause from the syntax worker

If the shared deadline expires after the pre-spawn check but while run_syntax_worker_candidate is running, the runner returns an error and this branch always records worker_incomplete. The outer command does not perform an equivalent post-precheck deadline correction, so the JSON report misattributes a user-configured timeout as an unspecified worker failure; check the deadline or preserve the worker termination reason here and emit the deadline-specific unavailable reason.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant