Skip to content

refactor(presentation): own the complete global-risks read in TypeScript - #7893

Merged
loopx-agent merged 1 commit into
mainfrom
codex/global-risks-ts-read-20261102
Nov 2, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/global-risks-ts-read-20261102

Conversation

@hhyykk

@hhyykk hhyykk commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

  • Outcome basis / optional anchor: TypeScript control-plane migration RFC: replacement-first migration of domain-neutral composition to the typed owner, with no parallel Python decision owner.
  • Goal/source and gap: loopx global-risks was composed in Python (global_risks.py, about 1,000 lines of row derivation, aggregation, ordering, agent scoping and envelope composition). The stale host-poll rule lived separately in host_poll_receipts.py.
  • Observable before → after: Python composition → one complete read projection in loopx/control_plane/presentation/global_risk_read.ts (presentation.global_risks.project). Frozen output for all 37 characterization cases is byte-identical, and the read keeps one transaction-local crossing (projection.envelope.seal is replaced by presentation.global_risks.project).
  • Issue/task and intended base: Self-contained migration slice; base loopx-project/loopx:main. No issue closure claimed.

Author Declaration

  • Written by: model_agent: Factory Droid (lead, review and commits) with OpenAI Codex CLI (implementation).

Implemented against

Criterion Disposition Symbol / path Check
Pin complete output before moving code implemented tests/test_global_risks_transaction_characterization.py, tests/fixtures/global_risks_transaction.json (37 cases including source errors and Agent-scope failures) 37/37 on the untouched baseline; expectations unchanged
One typed owner for composition implemented global_risk_read.ts; envelope sealing composes in process through the existing owner TS global_risk_read.test.ts
Single owner for the stale host-poll rule implemented stale_host_poll_risk and HOST_POLL_STALE_MINUTES removed from host_poll_receipts.py; the 240-minute inclusive microsecond comparison now lives only in TS TS stale-poll boundary cases
Public path redaction cannot drift implemented TS exports LOCAL_PATH_PATTERNS, mirroring the canonical Python patterns; tests/test_global_risks_path_pattern_parity.py compares ordered sources and flags fails when one TS pattern is altered (checked, then reverted)
Do not add a same-basename Python/TS pair implemented new module name has no Python twin; twins stay 45/45 semantic-vocabulary-drift-smoke.py
Vocabulary owner moves with the code implemented vocabulary_v0.json global_risks owner now points at the TS SOURCE_SURFACES; budgets unchanged vocabulary drift smoke
Ledger entry in both languages implemented ledger/typescript-control-plane-migration-v0/2026-11-02-global-risks-read{,.zh-CN}.md, linked from both RFC files check_rfc_bilingual.py
  • Self-check before submission: Read the full diff. The first draft copied the Python local-path redaction patterns into TS with nothing to detect drift. Because these patterns guard the public boundary, the parity test was added before submission.
  • Known dialect difference: Python scopes case-insensitivity to the Windows keywords ((?i:UNC), (?i:Volume), (?i:GLOBALROOT\Device\)), while the JS patterns use a whole-pattern i flag. TS can therefore redact slightly more than Python (for example, upper-case POSIX prefixes), never less. The parity test normalizes exactly these three groups and documents why.

Migration economics receipt

Field Result
Canonical owner loopx/control_plane/presentation/global_risk_read.ts
Legacy code deleted 996 lines in global_risks.py and 44 lines in host_poll_receipts.py
Code added 338 lines TS owner, 73 lines Python source acquisition and codecs, 1 line handler registration, 1 line vocabulary owner update
Cross-runtime calls 1 → 1 on all 37 cases, including source errors and Agent-scope failures
Product net change +413 / −1041 (net −628)
Facade exit Python keeps host source acquisition, persisted receipt decoding, shared redaction, Markdown rendering and the transport-unavailable error codec. They leave when the typed CLI owns those acquisitions and rendering with equivalent failure behavior (recorded in the ledger).

No latency or long-horizon benefit is claimed.

Scope And Continuation

  • Completed scope and remaining work: Complete for loopx global-risks. Rollback candidates remain an explicit omission, as before.
  • Deliberately not included: moving status collection, receipt decoding or Markdown rendering to TypeScript; installed-artifact or latency qualification.
  • Merge coordination: sibling migration PRs from the same batch also edit adjacent lines of effect_runtime_handlers.ts. Whichever merges second needs a trivial rebase.

Validation

  • Tested revision: de65cbb
  • Run state: finished
  • Input classes: synthetic
