rule-validate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Validate a rule

验证规则

Verify that the implementation matches its
rule-research
contract on tests and real code.
验证实现是否在测试和真实代码上符合其
rule-research
约定。

Review the implementation

评审实现

Check for:
  • false positives and missed claimed behavior
  • incorrect imports, aliases, or shadowed bindings
  • impossible control-flow path merges
  • nested functions treated as immediate execution
  • dynamic properties treated as static names
  • missed transparent wrappers
  • unsupported imported values
  • messages that overstate detection
  • missing valid and invalid tests
Use
truffler
before accepting a new helper:
sh
bunx @rayhanadev/truffler "<helper-name>" packages \
  --kind function,method,interface,type,constant --limit 20
Fix each implementation bug with a focused regression test.
检查以下内容:
  • 误报和未覆盖的预期行为
  • 错误的导入、别名或遮蔽绑定
  • 不可能的控制流路径合并
  • 嵌套函数被当作立即执行处理
  • 动态属性被当作静态名称处理
  • 遗漏的透明包装器
  • 不支持的导入值
  • 夸大检测结果的提示信息
  • 缺失的有效和无效测试用例
在接受新的辅助工具前使用
truffler
sh
bunx @rayhanadev/truffler "<helper-name>" packages \
  --kind function,method,interface,type,constant --limit 20
为每个实现缺陷添加聚焦回归测试并修复。

Run validation

运行验证

Run focused tests, package typecheck, and required lint and format checks. Run broader checks when the change affects shared behavior.
Use
rde-eval
for bounded local inspection of the target rule. Inspect all hits when counts are low and a representative sample when counts are high. Add every confirmed false positive to rule tests and the
fuzz
corpus.
Run
run-parity
for every new rule or detector behavior change after the pull request head is pushed. Skip it for documentation-only or test-only changes. If parity cannot run, report the exact blocker.
Do not claim parity unless both Daytona runs complete. Compare repository and project-root counts separately. Inspect target-rule deltas before classifying them.
运行聚焦测试、包类型检查以及必要的代码检查和格式化检查。当变更影响共享行为时,运行更全面的检查。
使用
rde-eval
对目标规则进行有限的本地检查。当命中数量较少时检查所有命中结果,数量较多时检查代表性样本。将每个确认的误报添加到规则测试和
fuzz
语料库中。
在推送拉取请求头后,为每个新规则或检测器行为变更运行
run-parity
。仅文档或仅测试的变更可跳过此步骤。如果无法运行一致性校验,请报告确切的阻碍原因。
只有在两次Daytona运行完成后,才能声称一致性。分别比较仓库和项目根目录的统计数据。在分类前检查目标规则的差异。

Prepare release artifacts

准备发布工件

Run
nr changeset
for user-visible changes to published packages. Use a patch changeset for rules, bug fixes, false-positive fixes, and diagnostic refinements unless release impact requires more. Skip only private, documentation, test, or tooling changes, and state why.
Write pull request copy after validation:
md
undefined
对于已发布包的用户可见变更,运行
nr changeset
。除非发布影响需要更高版本,否则对规则、缺陷修复、误报修复和诊断优化使用补丁版本变更集。仅私有、文档、测试或工具变更可跳过,并说明原因。
验证完成后撰写拉取请求文案:
md
undefined

Why

原因

<specific runtime problem>
<具体运行时问题>

What changed

变更内容

  • <detector behavior>
  • <valid patterns preserved>
  • <tests added>
  • <检测器行为>
  • <保留的有效模式>
  • <新增的测试用例>

Eval results

评估结果

CheckResult
Projects compared
<count>
Skipped projects
<count>
Added / removed
<added> / <removed>
Target rule delta
<added> / <removed>
False positives
<count>
Artifacts
<paths>
检查项结果
对比项目数量
<count>
跳过项目数量
<count>
新增/移除
<added> / <removed>
目标规则差异
<added> / <removed>
误报数量
<count>
工件路径
<paths>

Test plan

测试计划

  • <command and result>

Omit the eval table when parity did not run. State the reason instead.
  • <命令及结果>

如果未运行一致性校验,则省略评估表格,改为说明原因。

Handle review findings

处理评审意见

Fix correctness bugs, duplicated helpers, misleading names, and confusing code. Defer unsupported control flow only when it falls outside the contract. Reject requests that broaden the message or increase false positives.
Resolve review threads after the fix or explanation reaches the pull request.
修复正确性缺陷、重复的辅助工具、误导性命名和易混淆的代码。仅当不受支持的控制流超出约定范围时,才推迟处理。拒绝扩大提示信息或增加误报的请求。
在修复或解释提交到拉取请求后,解决评审线程。

Report validation

报告验证情况

Report commands, review findings, local RDE evidence, parity results or blocker, false positives fixed, regression tests, changeset, pull request notes, and residual non-goals.
报告使用的命令、评审意见、本地RDE证据、一致性校验结果或阻碍原因、已修复的误报、回归测试、变更集、拉取请求说明以及剩余的非目标内容。