Skip to content

fix(control-plane): prune stale runtime locators, tighten server/SQLite hygiene, and clarify CLI diagnostics - #9517

Merged
huangruiteng merged 1 commit into
mainfrom
codex/fix-effect-runtime-hygiene-cli-diag-20261127
Nov 28, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/fix-effect-runtime-hygiene-cli-diag-20261127

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Addresses Wave 39 Lane B runtime hygiene, external [P2] reviews (6083682546, 6083935832, 6084226087, and 6084615503), and CLI/control-plane diagnostic gaps across three bounded slices:

  1. Opportunistic bounded dead-PID cleanup for stale runtime descriptors (loopx/control_plane/effect_runtime.py)

    • Uses a resumable bounded os.scandir() sweep (_StaleCleanupSweep, cached under _stale_cleanup_sweeps with _STALE_CLEANUP_SWEEP_LIMIT = 4, _STALE_CLEANUP_SWEEP_IDLE_SECONDS = 300.0, and checkout/checkin concurrency isolation + generation fence) so multi-call cold misses resume directly from the live os.scandir iterator and buffered pending_candidates (deque) without re-scanning leading entries or resetting at a fixed raw offset.
    • Idle expiry in _checkout_stale_cleanup_sweep evicts and closes only inactive other directories (cached_key != key and elapsed >= 300s), keeping the active key's open iterator intact across low-frequency (>= 300s) cold misses while preserving handle closure on StopIteration, OSError, _private_directory_identity (st_dev, st_ino) mismatch, scandir_fn change, LRU eviction (> 4), cross-dir idle eviction, _stop_effect_runtime / restart_effect_runtime, os.register_at_fork, and atexit.
    • Enforces strict per-call inspection bounds (max_inspect = 64, max_removals = 32, max_scan_steps = 512 raw entries per round, _STALE_CLEANUP_SEEN_LOCK_LIMIT = 65536 for .ts-effect.lock.{claim,released,stale}. names) while staying under the 2,000-line module budget (1,971 lines), protecting caller locators, 60s grace window, live PIDs, non-symlinks, and direct/in-sweep lock files across _runtime_info_for_request, _inspect_runtime_locator(..., recover=True), and _start_runtime.
  2. TypeScript Effect runtime & SQLite authority store memory/handle hygiene (loopx/control_plane/effect_runtime_*.ts, loopx/control_plane/coordination/*.ts)

    • effect_runtime_server.ts: tracks pendingDispatchSockets, arms per-socket idle timeouts while awaiting newline framing (disarmed during handler execution and re-armed on response write), clears incoming buffers and removes data listeners upon dispatch/close/error/oversized frames, destroys silent orphaned connections during shutdownRequested, and clears idleTimer cleanly on server.close.
    • effect_runtime_exchange.ts: splits synchronous decodeExchangeEnvelope and writeEncodedResponse so raw wire strings, inline params, and response objects drop references before async snapshot I/O and handler execution while preserving caller request_id on early auth/validation errors.
    • effect_runtime_handlers.ts: resolves and clears lazyHandler's loading Promise reference after first initialization so repeated RPCs avoid retaining closure/Promise chains.
    • authority_store_codec.ts, authority_state_log.ts, sqlite_authority_store.ts: eliminates per-field tuple allocation in cloneAuthorityJson (Object.create(null) + Object.setPrototypeOf), extracts hashCanonicalCommitEnvelope to remove duplicate full-tree canonicalization and JSON.stringify passes on SQLite current() / commitAuthority(), tracks inTransaction around open(true) rollback recovery, and hoists db.prepare() statements in readReceipts, verifyAuthorityHistory, and loadCheckpoint.
  3. CLI & Stride diagnostics (loopx/cli_commands/quota_context.py, loopx/control_plane/work_items/stride_policy.ts)

    • Formats allowed --begin-turn runtime profiles dynamically from GUIDED_START_TURN_RUNTIME_PROFILES (_format_runtime_profile_choices, now surfacing antigravity_app).
    • Clarifies the stride_policy previous_review declared-work refusal message to identify reference_decision_ref and recommend "unknown" for adoption / goal_gain when closing a separate track.

Verification (HEAD c64fe9aa53f55ac5915b7d9bbdedbf530d082e9d, wait_for_ci: false)

  • npm run typecheck:control-plane: 0 errors
  • Targeted Node tests (tests/control_plane_ts/{effect_runtime_*,authority_state_log,sqlite_*,stride_*,replan_context}.test.ts): 642 passed, 0 failed, 4 skipped (includes tests/control_plane_ts/effect_runtime_hygiene.test.ts)
  • Targeted pytest on c64fe9aa53: 298 passed, 1 skipped (test_effect_runtime_*.py including 18 passed, 0 teardown errors across Python 3.11.17 and 3.14.8 in test_effect_runtime_locator_recovery.py, verifying real-dir tail reclamation at 600, 16,384, and 17,000 active prefixes, 301s low-frequency resumption in 10 calls with grace/lock preservation, cross-dir idle handle eviction, inode replacement invalidation, and 512-step non-runtime resumption, plus test_effective_turn_replan.py) and 3 passed, 218 deselected (test_quota_settlement_cli.py -k "begin_turn or runtime_profile")
  • ruff check on all 4 modified Python files: passed; mypy --strict --follow-imports=silent on modified Python source modules: 0 issues
  • control-plane-maintainability-ratchet-smoke.py: ok (unreviewed: 0, stale_exceptions: 0, magnitude_regressions: 0)
  • loopx check public boundary scan: 13 files, 0 errors/warnings
  • Goal-bound change-quality (personal-loopx-maintenance): receipt cqr_b719bf6ad6ca6a0fa099 (status: valid, decision: pass, unresolved_blockers: [])
  • Goal-bound canary premerge --tier standard: gate.status="passed" (6/6 direct checks, 10/10 catalog canaries executed/0 failed, 8/8 risk-profile smokes executed/0 failed)

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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.2-sol · OpenAI · runtime_reported · xhigh

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

评审 head 87522cabcd14f7a3f7099466e4c866638efe5f28,代码对照为共同祖先 b9357ae7e3e305f0d2cc284c23360085402dad7e。GitHub 当前目标 base 为 9074ac53fa97348f9ed327634235219d904e09c9。

动机 / Motivation

使用共享本机 Effect runtime 的 CLI、应用和调度器,在冷启动或 locator 丢失后需要继续原任务。
候选在冷发现未命中时清理旧 locator。它限制了进入检查和删除阶段的条数,但把目录中所有候选和锁先放入内存。平时积累的记录越多,这一步越重。
真实 SQLite 的正反向读回通过;本次新增清理需要把目录发现本身纳入可复验的工作量边界。
本次采用 macOS 私有临时目录和本地 SQLite。没有测量长期进程内存、生产目录规模、Windows 或远端 CI。

改动思路 / Approach

保留 SQLite、TypeScript dispatcher 和 locator 的各自现有 owner。目录枚举应在现有回收路径设定上限并能从下次继续,否则发现一次新 runtime 的成本仍由历史积累决定。
当前范围为同版本清理、协议读回与诊断。需要补齐冷发现的目录枚举界限和后续清理进展,独立确认长期驻留成本仍另有测量。

固定格式下互读与回执验证通过;发布/读取的原认证和 scope 保留。健康 locator 仍在返回之前跳过新清理。 另核 SQLite prepare 复用、打开失败时保留原异常和退出事务、lazyHandler 初始化共享以及 Stride 拒绝提示。Stride 仍要求已声明工作和可证后续结果,提示未修改允许值。

具体改动 / Changes

完整 PR 涉及 13 个文件,增加 865 行、删除 122 行。以 b9357ae7e3e305f0d2cc284c23360085402dad7e 的 docs/architecture/rfcs/typescript-control-plane-migration-v0.md 中 Two deployment forms, one implementation 为对照。冷发现负责自动找到同一个权威 runtime,启动和托管无需人工介入。 真实 SQLite 的正反向读回通过;本次新增清理需要把目录发现本身纳入可复验的工作量边界。 目前的负例只测目录遍历次数。它说明工作量未被现有上限限制,尚无生产时延或内存收益的量化结论。 基线规范

关键代码讲解

  • _cleanup_stale_runtime_descriptors 自动发现未命中时执行陈旧 locator 清理。先扫描目录,再按元数据、进程和锁保护判断有限删除。 源码
  • dispatchSocketRequest 在合法请求开始后等待发布锁,按原回执责任消费。入站缓冲释放,退出时关闭未分派 socket,活动请求仍排空。 源码
  • decodeExchangeEnvelope 解析和捕捉请求 ID。错误仍保留原请求 ID;同步提取字段,后续沿现有快照和 handler 路径。 源码
  • hashCanonicalCommitEnvelope 复用规范投影序列化并保持 v0 字节摘要。依现有 replay 和 SQLite 读写验证,旧新交替回执一致。 源码
  • _format_runtime_profile_choices 从权威允许集生成错误提示。antigravity_app 出现在提示中,准入条件保持同一枚举。 源码

对主干的风险 / Risks

[P2] 冷发现的目录遍历仍随目录总量增长。 从实际冷发现入口,在普通临时目录留下 32、80 和 240 个新鲜 locator。基线读取 0 项,候选分别遍历 32、80 和 240 项。没有文件被删,80 和 240 均超过声称的 64 项检查上限。超过上限的记录已进入候选列表,随后才开始做限制检查。 限制目录枚举及暂存,而后按轮推进扫描,保证不永久遗漏后续陈旧记录。保留自己目标、活跃锁和不明状态的原保护,用真实冷发现入口校验访问上限和多次推进。 判定位置

18 项 Python 和 464 项 TypeScript 定向测试通过。交替使用基线、候选、基线写入同一个临时 SQLite,另一版本均读到同一状态和版本,并验证回执与完整交易历史。 双方本地源码通过同一 _runtime_info_for_request 普通冷查路径。SQLite 用同一个临时数据库做三轮换写并异版本读回。 原有 Python/TS 定向场景、SQLite 旧新读回通过。持续 RSS、生产部署、新旧连接跨进程长期表现及当前主线陈述的两个 CI 历史失败都未独立归因。

我的整体评价 / Verdict

SQLite 格式与回执在两版交替写读后仍可用。对长期运行,目录累积仍会把额外工作带到首次调用,不能据此认定清理已经有界。把诊断和协议改进保留在原 owner 内,等冷启动界限与清理进度同时可验证后复核。

English verdict: REQUEST_CHANGES at 87522ca. The new cold-miss cleanup enumerates the entire locator directory before applying its inspection and deletion caps. SQLite history and receipt compatibility passed.

@loopx-agent
loopx-agent force-pushed the codex/fix-effect-runtime-hygiene-cli-diag-20261127 branch from 87522ca to 159f411 Compare November 27, 2026 05:28

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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.2-sol · OpenAI · runtime_reported · xhigh

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机 / Motivation

短时 CLI 和长期本地服务共用 managed Effect runtime。维护者还需要在受支持 Python 上运行新增定位回归。 沿现有 runtime owner 自动发现和回收陈旧定位文件,限制单次冷查开销,并在重复调用中逐步到达目录尾部。
上一轮首次冷查会遍历全量目录。当前首次扫描已收敛,但到达原始扫描上限时下一轮从开头开始,尾部旧记录仍不能回收。
独立实测首次在 32、80、240 项目录分别读取 32、64、64 项。240 项正例回收了位置约 180 的旧记录,640 项反例的尾段在 18 次冷查后仍全部保留。
长时线上资源曲线、Windows 文件系统与完整标准预合并未独立复跑。按当前设置未查询托管 CI。

改动思路 / Approach

用局部扫描窗口限制一次工作量与原 Runtime owner 相符,但每轮重开目录并从头消耗相同上限无法同时承担向后遍历。
保留每轮 I/O 上限,并让恢复位置能跨过已扫描的原始条目,或将深层回收放到独立有界维护路径。新增稳定排序或真实目录 512 之后的对照。目录迭代替身只应在测试主体局部生效,并向无关路径透传真正的 scandir。

具体改动 / Changes

完整核对当前 159f4113e0c3c6645929906f10c0ced7e07a9191 与实际 merge base cc44cb7c1601af333b5f828e9f9fe4b378a2c66a 的 13 个路径(+1087/-122)。GitHub 目标分支快照为 fc232e5d58699101f47729dc389f93a6d7426076。前一轮的首次全目录读取已修复。SQLite 规范哈希、事务和网络资源整理继续走现有 daemon 与 authority owner;CLI 提示仍由已有 runtime profile / Stride 选择提供。 Two deployment forms, one implementation

关键路径

对主干的风险 / Risks

[P2] 游标永远跨不过原始扫描上限。 在 640 个真实目录条目中,按实际 scandir 顺序将第 601–608 个设为已过宽限期的 dead-PID 定位文件,前 600 个保持不可删除。18 次调用真实冷查入口,扫描达到 512 后游标归零,8 个旧文件全部保留。240 项同类夹具能回收位于第 181–188 个的 8 条记录。 游标回绕

[P2] 新增 scandir 替身会使 pytest 清理报错。 新增用例把共享 os.scandir 替换成只有上下文管理器接口的包装,并保留替换直到 pytest fixture teardown。全局 Effect runtime 清理 hook 在其之前用 os.walk 遍历测试目录,产生 TypeError。Python 3.11.17 单独运行该新增用例为 1 passed、1 teardown error;Python 3.12.15 整模块为 16 passed、1 teardown error。 测试替身

455 项 Node 定向测试和 3 项实际 CLI 的 begin-turn 诊断测试通过。以上述实际 Git merge base 与当前头交错写入同一隔离 SQLite 库,三个交叉写入/读取的回执和 authority history 都通过。单段/分段传输保持 request_id,Stride 诊断补足 reference_decision_ref,CLI 运行时配置提示从已有 profile 枚举生成。 使用真实临时目录和冷查入口,只用计数适配器记录 os.scandir,未把目录顺序改成排序。SQLite 互读使用真实独立数据库。

我的整体评价 / Verdict

REQUEST_CHANGES。保留每轮 I/O 上限,并让恢复位置能跨过已扫描的原始条目,或将深层回收放到独立有界维护路径。新增稳定排序或真实目录 512 之后的对照。目录迭代替身只应在测试主体局部生效,并向无关路径透传真正的 scandir。 生产长时间回收效果仍需要直接验证,本轮覆盖真实冷查路径、确定性回收反例和共享状态兼容性。

English verdict: REQUEST_CHANGES at 159f411. The first scan is bounded, but repeated scans cannot reach stale descriptors beyond the raw 512-entry ceiling. The new scandir test double also breaks the normal pytest teardown on Python 3.11 and 3.12.

@loopx-agent
loopx-agent force-pushed the codex/fix-effect-runtime-hygiene-cli-diag-20261127 branch from 159f411 to 7c0f94d Compare November 27, 2026 06:01
@loopx-agent

Copy link
Copy Markdown
Collaborator Author

Addressed both [P2] findings from review 6083935832 (PRR_kwDOStEbEs8AAAABaqF-WA) on updated exact head 7c0f94d113d38d880a3c4d5b77ef97239bc1ed99:

  1. Cursor advancement beyond raw 512-entry window (loopx/control_plane/effect_runtime.py):
    • _scan_stale_descriptor_window now tracks a 1-based raw os.scandir cursor (raw_offset) separately from per-call window_steps (max_scan_steps = 512), skipping previously examined raw_index <= raw_offset entries without consuming window_steps while still observing lock filenames and bounding each call's I/O window (max_inspect = 64, max_removals = 32, wrap ceiling _STALE_RUNTIME_DESCRIPTOR_MAX_RAW_CURSOR = 16384).
    • Added real >512 directory regressions in tests/control_plane/test_effect_runtime_locator_recovery.py::test_cold_miss_cleanup_bounds_scandir_and_advances_across_240_descriptors covering both 608 real descriptors in actual unsorted os.scandir() order (600 leading non-removable + 8 expired tail entries beyond 512) and 600 non-runtime files preceding 8 stale runtime descriptors.
  2. os.scandir test double scoping (tests/control_plane/test_effect_runtime_locator_recovery.py):
    • Replaced the persistent monkeypatch with with monkeypatch.context() scoped strictly to the cold-lookup blocks, passes unrelated directories directly to real_scandir(path), and implements full iterator/context-manager methods (__iter__, __next__, __enter__, __exit__, close). test_effect_runtime_locator_recovery.py passed cleanly (16 passed, 0 errors).

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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.2-sol · OpenAI · runtime_reported · xhigh

Exact head: 7c0f94d113d38d880a3c4d5b77ef97239bc1ed99

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

[P2] 原始 cursor 重扫前缀,达到上限后尾部仍无法回收

真实目录含 17,000 个仍活跃的定位文件,退出进程的记录位于原生枚举最后。相同入口重复冷发现。 第 257 次枚举 16,448 个条目并重置 cursor,285 次后尾文件仍存在。上一头上限 512。当前头的 600 条对照第 10 次回收。 用可恢复的遍历位置或能轮转的索引分区。把已跳过的原始条目计入每轮预算,同时保留存活 PID、锁和宽限。 测原生目录 600、16,384 临界和 17,000 条前缀。断言每轮原始枚举有界,尾记录最终被回收。 变更位置 本轮计数 冷发现入口

动机 / Motivation

使用本地 Effect runtime 的 CLI 及服务会在冷发现时进入机会性清理。 上一头单轮读取最多 512 条,健康前缀后的陈旧文件可能永远无法达到。新 cursor 让部分大目录恢复,同时将过去已跳过的原始条目排除在本轮预算外。 真实目录中 600 条健康前缀后的退出记录第 10 次清理。17,000 条前缀时第 257 次扫描 16,448 条后归零,第 285 次仍保留尾部。 当前修订不会更改定位文件格式、活动进程保留条件、SQLite 记录身份或新授权。

改动思路 / Approach

Python 定位器控制抓取与冷扫,TS server 拥有单请求传输和排空,SQLite authority store 拥有事务与历史。三个拥有者无需共享新的恢复状态。 保留既有锁、存活 PID 与最小保留期;有界清扫仍属于冷发现,不改变请求或准入权限。 对当前完整十三文件核验过。相对上一评审,除 Python 定位器和对应测试外,11 个当前变更路径的内容相同。 既有契约

具体改动 / Changes

13 个文件,+1206/-122。复核采用 fc232e5d58699101f47729dc389f93a6d7426076 的产品契约。LOCATOR-TAIL not_met、LOCATOR-BOUND not_met、SQLITE-FORMAT implemented 逐项对应下列关键入口。 基线契约

  • _scan_stale_descriptor_window 处理locator 目录和已有 offset。从目录起点产出,跳过历史位置。扫描异常保留原记录。 源码
  • _cleanup_stale_runtime_descriptors 处理已检查候选和剩余回收预算。超过 raw cursor 上限重置。从头开始。 源码
  • dispatchSocketRequest 处理已接收请求帧。按 runtime 的既有授权继续。保留已经受理的处理。 源码
  • SqliteAuthorityStore.current 处理现有 head、历史及 checkpoint。继续使用原校验与 canonical bytes。拒绝不一致记录。 源码

对主干的风险 / Risks

16 项 Python 定位恢复检查通过。自然目录顺序的 600 条案例证明原边界有实质改善,存活前缀与真实退出 PID 明确区分。 窗口预算跳过原始 offset 的成本。17,000 条前缀场景单轮枚举达到 16,448 条后 cursor 重置,285 轮内仍有可回收文件。 用真实目录和已退出 PID 重放 600 与 17,000 两个匹配场景,量每次 os.scandir 产出,再验原生 locator 和 TypeScript 定向路径。 同一真实目录回放,上一头最多 512 项,600 和 17,000 前缀的尾部均未回收。新头 600 项场景能够回收,较大场景扫描更多仍失败。 使用隔离真实文件和真实退出 PID,未修改在用状态。遍历次数不是实际磁盘延迟,也不能为更大规模证明上线资格。 按 Goal 的 CI 设置未查询远端托管检查。

语义与 CI 对齐

窗口预算跳过原始 offset 的成本。17,000 条前缀场景单轮枚举达到 16,448 条后 cursor 重置,285 轮内仍有可回收文件。 用可恢复的遍历位置或能轮转的索引分区。把已跳过的原始条目计入每轮预算,同时保留存活 PID、锁和宽限。 按上述成对场景复验原入口,保留现有权限和状态词汇。

我的整体评价 / Verdict

扫描成本随 cursor 增长;超过更大固定阈值的尾记录仍无法到达。重复启动会反复承担同一前缀的成本。 普通小目录保持自然恢复。大目录的启动检查需要多遍回读过去已看过的文件名,最大的尾文件依然滞留。 保留现有定位与 liveness 所有者,让跨轮续读从上次进度继续,或使用可独立推进的有界分区。成本要包括从文件系统枚举出的所有条目。 本地 runtime 与诊断路径,首屏不受影响。 使用隔离真实文件和真实退出 PID,未修改在用状态。遍历次数不是实际磁盘延迟,也不能为更大规模证明上线资格。

English verdict: REQUEST_CHANGES on exact head 7c0f94d. A 600-entry prefix now clears, but skipped entries still incur I/O, and the raw-cursor ceiling permanently leaves a 17,000-entry tail unvisited.

Comment thread loopx/control_plane/effect_runtime.py Resolved
@loopx-agent
loopx-agent force-pushed the codex/fix-effect-runtime-hygiene-cli-diag-20261127 branch from 7c0f94d to d4fd669 Compare November 27, 2026 06:47

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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.2-sol · OpenAI · runtime_reported · xhigh

Exact head: d4fd66909b6f0ff8c5b215897671d719efa8ca4c

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

[P2] 空闲回收句柄同时丢弃扫描位置

一个长驻进程每隔 301 秒走一次冷发现,真实目录里有 600 项活定位记录排在一个退出进程的记录之前。上一头在第 10 次回收尾部。本头跑到第 20 次仍读相同的前 64 项,尾记录保留。相同本头改为一秒间隔,第 10 次可以回收。关闭空闲 scandir 后仍需保留能继续推进的有界位置或分区。回归应覆盖超时两侧、原始枚举上界和原 PID/锁保护。 空闲淘汰分支 冷发现入口

动机 / Motivation

长驻本地服务在冷发现时触发清扫。 旧扫描用位置续行,新扫描直接续读迭代器。 反复调用应到达目录尾部,同时限制每轮读到的条目。 已活跃进程及锁仍受原规则保护。公开约束要求在真实调用入口验证恢复和资源开销。 本地资格约束

改动思路 / Approach

Python 定位器持有可续用的 scandir 迭代器。TypeScript transport 处理帧、超时和排空,SQLite owner 保留 authority 事务和规范字节。句柄缓存的释放需要与目录身份及推进位置管理配合。

具体改动 / Changes

13 个文件,+1575/-127。相对上一评审改了定位器与其回归测试,其余 11 项源和测试路径未变。活跃 sweep 的候选检查仍沿用 grace、锁和存活状态。 扫描预算 候选处理

  • LOCATOR-RESUME。打开的迭代器给后续调用直接提供新窗口。缓存依赖同一目录身份,空闲回收把这份临时进度也删掉。 缓存取出
  • LOCATOR-BOUND。达到候选或原始条目上限后结束单轮扫描。走到尾部时关闭文件句柄。 窗口推进
  • SQLITE-FORMAT。沿用现有事务、序列化、历史和回执身份。收益来自复用已生成的规范编码。 SQLite 读取

对主干的风险 / Risks

独立复测中,17,000 项活前缀在活跃调用下第 266 次到达尾部,单次最多枚举 64 项。17 项 Python 定位恢复测试及 455 项 TypeScript transport、Stride 和真实 SQLite 测试通过。附加 51 项定向测试覆盖 authority log 等路径,与前组有交集。低频反例只用加速单调时钟,目录条目和退出 PID 来自真实文件及进程。

语义与 CI 对齐

五分钟空闲关闭使原来的扫描续行在低频路径上丢失。需要把这个路径的收敛性加入原生 locator 验收。未查询托管 CI。

我的整体评价 / Verdict

高频路径已消除前次的固定位置上限。在修订完成前,低频冷发现可能长期保留尾部陈旧记录,影响原来的自动回收范围。本轮求改限定在持续调用下的定位器续行。

English verdict: REQUEST_CHANGES on exact head d4fd669.

Comment thread loopx/control_plane/effect_runtime.py Resolved
…te hygiene, and clarify CLI diagnostics

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent
loopx-agent force-pushed the codex/fix-effect-runtime-hygiene-cli-diag-20261127 branch from d4fd669 to c64fe9a Compare November 27, 2026 07:32

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

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.2-sol · OpenAI · runtime_reported · xhigh

Exact head: c64fe9aa53f55ac5915b7d9bbdedbf530d082e9d

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

常驻本地进程在定位缺失时会为当前 runtime 目录启动清理。 上一头五分钟后丢弃同目录的扫描位置。本头低频调用可以续扫。 在每轮枚举有界的情况下,已退出进程的尾记录会被回收。 原活跃记录、锁、宽限、RPC 权限与 SQLite 历史规则继续适用。

改动思路 / Approach

定位器沿用现有私有目录、进程存活检查和原生迭代器。 跨目录淘汰和目录身份失效仍由现有句柄缓存负责。 transport 继续管理请求帧和关停,SQLite owner 保管事务与回执。 默认 provider 验收边界

具体改动 / Changes

全提案 13 个文件,+1743/-127。基线 3fbc379fa0f2fa1819157d4c6e4757e2c7a7963f。与前次精确头相比,本提案仅定位器和对应回归有变化。余下 11 个提案路径的基线和候选文件内容逐对一致。

  • LOCATOR-RESUME。当前目录跨空闲间隔保留扫描位置。其他过期目录仍可释放句柄。 缓存取出
  • LOCATOR-BOUND。限制原始目录枚举与候选检查,保留锁、存活进程和宽限条件。 扫描窗口
  • SQLITE-FORMAT。SQLite 读回沿用原历史、回执及事务一致性。RPC 排空保持已接收请求。CLI 运行配置与 Stride 诊断保留原规则与拒绝条件。 SQLite 当前状态 RPC 受理 Stride 诊断

对主干的风险 / Risks

600 项活文件前缀使用相同真实目录布局与真实退出进程,调用间隔用受控时钟。上一头在 301 秒间隔跑 20 次仍保留尾记录,本头第 10 次回收。活跃模式的 17,000 项前缀在第 266 次回收。这些场景单次最多枚举 64 项。18 项 Python 定位恢复测试、3 项 CLI 参数测试及 464 项 Node 测试通过。后者覆盖 transport、Stride 和真实 SQLite。

语义与 CI 对齐

正常 CLI 的定位目录为每用户的既有本地临时路径。不同目录互相淘汰后的长期收敛未实测。按目标配置未查询托管 CI。

我的整体评价 / Verdict

前次低频冷发现的缺口在当前目录路径已修复,仍保留现有释放和校验测试。此提交的通过结论以共享账号的作者自评发布。验证采用隔离本地运行环境。

English verdict: APPROVE on exact head c64fe9a. The active runtime directory resumes through 301-second idle intervals, and targeted locator, transport and SQLite checks passed.

@huangruiteng
huangruiteng merged commit 6181c1d into main Nov 28, 2026
24 of 29 checks passed
@huangruiteng
huangruiteng deleted the codex/fix-effect-runtime-hygiene-cli-diag-20261127 branch November 28, 2026 02:26
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.

2 participants