Skip to content

refactor(context): read selected Todo sources inside TypeScript - #8057

Merged
huangruiteng merged 5 commits into
mainfrom
codex/python-bridge-retirement
Nov 4, 2026
Merged

huangruiteng merged 5 commits into
mainfrom
codex/python-bridge-retirement

Conversation

@hhyykk

@hhyykk hhyykk commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

The selected Todo source crossed into Python as a complete canonical collection, was reduced to one active record, and was sent back to the TypeScript context projector. This change performs that read inside the existing context projection request and removes the Python source branch. It adds no RPC method, cache, write authority or persistent schema.

中文:把当前 Todo 的完整来源读回并入现有 TS 上下文请求,保留原生快照校验、分页、正文版本与拒绝规则。Python 只保留本切片未迁移的文档、User 作用域及 oracle IO。

  • Basis: author-requested Python bridge retirement; existing TypeScript migration RFC transaction/source-consumption contract.
  • Before → after: the initial synthetic File/SQLite CLI trace has 72→71 logical Effect requests; complete inline work context remains equal. This is transport consolidation, not a newly migrated domain-policy interpreter.
  • Intended base: main; integrated through ce4cfc1ce before publication.

Author Declaration

Written by: model_agent, OpenAI Codex (GPT-6 family), provider OpenAI; exact serving model/effort is not independently attested.

Implemented against

Specification: docs/architecture/rfcs/typescript-control-plane-migration-v0.md, accepted revision d29ec8bf2a105aac24629bcbf3dfb7c97aea51fe; its relevant source-read requirements are unchanged in the newer integrated base.

Criterion Disposition Boundary / evidence
§3.2 complete transaction / replacement implemented Selected-Todo source IO and result construction now compose in readAndProjectInteractionWorkContext; the Python selected-source branch is deleted. Remaining providers have named IO responsibilities.
§2.4 no production semantic twins implemented Existing canonical snapshot and context validation owners are reused; no fallback or second selection policy.
§5 economics implemented Python adapter +7/-35, net -28; all product code +63/-37, net +26. The additional TS composition is disclosed rather than counted as net code deletion.
§6 caller-visible parity and negative cases implemented Real File/SQLite body-change rejection; independent guard mutation fails both cases; complete inline context and IDs match in 30 paired default-entry observations.
§6 complete cost not_met Default CLI is within threshold, but the compatibility module-entry tail regresses. Full cost/Host qualification and attribution remain an explicit merge hold.
§7 TS payload carried by wheel/sdist implemented for tested revision Four isolated installed File/SQLite readbacks and exact hashes for the four changed production files at the tested integrated source. Later upstream integration still requires normal CI/review.

Self-check: source/adjacent owner readback, clean-code-guard, test-guard and docs-guard applied. No speculative framework, cache, schema migration or permission change.

Scope And Continuation

The source implementation is independently reviewable and reversible. Goal document, User-scope and oracle providers remain Python; this does not retire every Python bridge. The same existing-only canonical snapshot route and its page/revision checks remain. A request without the selected-source obligation does not read a provider. The canonical read's 15-second source budget is retained.

Merge is held for compatibility-entrypoint performance attribution/qualification and a fresh exact-head review. This PR does not authorize merge, deployment or owner-gate bypass. The repository's author-entry policy permits a completed proposal with an explicit validation hold as a normal PR.

Validation

  • Source qualification revision: c137daecc56a5f1784097742b212d26b27f83892, based on d29ec8bf2; subsequent doc and main-integration commits leave the four changed production files byte-identical. Latest integration/focused results are recorded separately below.
  • Run state: finished for the stated source checks; full merge qualification is held.
  • Input classes: synthetic, public_fixture. No production Goal/store was used.
