Repository navigation
feat(core): v0.5 P2 performance review generation and auto scoring - #62
Merged
Merged
Conversation
- srm_performance_review (PR{YYYY}{00000}, supplier + period unique, state machine per 02 §5.7, grade values grade_a..grade_d) and srm_performance_score (master_detail, weight snapshot)
- srm_performance_generate: schedule days 1-7 03:00, catch-up and idempotent; cycle by the supplier's highest material class (perf_cycle, CYCLE checked against the parameter by test); active = qualified or frozen; refuses and notifies the procurement director when active weights are not 100%; rebuilds a review a failed run left in calculating; asOf input for back-runs
- auto scoring: OTD, lot acceptance rate and PPM from the period's delivery records (same basis as srm_delivery_metrics), linear KPI scores from full/zero values; no data -> item unscored and review flagged data_incomplete (07 R7)
- views all / awaiting scores / data incomplete; nav; internal read-only, srm_admin deletes
- sums by loop accumulation (07 §6.3 PF15, data point on objectstack#14500); 200 suppliers x 30 lines ~8.6 s (07 R9, opt-in load test)
- design docs 02 / 03 / 05 / 07 and params synced; tests
Closes #51
Claude-Session: https://claude.ai/code/session_01A56prixkxJr4M3yuAoM4qi
Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Oct 24, 2026
Closed
marchtian
pushed a commit
that referenced
this pull request
Oct 26, 2026
- 07 §1: v0.5 delivered (PR #58, #59, #62–#64, #66–#70); gate 1 run through on 2026-10-26, waiting for confirmation. - 07 §2.1: steps 2, 7 and 9 worded to match the permission matrix (04 §2), the performance result application (03 §10 step 6) and PR #70. - 07 §2.3: gate-1 results (script, import idempotency, migration rehearsal, approval matrix, list performance; usability left to the pilot). - README: v0.5 row, 17 templates, next step. Claude-Session: https://claude.ai/code/session_01GE6xU6aD3pdp51u4NzEoKg Co-authored-by: Claude <noreply@anthropic.com>
marchtian
added a commit
that referenced
this pull request
Oct 26, 2026
…#71) - 07 §1: v0.5 delivered (PR #58, #59, #62–#64, #66–#70); gate 1 run through on 2026-10-26, waiting for confirmation. - 07 §2.1: steps 2, 7 and 9 worded to match the permission matrix (04 §2), the performance result application (03 §10 step 6) and PR #70. - 07 §2.3: gate-1 results (script, import idempotency, migration rehearsal, approval matrix, list performance; usability left to the pilot). - README: v0.5 row, 17 templates, next step. Claude-Session: https://claude.ai/code/session_01GE6xU6aD3pdp51u4NzEoKg Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by 田騏 · project thread
Closes #51 (overview #49).
改了什么
对象(02 §4.7、§5.7)
srm_performance_review绩效考评单:review_no(PR{YYYY}{00000})、供应商、周期、期间与起止日期、OTD / 批次合格率 / PPM / 订单响应及时率、五维得分(含hse_score)与总分、等级、审定人、申诉;supplier+period唯一索引;状态机 calculating → scoring → reviewing → published ⇄ appealed,开放状态可作废。新增两个字段:delivery_count(本期交付行数)、data_incomplete(07 R7「数据不全」)。srm_performance_score评分明细(master_detail,controlled_by_parent):指标、权重快照、原始值、得分、评分人、说明、已评分。grade_a…grade_d:平台要求选项值至少两个字符,设计里的a/b/c/d过不了 validate;02 里考评单和供应商的grade同步改了(供应商的grade还没建)。flow
srm_performance_generate(03 §10 第 1–2 步)asOf补跑更早的月份。perf_cycle(A 月度 / B 季度 / C 年度),每期第一个月生成上一期;flow 里的CYCLE与参数由测试核对一致。srm_delivery_metrics(OTD = 准时行 ÷ 交付行;合格率 = 合格行 ÷ 已检行,让步接收算不合格;PPM = Σ不良 ÷ Σ实收 × 10⁶);每条自动指标按满分值 / 零分值线性计分,数字都在指标库里。没有数据的项不给分并写明原因,考评单标「数据不全」。算完转scoring。calculating考评单,下次运行时删掉重建;单家失败不影响其他供应商。权限 / 界面:内部岗位只读(04 §2.3),
srm_admin可删(删后可补跑,字段对管理员 FLS 只读);视图:全部 / 待评分 / 数据不全;导航「绩效与风险 › 考评单」;英文词条齐全。平台缺口:CEL 不能对列表求和,flow 也没有汇总节点,所以 Σ不良数、Σ实收数、权重合计用
loop+assignment逐行累加。登记为 07 §6.3 PF15;按立卡门规则没有新开卡,而是在已关闭的「汇总 / 分组节点」卡 objectstack#14500 上以 objectstack-fleet[bot] 的身份补了一条数据点评论。性能(07 R9):进程内 sqlite 实测 200 家供应商 × 6 行交付记录,一次生成约 7.4 秒,× 30 行约 8.6 秒,重跑(全部跳过)约 0.6 秒,暂不需要拆分。压测默认不跑:
SRM_LOAD_TEST=1 pnpm vitest run test/performance-generate-load.test.ts。怎么验证的
test/performance-review.test.ts(14 条):A / B / C 三种周期与期间、冻结供应商纳入、潜在和没有品类的跳过、每条启用指标一行且权重快照;重跑不重复、非季初 / 年初只生成月度;OTD / 合格率 / PPM 数值与线性得分;季度跨三个月汇总;无交付记录标数据不全且不给零分;导入样例表格后与数据集srm_delivery_metrics逐家比对一致;权重不足 100% 时不生成并通知采购总监;残留的 calculating 考评单被重建;唯一索引;内部只读、管理员删除并级联删除明细。pnpm validate、lint --strict、typecheck、i18n:check --strict、test(204 通过)、build,以及governance/scripts/build.py --check(核心与三个扩展包)都在本地通过。已合入 main 上的 feat(core): v0.5 R1 risk events and the blacklist register #59(风险事件)。🤖 Generated with Claude Code
https://claude.ai/code/session_01A56prixkxJr4M3yuAoM4qi