Repository navigation
Skip automatic usage observers for supported opt-outs - #8824
Conversation
Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]>
Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]>
There was a problem hiding this comment.
Reviewer: model_agent; GPT-6; OpenAI; self_reported (runtime attribution unavailable: session_not_bound)
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
使用既有环境开关关闭统计的 CLI 用户和运行 Goal 的 Host。 此前设置 LOOPX_USAGE_PING=off 后,真实 version 命令仍启动两个统计 Node 子进程,随后才由统计 owner 拒绝发送;现在相同命令启动零个统计子进程,完整业务 JSON、退出结果和临时状态不变。 在现有退出配置下,自动统计观察提前停止,避免无用的子进程、周期线程和 binding/native metadata 发现。 本 PR 不资格化整套最小内核、真实模型/context 采用、完整成本收益或 C1 默认切换。 剩余缺口是完整依赖闭包、普通/Core/Standard 治理矩阵、真实模型恢复和 context 连续性,以及原十项最终回归。
改动思路 / Approach
现有 TS owner 已拒绝这些环境值;Python 在 transport 调度前复用相同的负向 hint,可删除分散的旧判断,避免同步 Node 检查和第二个正向 policy owner。 当前 PR 的完整可用边界是既有环境 opt-out 下的自动 observer 隔离,覆盖 CLI、Host、quota、direct-cycle 和共享 detach;其余 R1/C1 验收继续由原任务承担。
CLI 的 begin/finish、Host 的 context、quota 的 detached cycle 仍使用原业务和统计链路。退出配置只让自动观察提前结束;允许路径继续由 TypeScript 检查 consent、notice、generation、锁和发送。共享 _detach 再挡住旧 ticket、verified return、直接调用及 Python child 的晚到观察,防止只修 CLI 开头而遗漏其他入口。直接 cycle 也在读 binding/native metadata 前拒绝。未增加 cache、registry、永久执行管线、公共开关或新的正向 Python decision owner。
| 既有环境值 | 原 TS 语义 | 此提交的提前行为 |
|---|---|---|
LOOPX_USAGE_PING=off / DO_NOT_TRACK=yes / CI=1 |
拒绝观察发送 | selected version 每项由两个真实 Node child 变为零个 |
LOOPX_USAGE_PING=yes / CI=false |
可通过环境 hint,仍须原 policy | 保留允许路径完整 observation requests |
DO_NOT_TRACK=false |
仍拒绝 | 不误当成 CI 的 false;FEFF/U+0085 按 ECMAScript trim |
具体改动 / Changes
本次完整评审绑定 9a46425bd620a5e479f174c360a5ac1a45c773b8,基线 4b5bf09cdf97b93e2d96eb1144df2a83212f4ade。依据已接受的 docs/architecture/rfcs/monorepo-distribution-split-v0.md,采用 PR 修改前的规范文本。I2 保留同一 owner;I7 本次完成既有 opt-out observer 部分,完整闭包继续 deferred;V1 全 corpus 和 V3 普通/Core/Standard 全 corpus 继续 deferred;I9 保留测量来源、失败和边界。双语 checkpoint 不改写原规范、预算或早先失败,安装资格只覆盖实测组合。
关键代码讲解
_environment_suppressed使用现有变量各自的 trim/case 集合,返回负向 boolean;passing hint 不授予发送或执行权限。新增回归实际调用原 TSblockedBy对照 54 行环境,覆盖合法值、混合值与 Unicode 差异。begin在 state/control/disclosure 和 child 之前提前返回 None;cli_runtime.main仍执行原 command,并用原 finish。验证选用真实 selectedversion路径;--version快路未进入 begin/finish,不能用它证明隔离。_detach在 path pinning 和 Popen 前重复负向检查,保护 late ticket、verified return、直接观察及 Python child。允许请求仍保留原完整 argv、路径、payload 和 transport。observe_goal_execution提前 yield 业务 context,避开 Thread 和 checkpoint 初始化;业务错误保留同一个 exception 对象,不能被 optional observer 的异常处理吞掉。observe_quota_cycle与_dispatch_cycle在可选 state/binding/native 查询前跳过;不改 quota 已决定的 admission、writeback 或 spend。
最终 paired checkpoint commit 只更新两份 RFC,四个 production/test 文件与已测 d8c5f55bb268f4e210db25c3a0cb5d47a857644b 字节一致。实际 C1 对照由该源码与 #8266 当前 1a3740cf9e6ebad337f17967452693a9050edc81 合并得到;不能拿旧裸 C1 fixture 代替实际组合。
对主干的风险 / Risks
没有发现阻断项。最强反例是测试只走 --version 或使用 disabled/missing state,于是作者测试通过却仍漏掉真实自动 child。本次保留 enabled consent/notice/generation,调用原 selected version、原 Popen 和真实 Node/TS;仅把丢弃的 child stdout/stderr 改成 PIPE,并选择 disposable state。旧基线每项两个 child 均正常 rc0/blocked,候选零个;完整业务 JSON、rc 和 state bytes 不变。没有强杀 child,也没有模拟发送拒绝结果。
PASS:107 个 Python usage/Goal/临时环境测试、55 个 TS owner 测试;八个允许环境保留 48 个完整 observation requests 和原 Host error。payload 对照在本地捕获 dispatch,与真实 Node transport 证据分开。两个全新 non-editable only-Core 安装分别覆盖候选和实际 current-C1,各通过三个原真实 CLI opt-out、22 个 metadata 场景、三个真实 File/SQLite Core correctness 场景,保留每组 31 份 raw CLI records。冷 metadata 范围是每组一个 fresh process 内 20 个 ID。Root 独立回读全部 56 份封存 artifact 和 1902/1903 个 Git/wheel/installed/RECORD payload;来源绑定不被当作执行真实性或 Goal 验收。
另外独立执行旧 main Core 与旧实际 C1 Core 的同一原 probe:各三个 flag 总计 12 个真实 child 变为零个;旧 outer rc1 仅为末尾 no-child oracle 的预期失败,所有 child 正常 rc0/blocked。Root 逐组核对完整 business stdout、business rc0、最终 state bytes 以及旧 installed payload/RECORD,均保持不变。
PASS:最终 unchanged head 的 premerge 编译、diff、双语、public boundary 和选定 repository smokes。此前工作树 premerge 因缺少 TypeScript npm dev dependency 失败已保留;在同一专用树正常安装依赖后通过,不降低门。remote CI 独立于代码评审和 merge readiness;其未知/红/待完成状态不被标记成已证明的 pre-existing。后续 TS 环境规则变更须继续跑真实 owner parity。回滚可整体 revert,未改变 persisted state/schema、既有 decoder 或 authority。
当前 exact head 的 remote CI 中 chat-bundle-browser (1) 与 dashboard-browser (1) 已失败,其他多项仍在运行/等待;原因暂保留 unresolved,不能伪称已证明 pre-existing。没有前端呈现 diff,CI 的既有 LOOPX_USAGE_PING=0 在 base/head 均提前拒绝 observer;上述独立本地证据覆盖本次改动的不变量。CI 仍由单独 readiness 记录,发现实际 PR regression 则阻断。
语义与 CI 对齐
复用现有 external-input 词汇;没有 substring/prose state 分类、共享 Enum、泛化 obligation 或新的 actor authority。Python boolean 只用于拒绝 optional scheduling。业务和 TS policy 的完整允许路径保持,提前拒绝差异有原 TS 与 real CLI 反例支持;原 normative RFC prefix、frozen budgets 和未完成 acceptance 保留。
我的整体评价 / Verdict
这是 justified_increment:long_horizon 的业务执行、持久结果和后续 continuation 保持;user_experience 改善了既有 opt-out 的实际启动行为,新增配置/确认轮数为零。仅 CLI/Host 自动观察和 RFC 证据 checkpoint 改变;已检查 usage-statistics-settings.tsx、notice 与 TS control owner,没有渲染呈现变更。 完整 Settings 旅程及真实模型采用未在本 PR 资格化。
完整 diff 与问题相称,最有价值的同域简化已用于删除分散旧检查并复用 shared detach。兼容路径、notice、consent、generation、payload 和错误仍由原 owner 持有。原十项正式验收、完整 R1/M3、natural drain、完整成本与 C1 default cutover 均未完成。本 exact head 的代码结论为 APPROVE;发表使用 COMMENTED self-review fallback,merge authority/readiness/线程检查另行执行,未把它伪称 GitHub formal approval。
最新 readiness 读回为 ready=false:43 项当前 CI,25 success、4 failure、14 pending;失败为 browser (1/3)、chat-bundle-browser (1)、typescript-core (2/3)、dashboard-browser (1)。workflow 尚未完成,失败日志暂不可取,原因保持 unresolved。PR head 未变且 MERGEABLE,完整 review threads 为 0,当前 COMMENTED APPROVE 有效;阻断原因只包含 status checks。已有 maintainer 授权允许 CI/GitHub policy-only admin bypass,必要本地验证、完整评审和线程门均已通过,不能把这条路径称为 ready=true 或 CI 通过。
English verdict: APPROVE for the exact reviewed head. Existing environment opt-outs now prevent automatic observer work; the real CLI, allowed payload/error parity and installed Core/current-C1 scope are validated. Full R1/C1, actual-model/context and complete-cost acceptance remain open; CI and merge readiness are separate gates.
Reading version information or running a Goal with an existing usage opt-out could still start an automatic statistics observer. Python recognized only three exact values, while the TypeScript owner already supported values such as
LOOPX_USAGE_PING=off,DO_NOT_TRACK=yesandCI=1. The observer could discover bindings or native metadata before TypeScript rejected sending.Reuse one negative-only environment hint at the existing CLI, Host, quota, direct-cycle and detach boundaries. It preserves each variable's existing trim/case semantics, including
LOOPX_USAGE_PING=yesandCI=falsepassing the hint andDO_NOT_TRACK=falseremaining blocked. TypeScript retains consent, notice, generation, state, payload and sending decisions; this adds no execution authority or public option.This delivers the automatic-observer portion of the minimal-kernel RFC's I7/V1/V3 boundary. See the accepted distribution RFC and the paired English checkpoint / 中文 checkpoint.
Validation:
The completed implementation is ready for exact-head review. The tested installed-Core/current-C1 isolation is qualified. The final paired RFC checkpoint adds only the new evidence; all four product/test files retain the qualified source bytes. Final premerge and merge readiness remain pending. This does not qualify complete process/network closure, natural descendant drain, measured overhead or total-cost benefit, actual-model/context adoption, complete D2/D5, R1/M3 or default cutover.