Check kind Result Evidence / limitation
unit / integration passed 138 focused/related Python checks; 93 native checks, including canonical paging/integrity coverage.
real_backend passed Real File and qualified SQLite; missing/archived/changed/corrupt sources, no store recreation, metadata/body retention and unchanged authority.
regression_parity passed for tested base/head 30 default-entry pairs with 500 historical records: complete inline context and every non-clock field match; event IDs match with only the event-clock input fixed. Raw collection clocks and derived ages are retained, not used to normalize policy, identity or failures.
regression_sensitivity passed Bypassing selected-source guards breaks both public CLI File/SQLite body-change invariants; the exact original source was restored.
static passed Typecheck, Ruff, diff hygiene and paired RFC checks. Standard premerge at the first integrated source: 6 direct +19 selected checks, zero failures/advisory failures/manual holds.
real_entrypoint / installed passed for stated source Fresh wheel and sdist, each with File/SQLite; four source-file hashes match, no source-tree import fallback.
performance / default entry passed within stated threshold Actual loopx entry, SQLite, 30 alternating AB/BA pairs, 500 historical records: p50 647→657 ms, p95 779→799 ms (about +20 ms/+2.6%). No speedup claim.
performance / compatibility module failed / held python -m loopx.cli paired p95 1309→1486 ms. Captures show imports/parser dominate observed wall time, but do not establish the tail's cause. Earlier and contaminated samples remain retained; this row is not waived by the default-entry result.
baseline failures retained Four older selected-work capture-layout assertions fail on immutable initial main as well; their correction belongs to existing #7430 and was not bundled here.
complete cost / deployed Host / model outcomes not_run in full No full cold/warm/idle/Host or long-horizon effectiveness qualification is claimed.

Frontend / Visual Evidence

  • UI impact: none. Existing CLI/context records and failure behavior are the consumers; no page, layout or control changed.
  • First viewport: N/A. The unchanged frontend was built only as a wheel/sdist prerequisite.
  • Source data: synthetic/public fixtures only.

Type of Change

  • Refactoring (source/transport ownership)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)

Technical Direction

TypeScript migration §3.2 and source-consumption retirement. Preserve scope, complete requirements and current-source refusal; do not infer task outcome improvement from request counts.

Shared-authority RFC fixture impact

  • Canonical source consumer only; no provider selector, storage schema, writer, promotion or runtime-routing rule changes.
  • File/SQLite source integrity exercised. No new legacy authority path; real PostgreSQL/profile promotion is not qualified by this local source proposal.

Overlap / Boundary Checklist

  • Latest inventory includes all open PRs and Drafts with exact heads and paginated files. C1: unify work sources and validate recovery #7430 shares the file but adds a separate captured-body resolver and fixes old capture expectations; this PR moves source hydration and leaves that resolver/behavior untouched.
  • No private state, credentials, raw profiles, internal links or local machine paths in the diff/body.
  • No benchmark/scoring work or jobs launched.
  • English/Chinese RFC entries move together.
  • No UI change; no persistent-state deletion or authority migration.
  • Every commit has DCO sign-off.

Latest-main integration disclosure

  • Head ff4e94459df6d165cbf2cbadbbf2fd34358a2e54 integrates ce4cfc1ce74a2ffe0d685758b8d6e9233b467f41. The four changed production files are byte-identical to the earlier qualified source.

  • Latest main switches ordinary stdout to context_capture_navigation_v1. The product reader verifies the physical reference and its SHA-256 before reading the current complete projection. File/SQLite actual entrypoint readbacks pass, and their complete current work contexts match the latest immutable baseline exactly.

  • Six old direct-stdout assertions fail in both latest main and candidate at the same should_run/capture-layout boundary (2 pass, 6 fail in that selected old suite). This new upstream-format baseline failure is retained in addition to the four earlier baseline failures; no product assertion was weakened to hide it.

  • Performance and installed-package rows above retain their stated earlier integration revision. They do not certify latest-main cost/Host adoption. Merge qualification remains held.

  • Latest-source native checks: 93 pass; full control-plane typecheck passes.

  • Latest standard premerge: all 6 direct checks pass; 19 selected checks execute with one failure in peer-agent-continuation-state-machine-smoke.py because it expects a top-level decision from the new navigation response. All other selected/risk/public-boundary checks pass. Its immutable latest-main comparison is retained separately; this failed gate is not converted to green.

  • Current logical Effect request count on the new capture protocol is 74→73 for both real File and SQLite observations.

  • Latest-main-only reproduction of the failed peer-continuation canary also exits 1 at the same line 107 decision key lookup. Attribution is baseline-reproduced; the original failed premerge remains failed and merge is not approved.

Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
…etirement

Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
…etirement

Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
Signed-off-by: aihop <4408344+hhyykk@users.noreply.github.com>
@hhyykk hhyykk added control-plane Quota, todo, scheduler, registry, state, goal, or runtime control-plane change. direction/architecture-evolution Architecture evolution and research-incubator work. labels Nov 4, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 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-04T17:16:43.468618Z 6811fd2 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 | effort=max