Check kind Result Public-safe evidence / limitation
static passed ruff check on changed Python; npm run typecheck:control-plane; git diff --check.
unit passed Python global-risks, host-poll receipts, characterization and path-pattern parity: 130 passed.
unit passed TS owner, handler dispatch and handler loading: 21 passed.
integration passed Real CLI JSON (4,740 bytes) and Markdown (943 bytes) match an archived base on a synthetic empty home after observation-timestamp normalization. control-plane-integrated-canary-smoke.py: File and SQLite passed.
canary passed loopx canary premerge --from-git-diff --git-diff-base origin/main: direct checks (diff, bilingual, compile, module ceilings), catalog canaries, risk-profile smokes and public-boundary scan passed; 0 manual holds.
unit failed (pre-existing) tests/test_projection_envelope.py::test_real_cli_quota_should_run_discloses_unreadable_scheduler_state fails identically on untouched origin/main (867615e): quota decision capture now requires --turn-instance-id or --begin-turn.
  • Coverage and gaps: CLI parity used a synthetic empty home; populated-source parity is covered by the 37 frozen characterization cases. Wheel/sdist and installed-host checks were not run. No PostgreSQL store behavior changes.

Frontend / Visual Evidence

  • UI impact: none. CLI JSON and Markdown output is byte-identical.
  • Before / After / First viewport / States / Source data / Attention / Craft: N/A; no UI surface change.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Technical Direction

  • Direction / acceptance reference: TypeScript control-plane migration RFC. The global-risk read is composition over status projections, so it belongs in TypeScript; Python remains a source acquisition and rendering adapter.

Shared-authority RFC fixture impact

  • Production-scale fixture schema / semantic dimensions / conformance arms / three-arm rehearsal: N/A; read-only projection, no authority store or persisted format change.

Boundary Checklist

  • Reviewed diff and body for private state, credentials, raw traces, internal links and local machine paths; none included.
  • No maintainer-owned benchmark work duplicated.
  • Change remains scoped to the request described above.
  • Paired RFC and ledger files changed together (EN and zh-CN).
  • UI impact marked none.
  • Every branch commit includes a DCO Signed-off-by trailer (git commit -s).

Merge requires explicit maintainer authorization (control-plane read surfaces and public redaction under loopx/**).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T11:13:55.212556Z de65cbb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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 loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max.

动机 / Motivation

需要跨 Goal 检查过期运行、诊断和轮询风险的操作者。原实现由 Python 归一化、合并和排序风险,再桥接封装 envelope;本次让一次 typed 请求完成风险组合,Python 继续读取状态和收据。

真实 CLI 的风险内容、排序、来源告警和 Markdown 与固定基线一致,包含 240 分钟边界、微秒、停止轮询及损坏收据恢复。不新增产品入口、权限、持久化状态或默认 provider,也不宣称性能或长程收益。本次不完成源 IO、顶层 CLI 和 Markdown 的原生化;完整性能资格仍缺少既有 §6 所要求的冷启动、warm 请求和内存证据。

审查依据为 docs/architecture/rfcs/typescript-control-plane-migration-v0.md,固定 spec_revision 867615e2c3aa2a32516a71d46f11a20d6fcb3289。本次有实际、可回滚的所有权增量;问题在于事务切换的既有交付验收尚未完成。

改动思路 / Approach

完整读取事务复用现有 envelope 与关系 owner,删除 Python 组合规则;保留的门面有实际源读取和 Markdown 调用方。本次边界是现有命令的完整读取所有权迁移;交付前仍需补齐既有性能门。

边界 固定基线 当前 head
来源读取 现有 Python IO 与 codec 保留原有读取及失败来源
组合与判定 Python 组合后调用 typed 辅助规则 一次完整 typed 投影,在进程内复用既有规则
输出与权限 JSON/Markdown,只读 保留输出、来源告警与权限边界

该表根据 de65cbb3418dcba155dea87a670e01ab76c51c11 的源码归纳,用于解释所有权,不代替执行证据;没有另外验证图形渲染。

具体改动 / Changes

  • projectGlobalRisks 负责完整投影;_read_host_poll_sources 保留有界收据获取,typed owner 负责时刻比较、Agent 过滤、风险聚合、严重性排序与 envelope;旧 Python stale 判定已删除。
  • handler、词汇 owner 指向、规范路径模式一致性测试与完整输出 fixture随生产路径一起检查;双语 checkpoint 及 RFC 链接同时更新。路径模式镜像仍有跨语言正则边界,未将模式文本一致称为整个正则语言等价。
  • 2.6:PASS。完整来源 envelope 的 stale/unreadable/incomplete 传播与原始预期一致;独立删去实际 CLI 响应 envelope 的变异均被断言检出。
  • 6-Correctness:PASS。本 PR 21 项定向 TS 测试通过;原始 Python 选择为 165 通过、1 失败。两 PR 的 53 个冻结特征用例原样在固定基线通过。组合审查执行了 24 组 File/SQLite 真实 CLI JSON/Markdown 对照、22 项补充边界观察,未发现 canonical 状态变动。
  • 7:PASS(隔离构建与安装)。基线与两个 head 正常构建 Chat bundle 后均成功生成 wheel/sdist;六个隔离安装环境的 48 次读取与对应源码输出一致。首次陈旧/缺失 bundle 构建失败保留,按现有构建流程修复,没有跳过构建验证;安装探针清除了继承的 PYTHONPATH 并确认实际模块来自隔离包。
  • 6-Performance:UNVERIFIED。下面的必需证据缺口仍未消除。

对主干的风险 / Risks

[P2] 补齐这次事务切换的默认 SQLite 性能资格。 docs/architecture/rfcs/ledger/typescript-control-plane-migration-v0/2026-11-02-global-risks-read.md 将现有命令直接切换到新 transaction,却只报告源码行为资格。既有 RFC 的 §6 明确要求每次事务切换报告 managed cold-start、warm typed request、完整事务及跨运行时次数、完整 CLI 相对固定 Python 基线,以及 idle/有界 burst 内存;默认 SQLite 还须满足未放宽的 5% 或未解释 25 ms p95 门。不声明性能收益并不能省略该交付门。

我补测的每命令/provider 七组有效完整 CLI 样本使用新隔离 runtime 上下文,尚未建立 warm PID 复用,不能作为稳态资格。SQLite global-risks p95 为 507.223 → 501.242 ms,但这个局部观察没有覆盖 warm 请求及 idle/burst 内存,不能替代完整要求。File 的尾延迟增加单独保留,不把 File-only 指标当作默认 SQLite 的独立否决理由。

最小修复是为当前 unchanged head 与 867615e2c3aa2a32516a71d46f11a20d6fcb3289 补齐上述已有量测:使用相同真实合成 SQLite fixture,分开 cold 与 warm,验证 runtime PID 复用,保留完整样本与来源/传输成本;若超过门限,保留 owner review gate 并解释或修复。无需修改业务范围、预算或测试预期。

另外,Python 选择中唯一失败是 test_real_cli_quota_should_run_discloses_unreadable_scheduler_state:固定基线与当前 head 都在进入投影前因缺少 --turn-instance-id/--begin-turn 返回相同 QUOTA_VALIDATION_FAILED。测试及 quota CLI 源文件逐字节未变,故这是已独立归因的旧夹具失败;原始运行仍为 FAIL,不请求本 PR 修复无关代码。定向 premerge 的 19 项选择、typecheck、Ruff 与 diff 检查通过,未查询或等待 CI。

本次 exact-scope change-quality receipt 也保留 FAIL:必需性能验证未完成,原始相邻 Python 运行仍有上述旧失败;没有把这些状态改写为通过。

我的整体评价 / Verdict

REQUEST_CHANGES,针对未完成的既有性能验收。风险视图的 owner 归属、规则删除、实际调用方和功能兼容性均有证据,未复现新的功能缺陷;无需扩大为整个迁移路线图。补齐当前 transaction 的默认 profile 资格后即可重新判断该缺口。

已检查现有 CLI dispatch、JSON 与 Markdown renderer;本次没有页面或布局改动,无需新增截图。无新增可视页面;持续运行性能仍待既有验收。保留代码回滚路径、来源失败和原有权限边界,不把 review 或测试通过当作安装主机采用、父目标验收或 merge 授权。

English verdict: REQUEST_CHANGES — head de65cbb3418dcba155dea87a670e01ab76c51c11 preserves tested behavior, but the existing RFC §6 default-SQLite transaction performance qualification is incomplete. Functional, negative-path and isolated artifact checks passed; the unrelated baseline fixture failure remains disclosed.

@loopx-agent
loopx-agent force-pushed the codex/global-risks-ts-read-20261102 branch from de65cbb to 6a0750d Compare November 2, 2026 16:04
loopx-agent
loopx-agent previously approved these changes Nov 2, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: loopx-agent; exact head: 6a0750d44f9f2a482580048a1f20afb63c6186f6

动机 / Motivation

操作者需要跨 Goal 查看过期运行、诊断和轮询风险。原实现对风险行做归一化、合并、严重性排序和 envelope 组装时,把 stale host-poll 判定分散在 Python 辅助模块中;规则移动或修改时容易产生两套语义。这个 PR 让一次 typed 读取拥有完整风险投影,同时保持操作者看到的 JSON、Markdown、排序、来源告警和错误边界。

改动思路 / Approach

Python 继续读取状态、注册信息、持久化收据和 Markdown,TypeScript 负责风险行推导、240 分钟边界判定、Agent 过滤、聚合、严重性排序、限制和 envelope 组合。旧的 Python stale host-poll helper 与其常量被删除,使规则只有一个生产 owner。公开本地路径模式由 Python 与 TypeScript 共用一致性测试约束,避免脱敏边界在迁移后漂移。

具体改动 / Changes

关键代码讲解

  • projectGlobalRisks 组合风险行、Agent scope、聚合、排序、限制和 envelope;冻结的 37 个特征用例保持输出兼容。
  • _read_host_poll_sources 只保留有界来源获取,stale 判定已移入 typed owner;缺少 continuation 或超过微秒边界的输入仍明确拒绝。
  • LOCAL_PATH_PATTERNS 与 Python canonical patterns 由有序 source-and-flags 测试校验,覆盖公开输出脱敏边界。

验证

  • TS owner 与 handler 定向测试通过:19/19。
  • Python 风险、host-poll、特征化和路径模式一致性测试通过:130/130。
  • npm run typecheck:control-plane 通过。
  • check_rfc_bilingual.py --base origin/main --head HEAD 与 git diff --check 通过。
  • rebase 冲突只发生在双语 RFC 的检查点列表;主干 quota 条目和本 PR 条目均已保留,没有业务代码冲突。

对主干的风险 / Risks

没有发现新的阻断性功能问题。主要剩余风险是状态投影字段的兼容性、损坏收据恢复和公开路径脱敏;这些边界分别由冻结输出、错误 envelope 和跨语言模式一致性测试覆盖。性能资格按当前 owner 的决定不作为本次合并门禁,因此本 review 不把性能结论标记为已认证。发布时 CI 仍在运行;合并前会继续等待必需检查与最新 head 再读确认。

我的整体评价 / Verdict

APPROVE。完整 global-risk 读取已由单一 TypeScript owner 组合,旧的 stale host-poll 规则和 Python 风险组合代码已删除,兼容性与负向路径有当前 head 的定向证据支持。merge 仍需等待 GitHub 必需检查通过,并针对未变化的精确 head 完成 readiness 检查。

English verdict: APPROVE — the exact head preserves global-risk output and failure behavior while consolidating stale host-poll and risk composition in one typed owner. Performance qualification is explicitly outside this merge decision, and merge readiness remains contingent on required CI and exact-head checks.

huangruiteng
huangruiteng previously approved these changes Nov 2, 2026

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: loopx-agent; exact head: 6a0750d44f9f2a482580048a1f20afb63c6186f6

动机 / Motivation

操作者需要跨 Goal 查看过期运行、诊断和轮询风险。原实现对风险行做归一化、合并、严重性排序和 envelope 组装时,把 stale host-poll 判定分散在 Python 辅助模块中;规则移动或修改时容易产生两套语义。这个 PR 让一次 typed 读取拥有完整风险投影,同时保持操作者看到的 JSON、Markdown、排序、来源告警和错误边界。

改动思路 / Approach

Python 继续读取状态、注册信息、持久化收据和 Markdown,TypeScript 负责风险行推导、240 分钟边界判定、Agent 过滤、聚合、严重性排序、限制和 envelope 组合。旧的 Python stale host-poll helper 与其常量被删除,使规则只有一个生产 owner。公开本地路径模式由 Python 与 TypeScript 共用一致性测试约束,避免脱敏边界在迁移后漂移。

具体改动 / Changes

关键代码讲解

  • projectGlobalRisks 组合风险行、Agent scope、聚合、排序、限制和 envelope;冻结的 37 个特征用例保持输出兼容。
  • _read_host_poll_sources 只保留有界来源获取,stale 判定已移入 typed owner;缺少 continuation 或超过微秒边界的输入仍明确拒绝。
  • LOCAL_PATH_PATTERNS 与 Python canonical patterns 由有序 source-and-flags 测试校验,覆盖公开输出脱敏边界。

验证

  • TS owner 与 handler 定向测试通过:19/19。
  • Python 风险、host-poll、特征化和路径模式一致性测试通过:130/130。
  • npm run typecheck:control-plane 通过。
  • check_rfc_bilingual.py --base origin/main --head HEAD 与 git diff --check 通过。
  • rebase 冲突只发生在双语 RFC 的检查点列表;主干 quota 条目和本 PR 条目均已保留,没有业务代码冲突。

对主干的风险 / Risks

没有发现新的阻断性功能问题。主要剩余风险是状态投影字段的兼容性、损坏收据恢复和公开路径脱敏;这些边界分别由冻结输出、错误 envelope 和跨语言模式一致性测试覆盖。性能资格按当前 owner 的决定不作为本次合并门禁,因此本 review 不把性能结论标记为已认证。发布时 CI 仍在运行;合并前会继续等待必需检查与最新 head 再读确认。

我的整体评价 / Verdict

APPROVE。完整 global-risk 读取已由单一 TypeScript owner 组合,旧的 stale host-poll 规则和 Python 风险组合代码已删除,兼容性与负向路径有当前 head 的定向证据支持。merge 仍需等待 GitHub 必需检查通过,并针对未变化的精确 head 完成 readiness 检查。

English verdict: APPROVE — the exact head preserves global-risk output and failure behavior while consolidating stale host-poll and risk composition in one typed owner. Performance qualification is explicitly outside this merge decision, and merge readiness remains contingent on required CI and exact-head checks.

loopx global-risks now calls presentation.global_risks.project. TypeScript
owns row derivation, stale host-poll detection, agent scoping, aggregation,
ordering, limits, groups and envelope composition. Python keeps host source
acquisition, persisted receipt decoding, Markdown rendering and the
transport-unavailable error codec.

The stale host-poll rule moves out of host_poll_receipts.py, so it has a
single owner. The TypeScript copy of the public local-path patterns is tied
to the Python owner by a parity test that fails on drift.

Frozen characterization (37 cases) stays byte-identical and the read keeps
one transaction-local crossing.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Signed-off-by: hhyykk <4408344+hhyykk@users.noreply.github.com>
@loopx-agent
loopx-agent dismissed stale reviews from huangruiteng and themself via cd2e0f0 November 2, 2026 16:07
@loopx-agent
loopx-agent force-pushed the codex/global-risks-ts-read-20261102 branch from 6a0750d to cd2e0f0 Compare November 2, 2026 16:07

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: loopx-agent; exact head: cd2e0f0a97e439ab6c8f76a6e4b6db1063c1a0f2

动机 / Motivation

操作者需要跨 Goal 查看过期运行、诊断和轮询风险。原实现对风险行做归一化、合并、严重性排序和 envelope 组装时,把 stale host-poll 判定分散在 Python 辅助模块中;规则移动或修改时容易产生两套语义。这个 PR 让一次 typed 读取拥有完整风险投影,同时保持操作者看到的 JSON、Markdown、排序、来源告警和错误边界。

改动思路 / Approach

Python 继续读取状态、注册信息、持久化收据和 Markdown,TypeScript 负责风险行推导、240 分钟边界判定、Agent 过滤、聚合、严重性排序、限制和 envelope 组合。旧的 Python stale host-poll helper 与其常量被删除,使规则只有一个生产 owner。公开本地路径模式由 Python 与 TypeScript 共用一致性测试约束,避免脱敏边界在迁移后漂移。

具体改动 / Changes

关键代码讲解

  • projectGlobalRisks 组合风险行、Agent scope、聚合、排序、限制和 envelope;冻结的 37 个特征用例保持输出兼容。
  • _read_host_poll_sources 只保留有界来源获取,stale 判定已移入 typed owner;缺少 continuation 或超过微秒边界的输入仍明确拒绝。
  • LOCAL_PATH_PATTERNS 与 Python canonical patterns 由有序 source-and-flags 测试校验,覆盖公开输出脱敏边界。

验证

  • 合并 7892 后的 TS risk、summary 与 handler 定向测试通过:25/25。
  • 合并后的 Python 风险、host-poll、特征化、路径模式一致性、summary 和摘要特征化测试通过:161/161。
  • npm run typecheck:control-plane 通过。
  • check_rfc_bilingual.py --base origin/main --head HEAD 与 git diff --check 通过。
  • rebase 后双语 RFC 的 summary/gates、quota 和 risk 条目均已保留;相邻 handler 自动合并且两类投影均已注册,复验通过。

对主干的风险 / Risks

没有发现新的阻断性功能问题。主要剩余风险是状态投影字段的兼容性、损坏收据恢复和公开路径脱敏;这些边界分别由冻结输出、错误 envelope 和跨语言模式一致性测试覆盖。性能资格按当前 owner 的决定不作为本次合并门禁,因此本 review 不把性能结论标记为已认证。发布时 CI 仍在运行;合并前会继续等待必需检查与最新 head 再读确认。

我的整体评价 / Verdict

APPROVE。完整 global-risk 读取已由单一 TypeScript owner 组合,旧的 stale host-poll 规则和 Python 风险组合代码已删除,兼容性与负向路径有当前 head 的定向证据支持。merge 仍需等待 GitHub 必需检查通过,并针对未变化的精确 head 完成 readiness 检查。

English verdict: APPROVE — the exact head preserves global-risk output and failure behavior while consolidating stale host-poll and risk composition in one typed owner. Performance qualification is explicitly outside this merge decision, and merge readiness remains contingent on required CI and exact-head checks.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: loopx-agent; exact head: cd2e0f0a97e439ab6c8f76a6e4b6db1063c1a0f2

动机 / Motivation

操作者需要跨 Goal 查看过期运行、诊断和轮询风险。原实现对风险行做归一化、合并、严重性排序和 envelope 组装时,把 stale host-poll 判定分散在 Python 辅助模块中;规则移动或修改时容易产生两套语义。这个 PR 让一次 typed 读取拥有完整风险投影,同时保持操作者看到的 JSON、Markdown、排序、来源告警和错误边界。

改动思路 / Approach

Python 继续读取状态、注册信息、持久化收据和 Markdown,TypeScript 负责风险行推导、240 分钟边界判定、Agent 过滤、聚合、严重性排序、限制和 envelope 组合。旧的 Python stale host-poll helper 与其常量被删除,使规则只有一个生产 owner。公开本地路径模式由 Python 与 TypeScript 共用一致性测试约束,避免脱敏边界在迁移后漂移。

具体改动 / Changes

关键代码讲解

  • projectGlobalRisks 组合风险行、Agent scope、聚合、排序、限制和 envelope;冻结的 37 个特征用例保持输出兼容。
  • _read_host_poll_sources 只保留有界来源获取,stale 判定已移入 typed owner;缺少 continuation 或超过微秒边界的输入仍明确拒绝。
  • LOCAL_PATH_PATTERNS 与 Python canonical patterns 由有序 source-and-flags 测试校验,覆盖公开输出脱敏边界。

验证

  • 合并 7892 后的 TS risk、summary 与 handler 定向测试通过:25/25。
  • 合并后的 Python 风险、host-poll、特征化、路径模式一致性、summary 和摘要特征化测试通过:161/161。
  • npm run typecheck:control-plane 通过。
  • check_rfc_bilingual.py --base origin/main --head HEAD 与 git diff --check 通过。
  • rebase 后双语 RFC 的 summary/gates、quota 和 risk 条目均已保留;相邻 handler 自动合并且两类投影均已注册,复验通过。

对主干的风险 / Risks

没有发现新的阻断性功能问题。主要剩余风险是状态投影字段的兼容性、损坏收据恢复和公开路径脱敏;这些边界分别由冻结输出、错误 envelope 和跨语言模式一致性测试覆盖。性能资格按当前 owner 的决定不作为本次合并门禁,因此本 review 不把性能结论标记为已认证。发布时 CI 仍在运行;合并前会继续等待必需检查与最新 head 再读确认。

我的整体评价 / Verdict

APPROVE。完整 global-risk 读取已由单一 TypeScript owner 组合,旧的 stale host-poll 规则和 Python 风险组合代码已删除,兼容性与负向路径有当前 head 的定向证据支持。merge 仍需等待 GitHub 必需检查通过,并针对未变化的精确 head 完成 readiness 检查。

English verdict: APPROVE — the exact head preserves global-risk output and failure behavior while consolidating stale host-poll and risk composition in one typed owner. Performance qualification is explicitly outside this merge decision, and merge readiness remains contingent on required CI and exact-head checks.

@loopx-agent
loopx-agent merged commit 214afbb into main Nov 2, 2026
6 of 7 checks passed
@loopx-agent
loopx-agent deleted the codex/global-risks-ts-read-20261102 branch November 2, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants