Skip to content

fix(explore): share runtime revision within a context read - #7013

Merged
loopx-agent merged 1 commit into
mainfrom
codex/explore-read-request-scope
Oct 21, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/explore-read-request-scope

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

Reading Explore context invokes several TypeScript operations. The Python adapter currently checks the managed runtime's source tree separately for each operation. Quantitative findings in #7011 amplify this into a source-tree check for each uncached measurement, even when the displayed result page is small.

Reuse the existing request scope around explore_turn_context: one logical read shares one runtime revision; the next read checks again. This is a two-line product change and a focused File/SQLite regression. It adds no cache, wrapper helper, configuration or protocol.

With 600 synthetic quantitative findings, the real CLI's median elapsed time changed from 4.005s to 0.495s with File, and 4.268s to 0.603s with SQLite. These are three uninstrumented samples after a separate warmup, measured on an isolated #7011 snapshot plus this exact Python change. Full JSON results and source-log bytes remained unchanged. These measurements qualify this bounded read workload, not whole-agent efficiency or outcome quality.

Intended base: main. Related to #7011; its branch and quantitative-result implementation are not changed here.

Author Declaration

  • Written by: model_agent — OpenAI GPT-6.1 Sol.

Implemented against

Criterion (spec clause) Disposition Symbol / path Validation
Pin one managed runtime revision for a logical request implemented explore_turn_context uses the established ContextDecorator New File/SQLite regression: one source snapshot per read, fresh subsequent findings and cleanup after malformed-history failure
Refactor real-path validation and semantic parity implemented Existing CLI and canonical read adapters Real CLI comparison with complete JSON equality; isolated real File and SQLite; failed-source recovery

Self-check: inspected the shared scope owner, existing CLI/frontend consumers, current main and related Explore work. Python remains a transport adapter; TypeScript still owns decisions. No agent guidance, ranking, scoring, state format or permission changes.

Scope And Continuation

Complete within the request-scoping fix. The persistent reader still validates the complete evidence source and does not reuse Goal state across requests. The existing measurement cache's cardinality boundary remains; enlarging it would only move that boundary and would not solve cold CLI reads.

The quantitative producer/adoption work remains with #7011 and its existing research work. This PR neither supplies that producer nor proves model adoption, accepted research outcomes or scientific benefit. No installation, merge or experiment was performed.

Validation

  • Tested revision: 20837965ddab053f0271775a327ec66310345c9e, base 5bf58c1ca3d21919b15c662bc705c3e069bfb496.
  • Run state: finished.
  • Input classes: synthetic, public_fixture.
Check kind Result Evidence / limitation
integration / real_backend passed 101 Python tests across request scope, Explore context and result writeback. Real isolated File/SQLite stores; subsequent reads observe new findings; malformed history is refused and recovery remains fresh.
regression_parity passed Same final regression fails on the unscoped integration baseline with repeated source snapshots; the scoped version uses one. This tests work counts, not a timing threshold.
real_entrypoint / real_backend passed 600-row CLI comparison above on real File and SQLite, Node 24.21.0 / SQLite 3.53.4 / Python 3.14.8; three measured samples after warmup. Owned disposable data only.
regression_parity passed Complete quantitative, legacy and graph/harness-disabled JSON projections equal before/after; evidence-log bytes unchanged.
integration passed Isolated #7011 f2ac2e8d2273318c81930d2d344bd067b527d9d1 plus the same Python file: 12 Python / 8 TypeScript tests, including measurement pagination and stale revision rejection. This is composition evidence, not a full review of #7011.
static passed Ruff on both files, public-boundary scan, bilingual RFC diff check, semantic advisory and git diff --check. No new semantic vocabulary.
manual passed Exact-scope quality receipt cqr_2c15888529f7029febce verified valid.
integration passed Standard native premerge on the frozen exact head: 6 direct checks and 5 selected canaries passed, zero failures or warnings; exact-scope receipt remained valid.

Measurements use private local captures; no raw profile, runtime data, benchmark trace or local path is published. Remote CI was not polled. Installed usage, larger histories, other host/platform performance and end-to-end agent outcomes remain unqualified.

Frontend / Visual Evidence

UI impact: none. No presentation or interaction is added; consumer projections remain equal. The CLI and shared read adapter are validated above; installed UI performance was not measured. Screenshots are not applicable.

Type Of Change And Area

  • Bug fix
  • Test update
  • Capability or extension
  • Host or runtime integration

Shared-authority fixture impact: no provider promotion, storage, routing or persisted-state change. Real File/SQLite read conformance is covered above; PostgreSQL authority code is unchanged.

Boundary Checklist

  • Public-safe code, synthetic fixtures and aggregate results only.
  • No model, solver, native evaluation, account or experiment execution.
  • No paired RFC changed; staged bilingual check passed.
  • DCO sign-off retained.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@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.1-sol; OpenAI; runtime_reported; reasoning_effort=max.

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

