Repository navigation
issue_fix: single-source the issue-close event-type set - #8636
huangruiteng merged 1 commit into
Conversation
metrics_supplement._ISSUE_CLOSE_EVENT_TYPES decides which event types count as issue-close activity (issue_close_recommended / issue_close_request_published / issue_closed_observed / issue_reopened_observed). The supplement builds and filters the activity by this set; metrics_projection only validates the compacted rows it receives against the same four types, yet restated them inline as a function-local known_types set. The projection already imports private names from the supplement (_SUPPLEMENT_FIELDS), so borrowing one more owner object adds no import edge and cannot cycle. The inline set is retired and the validation now references the owner; the nine-member _EVENT_TYPES vocabulary is left untouched. The by-name semantic inventory cannot see this: the owner is a private _-binding it does not catalogue and the restatement was an anonymous function-local under a different name. The new guard keys on the folded value -- a whole-tree census, identity for the consumer, retirement, and behavioural parity through the projection's _issue_close_activity gate parametrised over the owner's membership. Refs loopx-project#4447. Signed-off-by: psychologister <230141834+psychologister@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · max
本次评审对应提交 b8dd1724f19da24afd0541036d1a99738b4a328a。
动机 / Motivation
影响通过 issue-fix metrics-supplement 生成补充数据,再用 metrics 汇总关闭进展的 CLI 使用者。Issue-fix 补充包生产方和指标报告消费方各维护一份相同的四种关闭事件;新增一种事件若只更新一处,会让同版本报告拒绝自身生产方的数据。两条真实 CLI 路径保留相同活动、覆盖信息、输出和拒绝原因:2 条建议、3 条已发布请求、1 次实际关闭、1 次归因、1 次重开冲销,净转化 0。验证的是源 checkout、隔离的本地流水与合成快照;未访问现场 provider、托管 CI 或已安装版本。
改动思路 / Approach
已应用有界重构:复用现有 supplement owner,保留 projection 的输入校验和统计职责。邻接的完整事件批次词表用途不同;不随本次改变。复查现有引用,没有运行时修改集合的调用点。 生产与消费复用同一个四成员集合;更宽的批次事件集合保留独立。没有新增 import 依赖,未移走 projection 的校验或归因逻辑。
具体改动 / Changes
关键代码讲解
基线 ea67e68972fc78ed9f5c507df12d5ef2d722f44f 对照提交 b8dd1724f19da24afd0541036d1a99738b4a328a。metrics-supplement 从事件批次挑出关闭建议、已发布请求、实际关闭观察与重新打开观察,按 issue 和时间组装 compact activity。接着 metrics 在同一四阶段词表下校验类型、事件 ID 和证据 URL,仍由既有逻辑判断请求是否先于观察到的关闭、重开是否冲销转化。实际走完两条 CLI,2 条建议和 3 条已发布请求只产生 1 次观察到的关闭和 1 次归因,后来重新打开使净转化回到 0。只有建议、只有请求、或者关闭早于请求的对照均不冒充实际关闭。
依据 loopx/capabilities/issue_fix/docs/protocols/issue-fix-metrics-projection-v0.md:shared_close_activity_vocabulary、evidence_order_and_reversal_parity、read_only_reporting_boundary。
对主干的风险 / Risks
长程报表连续性与 CLI 使用路径保持:同版本生产的补充包仍能读取,旧数据和缺失覆盖语义不漂移。最容易出错的是误用九成员批次词表、漏查发布和观察的 HTTPS 证据,或把默认缺失填零。正反真实 CLI 路径保持一致;两份报告都没有外部读写。整树 AST 守卫能抓直接集合字面量,未把它视为动态数据流分析。
语义与 CI 对齐
通过:真实 supplement → metrics 的两个完整 JSON 及六类拒绝路径在基线和 head 相同;缺省补充仍是 null。32 项聚焦用例和标准 premerge 均通过。消费方直接重述由 1 处降为 0。未查托管 CI。
我的整体评价 / Verdict
批准。既有关闭统计和证据边界保留,生产方与消费方不再各自维护这份事件词表。本次评审覆盖现有宿主与 CLI 行为。验证的是源 checkout、隔离的本地流水与合成快照;未访问现场 provider、托管 CI 或已安装版本。
English verdict: APPROVE. The projection shares the existing four-event vocabulary while preserving read-only reporting, evidence checks, and reversal semantics.
metrics_supplement._ISSUE_CLOSE_EVENT_TYPES decides which event types count as
issue-close activity (issue_close_recommended / issue_close_request_published /
issue_closed_observed / issue_reopened_observed). The supplement builds and
filters the activity by this set; metrics_projection only validates the compacted
rows it receives against the same four types, yet restated them inline as a
function-local known_types set. The projection already imports private names from
the supplement (_SUPPLEMENT_FIELDS), so borrowing one more owner object adds no
import edge and cannot cycle. The inline set is retired and the validation now
references the owner; the nine-member _EVENT_TYPES vocabulary is left untouched.
The by-name semantic inventory cannot see this: the owner is a private _-binding
it does not catalogue and the restatement was an anonymous function-local under a
different name. The new guard keys on the folded value -- a whole-tree census,
identity for the consumer, retirement, and behavioural parity through the
projection's _issue_close_activity gate parametrised over the owner's membership.
Refs #4447.
Signed-off-by: psychologister 230141834+psychologister@users.noreply.github.com