fix(selling): 对齐架构规划粗估与 ROS 询价的成本口径 - #304
Closed
ruanzhengxin-zhuxing wants to merge 1 commit into
Closed
Conversation
architecture_planning 的月费粗估与 cost_estimating 的候选步骤列表价出现约 2.5 倍 偏差,且成本结论中出现无来源的 ¥0 有效价,导致两个阶段的成本口径不可对照、 用户看到的金额不可解释。 - architecture_planning: monthly_estimate 明确标注为"粗略估算 + 月度列表价口径", 新增必填 estimate_basis(pricing_mode + assumptions),禁止把合同优惠折算进粗估 - cost_estimating: 结论新增必填 pricing_calibers,把规划粗估与本次询价的列表价 (OriginalAmount)逐项对照;偏差超过 ±30% 或口径不一致时必须给出 deviation_reason - 新增 pricing_calibers 校验器与 require_pricing_caliber_alignment 完成守卫, 在代码层拦截 pricing_calibers_missing / planning_estimate_mismatch / deviation_reason_missing / discount_source_missing / zero_effective_price_without_source,避免只靠提示词约束被绕过 - 有效价低于列表价时必须给出可核对的 discount_source;接近 0 的有效价还需要 询价结果中真实返回过 TradeAmount,禁止无来源的 ¥0.00/月 - confirm_and_select 与 CLI/A2A/Web 展示链路同时呈现规划粗估与最终 ROS 估算及 偏差说明,total_monthly_cost 仍严格取最终 ROS 估算 - 顺带应用锁定 ruff 0.15.10 的基线格式化(pre-commit format 钩子要求)
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.
背景
Aone #85833794。证据 Session
d4c6272042684114b45d190aaefc753e与613e22c9f326426b92336226e5eaa417复现同一根因:architecture_planning 给出月成本约 ¥80-120,而 cost_estimating 询价得到列表价 ¥289.81/月(相差约 2.5 倍),且合同优惠后有效价约 ¥0.00/月无可核对来源。两个阶段的计价口径不可对照,用户在 confirm_and_select 看到的金额不可解释。修改内容
architecture_planning 标注粗估口径
monthly_estimate明确为"粗略估算 + 月度列表价口径"(对应询价的OriginalAmount)estimate_basis(pricing_mode+assumptions),写明实例规格、磁盘、公网带宽与计费方式等关键假设cost_estimating 回填并校正规划粗估
pricing_calibers:planning_estimate(原样复制候选粗估)、list_price(本次询价OriginalAmount汇总)、calibers_aligned,可选effective_price/discount_source/deviation_ratio/deviation_reasoncandidate.estimate_basis给出deviation_reason代码级门禁,避免仅靠提示词约束
pipeline/engine/pricing_calibers.py校验器与require_pricing_caliber_alignment完成守卫pricing_calibers_missing/planning_estimate_mismatch/deviation_reason_missing/invalid_deviation_ratio/invalid_effective_price/discount_source_missing/zero_effective_price_without_sourcediscount_source;接近 0 的有效价还要求询价结果真实返回过TradeAmount,禁止无来源的¥0.00/月双口径端到端展示
show_candidate_detail新增可选planning_monthly_estimate/cost_caliber_note,贯通 CLI 候选页签、A2A 事件与选项投影、Web outputs/diagrams/mermaidtotal_monthly_cost仍严格取最终 ROS 估算,不被粗估污染验收
tests/pipeline/engine/test_pricing_calibers.py(34 项,覆盖 2.5 倍偏差与无来源 ¥0 有效价场景)test_complete_step_tool.py新增守卫 accept/reject 用例;test_loader.py新增守卫键解析用例pytest:14399 passed / 4 skipped;make lint(ruff check + ty check)全部通过说明
顺带包含锁定 ruff 0.15.10 的基线格式化改动(仓库 pre-commit
format钩子要求,HEAD 本身未格式化干净)。