Repository navigation
factory: 上游同步追平(d2db89b79) - #33
Conversation
|
There was a problem hiding this comment.
Sorry @im47cn-bot, this account has used its review budget of 5,000,000 diff characters for the last 7 days.
You can request another review in 3 days and 12 hours by commenting @sourcery-ai review.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
审查者指南本 PR 以 sync-from-upstream.sh 为中心将 factory full 面追平至 awesome-rules d2db89b79,同时把上游评审波中的 fail-closed、幂等、原子暂存/释放、平台参数和退出码契约落入本地脚本与 Python 工具,并通过新增回归测试及 364 项测试、11/11 mutation kill rate 验证同步结果。 fail-closed 上游同步时序图sequenceDiagram
participant Check as upstream-sync-check.sh
participant Sync as sync-from-upstream.sh
participant Git as Git 上游
participant Gate as 验证门
Check->>Sync: --check
Sync->>Git: 解析锚点并比较文件
Git-->>Sync: 比较结果
Sync-->>Check: rc=0 clean / rc=1 drift / rc>=2 fatal
alt rc=0
Check-->>Check: 报告 full 面 clean
else rc=1
Check->>Gate: 将 drift 转交下游处理
else rc>=2
Check-->>Check: 传播致命退出码
end
原子变更验证时序图sequenceDiagram
participant Runner as mutations/run.py
participant Config as factory-local.json
participant Target as 仓库目标
participant Gate as Guard 或测试门
participant Stamp as evidence-stamp.json
Runner->>Config: 加载 final_gate_cmd 和可选的 docstring_gate_cmd
Runner->>Target: 验证仓库内目标
Runner->>Target: apply_defect
Runner->>Gate: run_gate
Gate-->>Runner: 退出码
Runner->>Target: 恢复原始内容
alt 所有必需缺陷均通过
Runner->>Stamp: write_stamp
else 未知的 --only 或无效目标/配置
Runner-->>Runner: fail-closed
end
下游同步检查结果状态图stateDiagram-v2
[*] --> Checking
Checking --> Clean: rc=0
Checking --> Drift: rc=1
Checking --> Fatal: rc>=2
Clean --> [*]: exit 0
Drift --> HumanReview: 本地 drift
Drift --> ApplySync: full drift
HumanReview --> [*]
ApplySync --> [*]
Fatal --> [*]: 传播 rc
文件级变更
提示与命令与 Sourcery 交互
自定义使用体验访问你的控制面板以:
获取帮助Original review guide in EnglishReviewer's Guide本 PR 以 sync-from-upstream.sh 为中心将 factory full 面追平至 awesome-rules d2db89b79,同时把上游评审波中的 fail-closed、幂等、原子暂存/释放、平台参数和退出码契约落入本地脚本与 Python 工具,并通过新增回归测试及 364 项测试、11/11 mutation kill rate 验证同步结果。 Sequence diagram for fail-closed upstream synchronizationsequenceDiagram
participant Check as upstream-sync-check.sh
participant Sync as sync-from-upstream.sh
participant Git as Git upstream
participant Gate as Validation gates
Check->>Sync: --check
Sync->>Git: Resolve anchor and compare files
Git-->>Sync: Comparison result
Sync-->>Check: rc=0 clean / rc=1 drift / rc>=2 fatal
alt rc=0
Check-->>Check: Report full面 clean
else rc=1
Check->>Gate: Route drift for downstream handling
else rc>=2
Check-->>Check: Propagate fatal exit code
end
Sequence diagram for atomic mutation verificationsequenceDiagram
participant Runner as mutations/run.py
participant Config as factory-local.json
participant Target as Repository target
participant Gate as Guard or test gate
participant Stamp as evidence-stamp.json
Runner->>Config: Load final_gate_cmd and optional docstring_gate_cmd
Runner->>Target: Validate in-repository target
Runner->>Target: apply_defect
Runner->>Gate: run_gate
Gate-->>Runner: Exit code
Runner->>Target: Restore original content
alt All required defects pass
Runner->>Stamp: write_stamp
else Unknown --only or invalid target/config
Runner-->>Runner: Fail closed
end
State diagram for downstream synchronization check outcomesstateDiagram-v2
[*] --> Checking
Checking --> Clean: rc=0
Checking --> Drift: rc=1
Checking --> Fatal: rc>=2
Clean --> [*]: exit 0
Drift --> HumanReview: local drift
Drift --> ApplySync: full drift
HumanReview --> [*]
ApplySync --> [*]
Fatal --> [*]: propagate rc
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…ons/run.py 长 main 同规则同文件触发
上游同步追平
d2db89b79(im47cn/awesome-rules main tip;上次锚点2be9f99,落后 23 commits)sync-from-upstream.sh --apply --commit --anchor main,full 面 15 文件覆盖(新增tests/test_upstream_sync_check.py、tests/test_fix_issue_pr_body.py),upstream-lock.json 锚点2be9f99→d2db89b79.factory面追平前基线 + 追平后复扫均干净;PR diff 面首跑红——追平采用的上游mutations/run.py触发low-code-quality(run.py:331-436),对齐上游 2026-09-01 评审保留项后复绿(52138d6,10 个变更 .py 文件零 issue)追平配套本地适配(skip 面 + 周界外闸配置)
factory-local.json增port_point: "011d8d8c"——上游 feedback.py 新契约(fail-closed 缺键即崩;反哺扫描下界 = 本仓移植首提011d8d8).factory/mutations/run.py采用上游版——被测对象与 full 面测试对齐:write_stamp 取最新 EVIDENCE 留档、--only未知 id 拒跑、target 越仓拦截、docstring 可选门(本仓未配置 → docstring 缺陷 SKIP)defects.jsonB-105 锚点随源演进——digest.py:30 已 f-string 化(PR audit: §2.2 错误分类闭集 + D14/D15 SM2 userId 方向拆分(源 227cf03) #28 整改 use-fstring-for-concatenation),%格式锚点失配(FAIL-config fail-closed 暴露)ec23e01d;双套件 364 passed.sourcery.yaml增low-code-quality保留项——上游 2026-09-01 评审同款 disable(同文件同规则:mutations/run.py长 main 顺序流程聚合标签,无可操作子建议,拆分收益边际);本仓触发系追平采用上游 runner 后的规则配置滞后,对齐处置而非重演评审(重构该文件会重新制造同步漂移)上游反馈候选
tests/test_mutations_run.py属 full(零本地化),但其被测对象mutations/run.py位于 skip 目录mutations/——每轮下游追平都会重现本轮的 20 红(测试先行、runner 滞后)。建议上游将mutations/run.py提升为 full 或将该测试降为 local(正道经 feedback-upstream 反哺)。人工合并后下游即与上游
d2db89b79对齐。Sourcery 摘要
使工厂自动化和验证工具链与上游 awesome-rules 保持一致,同时加强同步、托管、变异测试和安全契约。
新功能:
错误修复:
增强功能:
测试:
杂项:
Original summary in English
Summary by Sourcery
Bring the factory automation and validation toolchain into alignment with upstream awesome-rules while hardening synchronization, hosting, mutation testing, and safety contracts.
New Features:
Bug Fixes:
Enhancements:
Tests:
Chores: