Repository navigation
periodic_report: single-source the reportable trigger kinds - #8630
2430468136 wants to merge 4 commits into
Conversation
triggers.py restated core._REPORTABLE_TRIGGER_KINDS as _REPORTABLE_KINDS while already importing eleven names from core -- the strongest form of the duplicate-knowledge case. It now borrows the owner object and the restated name is retired. The neighbouring _NON_REPORTABLE_KINDS is a different vocabulary and is left alone. The weekly preset's enabled_kinds lists the same eight kinds, but it is a per-preset configuration (the portfolio preset selects only cadence_due), so the guard declares it as an exception rather than folding it into the owner: coupling it would auto-enable future kinds, a domain decision. The declaration is pinned to one site. New guard: folded-value census, identity, retirement, behavioural parity through _normalize_policy, and poison controls. Refs loopx-project#4447. Signed-off-by: psychologister <230141834+psychologister@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max
本次评审对应提交 91fc13a,运行时对照当前主干 b7c9178。
[P2] 全包扫描误拒绝受支持的独立报告配置。 在隔离源码夹具增加显式选择相同八个 kind 的第二份报告配置,设置 21,600 秒间隔。真实触发决策接受它并选中 cadence_due,新增测试仍将配置文件判为非法重复并退出 1。 同一配置由运行时正常消费;同值的 weekly preset 也已获当前测试豁免。该属性属于各 profile 自身,允许各自选择启用 kind。 在 core 和实际验证入口核验同一个集合。用 profile 行为测试验证各自启用选择,把全包同值匹配留给已有 advisory。 tree_findings · 词表收敛规范
动机 / Motivation
报告收据和触发策略维护各自的八个可报告 kind,triggers 已从 core 导入相关验证器。 受影响的调用方包括配置报告触发规则、评估候选事件及使用内置 profile 的调用方。收据、策略及候选共用可报告集合。原五种抑制 kind 和单独的预设启用配置保有各自语义。 20 次真实 CLI 调用的退出码、完整 JSON 和诊断配对一致,含默认、显式及重复设置、八个 reportable、五个抑制 kind、未知 kind 和两种预设。 实测源码路径与隔离合成输入。未执行真实模型、安装态和托管 CI。
规格依据为当前主干的 docs/architecture/rfcs/semantic-vocabulary-convergence-v0.md。核验 track_a_callers_preserve_behavior 与 same_value_candidates_advisory 两项。收敛 RFC 规定相同值的候选只供审阅。复用要求语义槽、作用域和合同相同。 调用合同 · 词表收敛规范
改动思路 / Approach
运行时重用现有定义。pytest 另对整个 Python 包执行新增源码规则。 对已知消费路径检查实际引用,再通过入口测试验证原行为。新增扫描将同值匹配用于整个 Python 包,独立数据也会触发失败。
具体改动 / Changes
-
core 定义报告收据可以接受的 kind,各 profile 决定自己启用哪几种,且抑制值继续只进入候选解释。 _REPORTABLE_TRIGGER_KINDS
-
收据、策略及候选共用可报告集合。原五种抑制 kind 和单独的预设启用配置保有各自语义。 _normalize_policy
-
20 次真实 CLI 调用的退出码、完整 JSON 和诊断配对一致,含默认、显式及重复设置、八个 reportable、五个抑制 kind、未知 kind 和两种预设。 对原新增测试分别运行空白夹具、独立合法数据和实际消费者重述三个版本。无注入通过,两类注入均被拒绝。 tree_findings
对主干的风险 / Risks
主干 93 项、候选 125 项通过。两侧同三条 pending-intent 用例因旧 Goal activation metadata 失败。Ruff、diff 检查、DCO 和与当前 main 的合入模拟通过。 运行时配对包括合法输入和原有拒绝。源码反例只新增独立数据,原校验分支和调用结果均保留。新增的测试失败会影响后续与这两个校验入口无关的变更。
我的整体评价 / Verdict
请求修改。在 core 和实际验证入口核验同一个集合。用 profile 行为测试验证各自启用选择,把全包同值匹配留给已有 advisory。 保留一个能区分实际消费者重复定义与合法独立数据的回归用例。
English verdict: REQUEST_CHANGES. The shared trigger vocabulary preserved all 20 CLI outcomes. The new package-wide guard rejects an independently valid report profile. Keep ownership enforcement on the validating callers and exercise configuration through the profile contract.
| @pytest.fixture(scope="module") | ||
| def tree_findings() -> dict[str, str]: | ||
| findings: dict[str, str] = {} | ||
| for path in sorted(PACKAGE_ROOT.rglob("*.py")): |
There was a problem hiding this comment.
[P2] 在隔离源码夹具增加显式选择相同八个 kind 的第二份报告配置,设置 21,600 秒间隔。真实触发决策接受它并选中 cadence_due,新增测试仍将配置文件判为非法重复并退出 1。 在 core 和实际验证入口核验同一个集合。用 profile 行为测试验证各自启用选择,把全包同值匹配留给已有 advisory。
The whole-tree folded-value census rejected a legitimate second report profile that explicitly selects the same eight kinds with its own interval (21,600s): the real decision entry accepts it and selects cadence_due, but the census flagged the config file as an illegal duplicate. Per the convergence RFC, merge candidates are advisory (an equal value set is not proof of one concept) and reuse_existing requires the same slot, compatible scope and an equivalent contract. A per-profile enabled_kinds selection is a different slot, so whole-package same-value matching belongs to the existing advisory lane (the semantic inventory's merge candidates), not a hard gate. The hard checks now pin only the owner (core) and the validation entry (triggers._normalize_policy): identity borrow, the owner states the set once, retirement of the restated name, and behavioural parity through the entry. Per-profile selections are verified through the real decision entry, adding the same-set-different-interval counterexample and the weekly/portfolio split (weekly selects an authorized manual trigger, portfolio suppresses it as disabled_by_profile). The folded-value scan and its poison controls are retained for the targeted owner/consumer checks; the preset literal-site pin and the declared-config whitelist are dropped. 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 · reasoning_effort=max
评审提交 9aaaab723ab3800b29416658550755fc44a2b394,分叉基线 ea67e68972fc78ed9f5c507df12d5ef2d722f44f。
[P2] 归属检查误拦报告类型映射的等价改写。 在隔离副本中把已有 _REPORT_KIND 字典改用同序键、值元组组装,映射完全相同,23 个真实 CLI 请求的输出逐项一致。triggers.py 内的键元组仍使两条新归属断言失败。 阻断断言
动机 / Motivation
负责配置周期报告触发条件或维护这段逻辑的开发者会使用同一份可报告类型定义。 基线的触发校验和报告回执各维护一份相同的类型,日后只改一处时,同一个触发可能在校验通过、到报告组装才失败。 当前提交让两处共用类型。独立的六小时配置用同样八种触发类型,选择 cadence_due 并保留 21,600 秒间隔,新增检查也通过。 范围是报告触发校验、报告类型映射和归属测试。评估及组装仍走原有入口。
改动思路 / Approach
现有报告组装已有可报告类型的定义,触发校验可以直接复用。触发类型到报告类型的映射仍由触发决策维护。 保留类型共享、旧绑定退役和行为测试。将 AST 硬断言限于可指认的资格判断,允许同值的报告映射键,并让无明确判定用途的扫描结果仅作提示。 现有类型 owner 由回执校验和触发判定共同引用。触发决策先校验类型、再由 profile 与候选事实选择或抑制,然后返回结果供报告组装。 词表复用条件
具体改动 / Changes
2 个文件,+256/−13。生产 +4/−13,测试新增 252 行。 采用 ea67e68972fc78ed9f5c507df12d5ef2d722f44f 上的 docs/architecture/rfcs/semantic-vocabulary-convergence-v0.md。本轮核对 reportable_kinds_keep_trigger_and_compose_parity 与 same_value_without_same_slot_remains_advisory。同值候选规则 · 运行协议
- 缺省采用全部可报告类型,显式列表按同一 owner 验证。_normalize_policy
- 仍接受可解释为何被抑制的非报告类型。_normalize_candidates
- profile 与候选共同决定选中、去重和冷却。build_periodic_report_trigger_decision
- 把已选中的触发类型映射到报告类型,映射用途独立。_REPORT_KIND
- 当前 AST 断言把同文件的独立映射键元组计作重复。test_the_consumer_retired_its_restated_name
| 对照 | 结果 |
|---|---|
| 报告资格和配置差异 | 当前提交让两处共用类型。独立的六小时配置用同样八种触发类型,选择 cadence_due 并保留 21,600 秒间隔,新增检查也通过。 |
| 同值映射列举的误拦 | 在隔离副本中把已有 _REPORT_KIND 字典改用同序键、值元组组装,映射完全相同,23 个真实 CLI 请求的输出逐项一致。triggers.py 内的键元组仍使两条新归属断言失败。 |
对主干的风险 / Risks
23 个真实 evaluate-trigger 和 inspect-profile 请求输出完全相同。已授权 manual 在周报中选中,在 portfolio 配置中以 disabled_by_profile 跳过。compose-run 接受原触发回执,拒绝带 monitor_unchanged 的启用清单。未配置的 Goal 不生成交付计划或运行时状态。 原整包扫描会把独立的六小时报告配置当成重复;新提交已通过这个反例。 基线 168 项,候选 201 项通过。 Ruff、diff check、DCO、RFC 双语 diff 与实际主干合并树检查通过。
语义与 CI 对齐
同一文件内的 report kind 映射键与触发准入集合用途不同,且运行时在选择触发后才按映射得到 report kind。该断言阻断前者的等价改写。 本轮使用合成报告事实和回执。外部 sink 实际投递及托管 CI 未核验。
我的整体评价 / Verdict
请求修改新架构检查。生产复用在已验证的行为中成立。用同序等值的报告映射与实际重加旧资格定义作成对测试,要求前者通过而后者仍失败。 上一轮评审
English verdict: REQUEST_CHANGES at 9aaaab7. The trigger vocabulary is shared and the second profile now passes. The hard AST guard still rejects an equivalent report-kind mapping in triggers.py even though all 23 real CLI responses match.
| def test_the_consumer_retired_its_restated_name() -> None: | ||
| assert not hasattr(triggers, "_REPORTABLE_KINDS") | ||
| source = (REPO_ROOT / CONSUMER_PATH).read_text(encoding="utf-8") | ||
| assert _kind_literal_sites(source) == [] |
There was a problem hiding this comment.
[P2] 归属检查误拦报告类型映射的等价改写。 在隔离副本中把已有 _REPORT_KIND 字典改用同序键、值元组组装,映射完全相同,23 个真实 CLI 请求的输出逐项一致。triggers.py 内的键元组仍使两条新归属断言失败。 保留类型共享、旧绑定退役和行为测试。将 AST 硬断言限于可指认的资格判断,允许同值的报告映射键,并让无明确判定用途的扫描结果仅作提示。
The consumer-file blanket literal bans still rejected an equivalent rewrite of the report mapping: `_REPORT_KIND` legitimately keys on the same eight reportable kinds, so rewriting it as `dict(zip(keys, values))` leaves the mapping identical but folds a keys tuple to the owner set and trips the bans. Reproduced locally: with that rewrite the decision output is unchanged yet the guard failed the retirement and neighbour tests. Per the review, AST hard assertions must stay limited to identifiable eligibility decisions and same-valued report-mapping keys must be allowed. The two consumer-wide `_kind_literal_sites(source) == []` bans are removed. The report mapping's relationship to the vocabulary is now pinned at runtime by domain parity (`set(triggers._REPORT_KIND) == KINDS`), which accepts any equivalent source shape while a drifted domain still fails. Retained: the owner states the set once, the identity borrow, retirement of the restated name, the non-reportable neighbour's disjointness, and all behavioural parity through `_normalize_policy` and the real decision entry (including the same-set-different-interval profile and the weekly/portfolio split). The folded-value scan and its poison controls now guard only the identifiable owner site; whole-package same-value matching stays in the advisory lane. Verified: the equivalent-rewrite fixture is green, mapping-domain drift, restated-name return, and a broken borrow each still fail their targeted test, and the focused periodic_report selection plus ruff are clean. 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 · reasoning_effort=max
评审提交 202e71c,目标分支提交 9ce3a46。与当前主干 c5ff8fd 的合并树检查无冲突。
[P2] 验证名单校验跟随触发类型的共享定义。 代码位置
动机 / Motivation
Trigger policy 曾用模块内的第二份名单。前次评审发现,把映射等价改写成 dict(zip(keys, values)) 会误触发断言。 维护 periodic-report 触发政策或可报告类型的开发者。 共享可报告类型,验证策略的实际成员判断使用共享定义,并继续允许独立的报告类型映射与 profile 选择。 复审记录
在隔离副本中让 _normalize_policy 的显式名单校验改用名为 _LEGACY_POLICY_KINDS 的同值副本。默认名单和候选校验仍用共享定义。用只有 surface_only 候选、显式 enabled_kinds=[manual] 的有效请求,在入口前仅从共享集合移除 manual。 同值副本通过全部 34 项架构测试。共享定义去掉 manual 后,原提交以 enabled_kinds[0] is not reportable 拒绝该请求,副本仍接受配置,并返回 no_material_trigger。 移除 manual 只发生在隔离进程的测试条件中。远端 CI、报告生成和外部投递未运行。
改动思路 / Approach
已知消费者中承担共享定义语义的成员判断,展示列、映射键与各 profile 的选择继续独立。
- 共享定义复用。基线和当前提交对合法 manual、cadence_due 和只有 surface_only 的请求返回同样的 JSON。当前代码确实共用定义。 能力协议
- 回归约束范围。已知决策位置的测试能识别真实副本,又可容纳独立的同值用途。 收敛合同 工作项
具体改动 / Changes
triggers 在默认名单、显式名单校验和候选类型入口复用 core._REPORTABLE_TRIGGER_KINDS。新测试比较导入对象、旧名称和报告映射的键。
- 定义 schema 声明使用的可报告类型。 _REPORTABLE_TRIGGER_KINDS
- 校验显式名单,目前使用共享集合。 _normalize_policy
- 检查已知候选类型。 _normalize_candidates
- 现有名称和源码字符串仍可通过,实际显式校验可脱离共享定义。 test_the_consumer_retired_its_restated_name
对主干的风险 / Risks
- PASS。264 项源码测试通过,覆盖架构、主要 periodic-report 能力和控制面测试。 原有报告映射等价改写为 dict(zip(keys, values)) 后,34 项架构测试通过,三种 CLI 的 JSON 与原映射一致。
- FAIL。架构测试会接受在真实校验位置重新创建第二份名单。共享类型下一次变更后,显式策略会沿用旧名单。
我的整体评价 / Verdict
REQUEST_CHANGES。在真实策略入口验证显式名单随共享集合变化。用受控的共享定义变更验证拒绝和恢复,并让等价的报告映射与独立 profile 继续通过。 用当前实现和改名副本重跑 owner 移除成员的请求。校验须发现副本,原有八类及非报告候选行为也应继续通过。
English verdict: REQUEST_CHANGES at 202e71c. The earlier mapping-only rewrite passes. Replacing just explicit policy validation with an equal, renamed set still passes all 34 architecture tests. After removing manual from the owner in an isolated probe, the real CLI rejects the configuration on the submitted head and accepts it with the copied set. Exercise the consumer's actual binding.
| def test_the_consumer_retired_its_restated_name() -> None: | ||
| assert not hasattr(triggers, "_REPORTABLE_KINDS") | ||
| source = (REPO_ROOT / CONSUMER_PATH).read_text(encoding="utf-8") | ||
| assert "_REPORTABLE_TRIGGER_KINDS" in source |
There was a problem hiding this comment.
[P2] 验证名单校验跟随触发类型的共享定义。 同值副本通过全部 34 项架构测试。共享定义去掉 manual 后,原提交以 enabled_kinds[0] is not reportable 拒绝该请求,副本仍接受配置,并返回 no_material_trigger。 在真实策略入口验证显式名单随共享集合变化。用受控的共享定义变更验证拒绝和恢复,并让等价的报告映射与独立 profile 继续通过。
The previous revision accepted a renamed same-value copy of the reportable kind set feeding only _normalize_policy's explicit-list check: every value check passed because the values are equal today, so the guard could not see the duplicate. Reproduced in an isolated copy -- all 34 tests passed with the copy, and with `manual` removed from the shared definition the head rejected the request with enabled_kinds[0] is not reportable while the copy accepted it and returned no_material_trigger. Exercise the consumer's actual binding instead of scanning for literals: temporarily replace the shared object in both module namespaces with the set minus `manual`, require the real policy entry and decision entry to reject the explicit list, require the default to follow the reduced set, then restore and require the same request to pass. A same-valued copy in that path is inert under the change and fails the new test, while the equivalent _REPORT_KIND rewrite and a second profile selecting the same eight kinds with its own interval stay green. 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 · reasoning_effort=max
评审提交 0ae47e92a1370cdd910a1cb48a69533ab19fed2f。原差异基点 9ce3a46bfe525aa2167de6699fc676ce8ef60247。
动机 / Motivation
为周期报告配置触发方式的操作者,以及维护触发和报告类型映射的贡献者。 原代码在报告校验和触发处理各存一份可报事件集合。下次调整允许的事件时,两份定义必须同步,遗漏会让同一请求在不同校验点得到不同结果。 以手工触发为例,周报允许它,组合报告只接收定期触发。调整共享的可报资格后,显式策略及候选输入应同步遵从,独立的类型映射调整仍能通过回归。 候选的 29 组真实 CLI 结果与基线完全一致,上一轮显式策略的反例现在会被发现。新增架构检查仍然拒绝一个输出完全相同的类型映射改写,且会漏掉候选校验中的等值副本。 本次验证源码 CLI、真实触发判定和隔离的架构反例,未验证安装版、宿主编排和托管 CI。
改动思路 / Approach
复用 core 已有的可报词表是最小生产改动。测试可以核验绑定和两个实际校验分支,并保留既有语义清单对等值位置的 advisory 发现。 triggers 导入现有对象,一次移除重复定义。触发优先级和非报告事件保留原逻辑,新增架构用例负责验证规则归属。 复用现有运行时定义并用可区分的请求约束实际决策。独立映射的代码位置可以随职责调整,架构检查应接受判定及输出保持一致的变更。 本 PR 收敛报告触发词表的一处重复生产定义,并验证三个已改调用点。 原模块内的字典改写和六小时 profile 已覆盖。硬检查目前以 core 文件作为边界,类型映射迁入该文件会被误拦。
具体改动 / Changes
实际差异 2 个文件,新增 309 行、删除 13 行。生产修改是三个同类读取点和重复常量退休。新增测试文件 305 行,包含运行行为断言及源码形状扫描。 既有可报事件集合同时服务 policy 默认值、显式启用成员校验和候选类型校验。配置选择、可报资格和报告类型映射具有独立的职责。 验收约定
关键代码讲解
-
core 保有可报事件的既有定义。 _REPORTABLE_TRIGGER_KINDS
-
策略默认跟随 owner,显式列表依次校验。 _normalize_policy
-
候选入口使用两套独立词表的并集接受输入。 _normalize_candidates
-
架构断言把同文件内所有折叠后同值的集合计入同一结果。 test_the_owner_states_the_recorded_members_once
-
shared-reportable-owner。语义相同的生产资格读取应复用 owner。 候选的 29 组真实 CLI 结果与基线完全一致,上一轮显式策略的反例现在会被发现。新增架构检查仍然拒绝一个输出完全相同的类型映射改写,且会漏掉候选校验中的等值副本。
-
independent-profile-scope。profile 保有各自独立启用项与回退行为。 周报选中 manual,组合报告返回 disabled_by_profile,六小时配置选中 cadence_due。
-
semantic-slot-guard。硬检查应区分可报资格与独立的输出映射职责。 把语义不变的报告类型映射用 dict(zip(...)) 放到 core,再由 triggers 导入。29 组实际 CLI 结果完全一致,新增架构检查却因同文件出现第二个同值元组而失败。只让候选校验改用等值副本时,35 项架构检查全过。经共享集合移除 manual 的独立扰动后,真实 CLI 从拒绝非法候选变为受理并输出 disabled_by_profile。
对主干的风险 / Risks
[P2] 同文件硬检查会拒绝独立的报告类型映射。 保持键和值不变,把现有映射写成 dict(zip(...)) 并迁到 core,由 triggers 沿原路径使用。29 组真实 CLI 输出和退出码完全一致。架构测试会把其中的键元组当成第二个词表并拒绝。请限定强制检查的实际定义或使用点。 架构断言
候选校验可用一个小反例补齐。仅恢复候选入口的局部同值集合时,35 项检查仍通过。移除 owner 的 manual 后,正常入口会拒绝该候选,副本路径继续接收并输出 disabled_by_profile。在已覆盖的显式策略旁补一条候选资格对照即可。 候选校验
定向 Python 候选 131 项通过、基线 96 项通过。两边同样三项 pending-intent fixture 因既有 registry 编解码失败;候选新增 35 项架构测试通过。标准 premerge 的六项直接检查和两项选定检查通过。独立改动控制使用同一 29 组 CLI JSON,正常候选、基线和两种等价映射比较均相同。
语义与 CI 对齐
这里复用现有可报词表。RFC 的槽位、范围和等价合同是强制检查的依据。等值集合可以继续通过语义清单提出审阅线索。修正后,重跑该架构文件、真实 CLI 输入和当前 premerge。
我的整体评价 / Verdict
REQUEST_CHANGES。 生产词表复用已在实际入口成立。后续维护收益仍取决于把强制检查缩到资格判定。保持当前 profile 和报告类型输出,再复验架构正反例。 审查覆盖源码入口和测试门,显示行为通过同一批 CLI 输出对照。
English verdict: REQUEST_CHANGES at 0ae47e9. Production trigger behavior matches the base across 29 CLI cases. The hard guard still rejects an equivalent report-kind mapping move and misses a stale copy in candidate validation. Scope it to the actual eligibility decisions.
| def test_the_owner_states_the_recorded_members_once() -> None: | ||
| assert frozenset(core._REPORTABLE_TRIGGER_KINDS) == KINDS | ||
| source = (REPO_ROOT / OWNER_PATH).read_text(encoding="utf-8") | ||
| assert len(_kind_literal_sites(source)) == 1 |
There was a problem hiding this comment.
[P2] 同文件硬检查会拒绝独立的报告类型映射。 29 组实际 CLI 输出和退出码相同,硬检查因第二份同值元组失败。 按词表实际定义和用法验证,保留其他职责的同值表示。
| item = _object(value, label) | ||
| kind = _token(item.get("trigger_kind"), f"{label}.trigger_kind") | ||
| if kind not in _REPORTABLE_KINDS | _NON_REPORTABLE_KINDS: | ||
| if kind not in _REPORTABLE_TRIGGER_KINDS | _NON_REPORTABLE_KINDS: |
There was a problem hiding this comment.
[P3] 候选资格校验仍能绕过共享定义。 35 项架构用例保持绿。owner 移除 manual 后,候选继续受理该事件并错误标为 disabled_by_profile。 在真实判定入口覆盖候选资格对共享定义的使用。
What
periodic_report/triggers.pyrestated the reportable trigger-kind set as_REPORTABLE_KINDS(8 kinds) while already importing fromcore.py, the owner of_REPORTABLE_TRIGGER_KINDS. It now borrows the owner object; the restated name is retired. The distinct_NON_REPORTABLE_KINDSneighbour is left intact.Why
The strongest form of #4447: a module restating a constant whose owner it already imports from (no new import edge, no cycle). Equal values also make a renamed copy invisible to any value check, so the guard exercises the consumer's actual binding instead of counting literals.
A profile's
enabled_kinds(e.g. the weekly preset listing the same 8 kinds) is a per-profile configuration -- which kinds that profile enables -- not the reportable vocabulary: the portfolio preset selects only["cadence_due"], and a second profile may legitimately select the same eight kinds with its own interval. The_REPORT_KINDmapping likewise keys on the same eight kinds. Per the convergence RFC,reuse_existingrequires the same slot, compatible scope and an equivalent contract, and merge candidates are advisory because an equal value set is not proof of one concept. Those same-valued, different-slot uses are verified behaviourally; whole-package same-value matching stays in the existing advisory lane (the semantic inventory's merge candidates), not a hard gate.Guard
tests/architecture/test_periodic_report_reportable_kind_owner.pyis scoped to the sites that share one slot/scope/contract -- the owner (core) and the validation entry (triggers._normalize_policy): identity borrow, the owner states the set once, retirement of the restated name, the non-reportable neighbour is a different set, and behavioural parity (each reportable kind accepted, non-reportable rejected, default = owner set). A controlled change of the shared definition then exercises the real entry: withmanualremoved from the imported object,_normalize_policyandbuild_periodic_report_trigger_decisionrejectenabled_kinds=["manual"]and the default follows the reduced set; restoring the definition accepts the same request (no_material_trigger). A renamed same-value copy in that path is inert under the change and fails the new test. Profile selections are verified through the real decision entry: the weekly/portfolio split (weekly selects an authorized manual trigger, portfolio suppresses it asdisabled_by_profile) and a second profile selecting the same eight kinds with a 21,600s interval (accepted, selectscadence_due). The equivalent_REPORT_KINDrewrite (dict(zip(keys, values))) and a second profile present in the source tree stay green. The folded-value scan and its poison controls remain for the owner-side check.Tests
npm ci --ignore-scriptsnot run in this environment) and four pre-existing base failures (3pending_intentgoal-metadata, 1 frozen retrodiction baseline), identical with the head reverted._LEGACY_POLICY_KINDSsame-value copy feeding only the explicit-list check passed all 34 architecture tests; withmanualremoved from the shared definition the head rejected the request (enabled_kinds[0] is not reportable) while the copy accepted it and returnedno_material_trigger. The new guard fails on the copy (1 failed / 34 passed) and passes on the pristine head (35/35).dict(zip(...))rewrite of_REPORT_KINDpasses 35/35._REPORTABLE_KINDSre-added, borrowed object replaced by a copy, and the same-value policy copy each fail the expected guard (ALL_PROBES_BITE=True); pristine restored 35 passed.ruff checkclean on the changed file; this revision is test-only (no product code), so mypy's product-module scope is unaffected.