rde-eval

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Run a local rule evaluation

运行本地规则评估

Use React Doctor Evals (RDE) for bounded local iteration. Use
run-parity
only after the change has a pushed pull request.
使用React Doctor Evals (RDE) 进行有限的本地迭代。仅在变更已推送至拉取请求后使用
run-parity

Prepare both checkouts

准备两个代码仓库

sh
export REACT_DOCTOR_CHECKOUT=/absolute/path/to/react-doctor
export RDE_CHECKOUT=/absolute/path/to/react-doctor-evals

git -C "$RDE_CHECKOUT" pull --ff-only
ni -C "$RDE_CHECKOUT"
nr -C "$RDE_CHECKOUT" build
nr -C "$REACT_DOCTOR_CHECKOUT" build
The
path:
spec reads uncommitted React Doctor changes. Run RDE commands from the eval checkout.
sh
export REACT_DOCTOR_CHECKOUT=/absolute/path/to/react-doctor
export RDE_CHECKOUT=/absolute/path/to/react-doctor-evals

git -C "$RDE_CHECKOUT" pull --ff-only
ni -C "$RDE_CHECKOUT"
nr -C "$RDE_CHECKOUT" build
nr -C "$REACT_DOCTOR_CHECKOUT" build
path:
规范会读取未提交的React Doctor变更。从评估仓库运行RDE命令。

Run a bounded sample

运行有限样本

sh
cd "$RDE_CHECKOUT"
node dist/cli.js run "path:$REACT_DOCTOR_CHECKOUT" --runner local --take 100
node dist/cli.js digest "path:$REACT_DOCTOR_CHECKOUT" --rule <rule-id>
node dist/cli.js digest "path:$REACT_DOCTOR_CHECKOUT" --json --rule <rule-id> > <artifact-directory>/hits.json
Increase
--take
only after tests and the first sample pass.
sh
cd "$RDE_CHECKOUT"
node dist/cli.js run "path:$REACT_DOCTOR_CHECKOUT" --runner local --take 100
node dist/cli.js digest "path:$REACT_DOCTOR_CHECKOUT" --rule <rule-id>
node dist/cli.js digest "path:$REACT_DOCTOR_CHECKOUT" --json --rule <rule-id> > <artifact-directory>/hits.json
仅在测试和首次样本通过后增加
--take
的值。

Inspect target-rule hits

检查目标规则匹配结果

For each hit, or a representative sample when counts are high:
  1. Open the pinned repository at the reported location.
  2. Compare the code with the rule contract.
  3. Classify the hit as true positive, false positive, or unsupported.
  4. Add a rule regression test for each false positive.
  5. Add confirmed false positives to the
    fuzz
    regression corpus.
  6. Rebuild and rerun the same sample.
Record repository count separately from project-root count. Do not treat error records as clean scans.
对于每个匹配结果,或者当数量较多时选取代表性样本:
  1. 在报告的位置打开固定的代码仓库。
  2. 将代码与规则约定进行对比。
  3. 将匹配结果分类为真阳性、假阳性或不支持。
  4. 为每个假阳性添加规则回归测试。
  5. 将已确认的假阳性添加到
    fuzz
    回归语料库。
  6. 重新构建并重新运行相同的样本。
单独记录仓库数量与项目根目录数量。不要将错误记录视为干净扫描。

Report results

报告结果

Report checkout revisions, target rule, repositories, project roots, diagnostics, inspected hits, fixed false positives, and the artifact path. State any setup error or skipped repository.
After local validation, return to
rule-validate
. That skill decides whether to invoke pull request parity.
报告代码仓库版本、目标规则、仓库、项目根目录、诊断信息、已检查的匹配结果、已修复的假阳性以及工件路径。说明任何设置错误或跳过的仓库。
本地验证完成后,回到
rule-validate
。该skill会决定是否调用拉取请求一致性检查。