未发现阻塞性问题。以下结论针对完整 PR 7013@20837965ddab053f0271775a327ec66310345c9e;这是评审结论,不是合并或安装授权。

动机

需要读取不断增长的 Explore 研究记录的 Agent,以及通过 CLI 查看这些记录的用户。 同一 Goal 的600条量化记录曾触发608次运行时版本检查;修复后一次逻辑读取检查1次,下一次独立请求仍重新检查。 完整JSON、来源日志和权威状态保持一致;本机三次无剖析样本中位耗时,File为4.895→0.699秒,SQLite为3.869→0.507秒。

本PR不改变评分、选择、权限、提示词或数据格式,也不证明已安装产品或Agent任务收益。 真实量化生产者接入及后继模型采纳、原生成果和完整成本收益仍由既有量化功能工作验收。

改动思路

复用已有请求作用域足以消除重复源码检查;没有新增缓存、状态或语义owner,严格证据校验和TypeScript决策继续执行。 当前PR只限定一次Explore读取的运行时版本生命周期,并保留下一次读取和失败恢复;生产者与研究效果继续沿既有量化功能工作推进。

入口仍是既有 Explore CLI、回合开始和重规划读取。Goal 配置、注册 Agent、严格历史读取及 canonical Todo 读取先经过原 owner,TypeScript 继续生成投影;Python 只把这些调用包在已有的逻辑请求生命周期内。嵌套调用沿用外层版本;独立下一次请求重新检查。作用域不缓存 Goal 内容,也不形成原子数据快照。关闭功能、坏源和拒绝结果都继续走原路径,不增加用户配置或确认轮次。

最强反对理由是加速可能来自丢证据、跨请求复用旧结果或只优化小样本。独立对照保留600条完整来源,未扩大512项缓存;同一装饰器干预把版本检查从608次降为1次,同时保持全部返回值及原状态,支持选择这个现有边界。

具体改动

完整差异为2个文件:生产代码 +2/-1,回归测试 +71;没有新增协议、持久状态、CLI参数或并行规则 owner。

关键代码讲解

  • explore_turn_context:既有参数、策略和注册校验、完整历史/canonical读取、分页与 typed projection 均保留;只在整个读取外层使用已有装饰器。
  • effect_runtime_request_scope:本身未修改。它复用活动请求、惰性取得源码版本,并在成功或异常后 leave/reset;已有测试覆盖真实源码变化、嵌套、并发及复制上下文,长驻 CLI 不会因此固定一个版本。
  • test_explore_read_pins_runtime_once_and_rechecks_after_success_or_failure:使用真实隔离 File/SQLite;计数器调用实际指纹实现,新 finding、坏源拒绝、清理及恢复均通过。相同测试字节在不可变旧基线分别观察到7次和6次检查,而非1次,证明回归检测确实能抓到旧问题。

规范依据为 docs/development/testing-and-quality.md,规范版本 5bf58c1ca3d21919b15c662bc705c3e069bfb496:refactor-real-path-gate 已由真实 CLI/后端覆盖;roadmap-aligned-optimization 已通过相同完整负载、工作量计数、单独 Python 采样和唯一装饰器干预覆盖;default-provider-performance-qualification 已包含真实 SQLite,同时保留 File 正确性与兼容性。原请求生命周期依据是上述现有 helper,未改写规范来匹配实现。

独立验证:112项仓库测试通过;额外2个 File/SQLite CLI 对照覆盖 planning/evidence/off、未注册 Agent、无效页、坏源、关闭时坏源不读取、恢复后新证据可见。基线 5bf58c1ca3d21919b15c662bc705c3e069bfb496 与 head 20837965ddab053f0271775a327ec66310345c9e 使用相同 fixture 和参数,完整 JSON 与原始 stdout 均相等;没有删除字段或归一化错误来获得一致。

量化压力对照使用 #7011 的 f2ac2e8d2273318c81930d2d344bd067b527d9d1 加同一 Python 装饰器,分别预热后交替运行3次,File 中位4.895→0.699秒、SQLite 3.869→0.507秒。Python 采样观察到严格读取→量化归一化→Effect请求链;Node子进程CPU没有被该采样覆盖,未相加 inclusive 行作为延迟。采样后无剖析复测SQLite仍为3.980→0.500秒,完整结果不变。

评审期间 #7011 合入 main d5665210e24ddb7c2836a20579e7c684b5339fc6。已复查相关 Explore/CLI/Effect 源码与 f2ac 一致,并在实际当前 main 上另做两种真实后端的完整组合读取和重叠非法输入测试:完整输出相等、608→1、原日志不变;当前 main 应用这两行后,其完整 Python 文件与本 PR head 相等。