动机 / Motivation

读取当前选中任务的 CLI 和 Agent宿主。选中一条长正文Todo,原来在Python读取完整列表,候选在现有TS请求中读取并验证同一来源。完整正文与独立note及拒绝行为对齐,当前默认CLI尾延迟资格未通过。Goal文档、User作用域与oracle IO迁移属于后续范围。本次来源归并的边界合理,采用原canonical reader及原projector,当前批准受阻于同一默认调用路径的性能资格。

验收按 docs/architecture/rfcs/typescript-control-plane-migration-v0.md 在 ce4cfc1ce74a2ffe0d685758b8d6e9233b467f41 的 Caller-observable semantic parity 和 Performance 两节逐项判断。selected-source-parity 通过,default-cli-tail 当前未满足。余下的来源迁移继续归各来源现有owner,默认CLI尾延迟由本PR作者复核,保持此切片独立可回滚。

默认SQLite完整CLI的当前尾延迟超过原验收预算。

改动思路 / Approach

审阅 head 6811fd2d8c3c5bbde9fa11d67c551f4a41daaa03。Python仍承接Goal文档、User与oracle来源,选中Todo的完整canonical读取进入现有TS transaction。它没有增加RPC、缓存或持久schema。原纯projector路径保留,缺少selected source时不会额外打开provider。

架构判断保留现有形状,理由为“在现有typed请求内复用canonical reader和原projector。”。当前PR边界为“保留文档、User与oracle的原读取owner。”。这一取舍符合来源事务归并的方向,但边界合理仍需完整调用成本资格。

具体改动 / Changes

context_readback.py 移除selected_todo的Python读取分支,传递当前source_context。readAndProjectInteractionWorkContext 在同一请求内调用既有snapshot reader,完整消费同一来源后将结果交给原正文与claim validator。normalizedTodoTextRevision 复用既有文本规范化hash,文档同时更新英语、中文RFC和ledger。

独立核对的File/SQLite公开CLI均读到完整长正文、独立note、状态、认领和原来源,原Goal文本保持。通过产品自身读取器适配当前navigation输出后,selection之后正文变化的原拒绝断言在基线/head各两例都通过。TS读取测试7例通过。原旧stdout断言仍有失败,它们发生于直接索引顶层字段的旧布局,分别保留,未作为新增source逻辑回归。

对主干的风险 / Risks

P2,当前默认SQLite完整CLI尾延迟资格待完成。 我在同一SQLite fixture上放入499条已完成历史Todo和一条活动长正文,固定模型无关的公开 loopx.entrypoint quota should-run,先跑2对预热再交替30对完整进程调用。p50为873.08→878.53ms,p95为914.48→970.10ms。尾部增加55.63ms/约6.1%,越过原RFC的25ms和5%预算。

这些是共享macOS上的测量,当前未定位代码级原因。请保留这份失败,并在相同默认profile和当前head复核或定位尾部影响,取得原预算内的资格后推进。这里只要求完成此实际受影响入口的资格。先前兼容入口测量和旧stdout断言继续按原范围保留。

没有渲染页面变化,视觉评审不适用,实际检查路径为公开CLI、原生snapshot读取及失败恢复。未执行PostgreSQL/profile promotion或新宿主安装。

我的整体评价 / Verdict

来源归并达到了已验证的正确性边界,重用和权限归属合理。当前完整默认CLI尾延迟仍是具体未满足项,因此需要完成该资格后重新判定。旧stdout错误不应转嫁为本PR的逻辑缺陷;当前尾部测量也不能只用typed请求微基准替代。

English verdict: REQUEST_CHANGES — 6811fd2 preserves reviewed File/SQLite source semantics, but the current 30-pair default SQLite CLI measurement misses the accepted p95 budget. Requalify this path and retain the failed evidence.

本次尚存的验收差距为“默认SQLite完整CLI的当前尾延迟超过原验收预算。”

@huangruiteng
huangruiteng merged commit 3ecc318 into main Nov 4, 2026
31 of 60 checks passed
@huangruiteng
huangruiteng deleted the codex/python-bridge-retirement branch November 4, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

control-plane Quota, todo, scheduler, registry, state, goal, or runtime control-plane change. direction/architecture-evolution Architecture evolution and research-incubator work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants