fix(development): ground budget changes in consumer evidence - #4715
Conversation
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewed head: 3bafe3831ce1355c00baeff7a713c9d5d3ff4d08
Baseline: 6f0f9b062528e2f4a8d13c5fc7344ff3e9552ce7
动机
预算检查的目的,是保护有用且成本有界的行为。原接口规范只提供“放进已有预算或压缩旧字段”两条路,评审包虽禁止掩盖失败,却没有解释合理扩容的条件,容易让开发优化数字而损失消费者需要的语义。本 PR 完成的是研发决策规则修复,不代表 provider 迁移或某个实验已经达标。
改动思路
保留现有 owner:仓库开发指南解释具体决策流程,内置 PR-review capability 的 semantic_alignment 给通用评审要求。复用 validation_matrix 和 observable_semantics,不添加预算专属回执、证据字段或审批流程。相较只改文档,这同时修复真实 CLI 评审包;相较新增自动预算框架,这没有引入多余状态或判断器。
先区别硬上限、经验回归预算和展示裁剪,再同口径测量并检查信息价值、可推导冗余、兼容成本和余量,最后比较保持、压缩与合理扩容。保留原失败记录;硬约束和已冻结验收结果不能靠改测试放宽。
具体改动
AGENTS.md、docs/development/testing-and-quality.md和接口预算合同形成同一个开发入口:区分字符、字节、键数、stdout 和 token;不规定统一余量比例;相同数据处于不同 consumer lane 时,去重必须考虑调用方迁移。review_contract.py::build_review_execution_contract将上述取舍纳入已有语义评审。预算值、CLI 参数、证据 schema 和排序规则不变。REVIEW_POLICY_REVISION升至 7,skills/loopx-pr-review/SKILL.md的版本要求同步;既有 result checker 继续拒绝旧版结果认证当前评审。- 自修复表新增
budget_metric_overfitting,指向同一指南;既有公共 CLI 合同测试覆盖新规则及证据仍为unverified,没有新增一次性 smoke。
语义与 CI 对齐
这是已披露的评审指引变化,不是自动语义判定。相同公开 fixture 在独立基线 checkout 与本 head 的真实 CLI 比较中,仅归一化生成时间和 review age;其余差异只有 semantic_alignment.rule 与策略版本。新增断言在旧规则上失败、在当前规则上通过。合成一致性输入经真实 --check-result:revision 7 通过,revision 6 以 review_policy_revision:stale_or_missing 拒绝。
对主干的风险
95 项合同/结果校验测试、公开 PR-review smoke、Ruff、文档链接及 7 文件公共边界扫描通过。最终 canary 的 5 项直接检查、17/17 项风险检查全部通过,零失败、零 manual hold。
初次 canary 的词表检查因新 checkout 缺少 TypeScript parser 依赖而退出;补齐 npm ci --ignore-scripts 后重新验证,未修改阈值、扫描范围或测试预期。公共扫描另有两条已有 Goal 投影警告,与本 diff 无关且不含公共文件泄漏。
无默认关闭功能声明,也未改变 quota、scheduler、store、前端或 actor authority;无需数据库/前端验证。策略版本有意更新,使用旧评审技能副本的宿主应在更新时同步技能与 CLI。预算合理性仍需评审判断,测试和结果校验器不能证明人工/Agent 会作出正确经济决策。按本次评审包 wait_for_ci=false,不查询或等待远端 CI;本地必需检查照常执行。
我的整体评价
APPROVE。完整修复了开发规则与真实评审指令的矛盾,且没有以新框架代替判断。相关重构已落实为原位替换和统一文档入口;没有需要新增 successor 的剩余交付。精确 diff 的 change-quality 回执有效,未执行 safe-fix pass。审批结论不授予 merge 权限,本 PR 留给 maintainer 合并。
English verdict: APPROVE - 3bafe38. Budget review now distinguishes justified growth from metric gaming, preserves hard/frozen constraints and reuses existing evidence. Public CLI baseline/head parity, failing-before regression, stale-policy rejection, 95 tests, and 17 selected canaries plus 5 direct checks passed. No numeric budget or authority change; reviewer judgment remains necessary.
Goal And Delivered Outcome
Budget failures can lead to mechanical compaction that loses useful semantics, or an unsupported ceiling increase. The interface contract previously allowed only fitting the existing budget or compacting older fields; the PR-review rule did not explain when an increase is justified.
This change makes development and review compare consumer value, true redundancy, compatibility cost and measured headroom before choosing compaction, retaining a limit, or increasing a regression budget. Hard limits and frozen qualification thresholds retain their authority; historical failures are preserved.
Related: #4713. Base:
main. This PR changes no numeric budget or output fixture.Scope And Continuation
semantic_alignmentreview guidance reusesvalidation_matrixandobservable_semantics; no new evidence schema, receipt or approval workflow.Validation
3bafe3831ce1355c00baeff7a713c9d5d3ff4d08unitpassedtests/capabilities/test_pr_review_contract.pyandtests/capabilities/test_pr_review_result_check.py; existing negative verdict/revision gates retained.real_entrypointpassedexamples/pr-review-command-smoke.pyand public-fixturepr-reviewCLI readback; policy revision 7, skill parity and unverified evidence defaults.regression_paritypassedstaticpassedintegrationpassednpm ci --ignore-scripts, followed by a full rerun; no threshold or scan-scope change.Coverage: real review packet and existing result validation are covered. No store, scheduler or frontend behavior changes; real database and frontend testing are not applicable. Exact-scope change-quality receipt is valid. Same public fixture at base/head differs only in documented clocks and the intended rule/policy revision. Synthetic
--check-resultaccepts current revision 7 and rejects revision 6. Remote CI is not consulted under the resolved review policy (wait_for_ci=false).Frontend / Visual Evidence
UI impact: none. The changed entrypoint is the CLI-generated PR-review packet and repository contributor guidance.
Type of Change
LoopX Area