Skip to content

固定 Objective-C 与 Solidity 语法候选资产 - #20

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

loong10k merged 1 commit into
mainfrom
feat/rust-hook-prompt-guidance

Conversation

@loong10k

Copy link
Copy Markdown
Contributor

问题与结果

CodeGraph 的 Objective-C 与 Solidity grammar 来自锁定的 tree-sitter-wasms@0.1.13,此前 CodeGuard 只报告其来源但未固定字节,无法在 Rust worker 中加载。现在保留原始 WASM、许可证和摘要,并将旧 dylink 元数据确定性转换为当前 Rust Tree-sitter 可识别的 dylink.0。两种语言已能执行隔离 worker 候选观察;即使无恢复节点,结果仍为 incomplete,不会跳过原生 lint 或批准交付。

候选资产由 5 增至 7;32 种目标语言中仍有 25 种没有候选资产,已验收发行能力仍为 0。OpenSpec、双语架构/技术文档及 README 已同步这一边界。

验证

  • cargo test --locked --workspace --all-features:退出 0;需要显式本地原生工具的测试仍按原条件忽略。
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings:退出 0。
  • cargo fmt --all -- --check:退出 0。
  • openspec validate introduce-rust-codeguard-cli --strict:通过。
  • 离线加载、合法/未闭合语法样例、适配篡改拒绝及隔离 worker 候选状态均有定向回归测试。

完整语料、版本/方言、原生工具对照、公开 lint 路由及发行包安装仍未验收,14.19 保持未完成。

@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-29T09:01:42.489194Z 5e5506a 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 6d3fd9a 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: 5e5506a464

ℹ️ 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 +137 to +141
if matches!(asset.language.as_str(), "objc" | "solidity") {
let source = if asset.language == "objc" {
include_bytes!("../../../grammars/objc/source.wasm").as_slice()
} else {
include_bytes!("../../../grammars/solidity/source.wasm").as_slice()

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 Keep raw grammar sources out of default CLI binaries

In builds without wasm-precheck, grammar status still calls bundled_grammar_candidates, so these unconditional include_bytes! references keep both the source and adapted Objective-C/Solidity modules reachable in the normal CLI. The four files total about 15.5 MiB, meaning this ostensibly optional worker change substantially enlarges every default/native npm binary even though those builds cannot invoke __syntax-worker; gate the byte-level adaptation verification behind the feature or move it to build/test-time validation.

Useful? React with 👍 / 👎.

Comment on lines +14 to +15
#[test]
fn dependency_grammars_load_offline_and_parse_basic_fixtures() {

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 Run the gated runtime grammar test in CI

This new test is disabled unless codeguard-runtime/wasm-precheck is active, but the feature-enabled runtime command in .github/workflows/ci.yml runs only --test process_contract, while the later workspace command enables no features. Cargo's local test --help defines --test [<NAME>] as “Test only the specified test target” and --features as activating the named features, so wasm_grammar_load never runs in the checked CI pipeline and regressions in these direct load/invalid-fixture assertions can merge unnoticed; include this test target in the feature-enabled step.

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