对主干的风险

主要风险是请求边界泄漏、坏源被当作空源,或加速隐藏新证据。已验证错误后作用域清空,修复并追加新 finding 后下一次读取可见;关闭功能时即使存在坏源也不激活读取;未注册 Agent 与非法页参数组合保持原错误和拒绝顺序。File/SQLite的 canonical状态、来源日志没有被读取或重放改变。既有 CLI/回合 hook 是真实消费者,没有新 UI 路径或呈现改动。

语义与 CI 对齐

该变更复用既有生命周期语义,未引入词汇、权限、评分或强制义务变化,完整输出里的提示与错误保持一致。标准本地 premerge 在这个精确 head、origin/main 目标上执行:6项直接检查和5项选择 canary全部通过,零失败、警告和人工 hold;包含编译、双语 RFC diff、语义与 Explore 配置/恢复/门禁。按当前受管策略没有查询或等待远端CI。

本次仅证明这组本地合成负载的完整读取成本及行为;没有给出其他平台、高并发、已安装界面延迟或持续 Agent 成果的资格。原测量缓存容量未扩大,其后续优化不属于这次必要修复。没有影响 PostgreSQL authority、provider实现或持久格式,因此没有把一套未跑的 PostgreSQL suite记成通过。

我的整体评价

这是 justified_increment:现有用户路径获得可测的读取成本改善,且可以只撤回装饰器回滚。long_horizon判定为 preserved,证据连续性、错误恢复及后续新读取保持;user_experience在已测CLI路径判定为 improved,既有任务不增加设置、导航或确认轮次,已安装UI速度仍未验证。

代码体量为必要且合比例;兼容性沿用同一 owner,无需新增版本支线。默认关闭、实际权限、提示文本和 typed decision 均保真,保留已有 scope 是当前最小合理边界。量化生产者、后续模型采纳和原生成果/完整成本收益仍属于既有后续工作,不能由这次快读或测试数量代替。APPROVE;未执行合并、安装或模型/原生评测。

English verdict: APPROVE — 7013@20837965ddab053f0271775a327ec66310345c9e. No blocking finding. The existing request scope removes repeated source checks; independent full CLI parity, File/SQLite failure-recovery coverage,112 repository tests and native premerge6+5 pass. Current-main composition is verified; installed or whole-agent outcome improvement remains unqualified.

@loopx-agent

Copy link
Copy Markdown
Collaborator Author

Merge qualification for 7013@20837965ddab053f0271775a327ec66310345c9e against current target 9889f37fdb2eccd50b4456229b772acc84285ec2.

The existing complete exact-head approval remains valid; this is a merge qualification supplement, with no duplicate full review or source change.

  • Changed surfaces: the existing Python Explore read adapter and its File/SQLite regression. The shared request-scope helper, TypeScript decisions, source validation, provider ownership, configuration and output contracts retain their existing owners. No UI or first-screen change.
  • Fresh checks: both exact-head File/SQLite regression cases passed. Current installed-main composition with the exact decorator also passed on two isolated real backends with 600 quantitative findings: complete JSON equal, all 20 explicitly paged comparison choices retained, original log and canonical state unchanged by reads, malformed source rejected and a subsequent new result visible. Source-revision checks changed from 607 to 1 with File and 606 to 1 with SQLite. This is a work-count/semantic check, with no new latency or whole-agent benefit claim.
  • The complete production file after applying this exact import/decorator to main matches this PR. The existing review's broader 112-test, counterfactual, scope-lifecycle and controlled timing evidence is reused at its unchanged head; the newer expanded-page behavior received the fresh composition check above.
  • Standard local premerge: 6 direct and 5 selected checks passed, no command failures, warnings or manual holds. Ruff, changed-file public-boundary scan, diff-scoped semantic advisory and bilingual RFC diff passed. No remote CI was queried or awaited. The first overall premerge correctly held for a stale quality receipt after main advanced; that failure is retained. Current exact-scope receipt cqr_0700acbf0f0ed6e55285 verifies valid at fingerprint 0700acbf0f0ed6e552859d36eda463d6d0cb5504edc1920cda4d57b99b7c39a6.

The scope does not cache Goal data across requests or make those reads atomic. Actual installed UI latency, later model adoption, research outcomes and complete costs remain separate acceptance. No model or native benchmark job was started. No private runtime evidence is included here. Merge uses the existing maintainer-authorized delivery scope only after fresh native merge readiness for this unchanged head.

@loopx-agent
loopx-agent merged commit 3e16677 into main Oct 21, 2026
22 of 28 checks passed
@loopx-agent
loopx-agent deleted the codex/explore-read-request-scope branch October 21, 2026 20:59
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.

1 participant