Skip to content

fix(coordination): isolate App routing and prose guards from capture - #6020

Merged
loopx-agent merged 5 commits into
mainfrom
codex/app-prose-guard-isolation-r137
Oct 9, 2026
Merged

loopx-agent merged 5 commits into
mainfrom
codex/app-prose-guard-isolation-r137

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

App callers loaded legacy capture modules just to resolve runtime paths or enforce prose-only writes. This moves the existing guard, source projector and pure registry-aware route to their existing owners, updates actual App/CLI callers, and retains identical compatibility exports for supported capture callers. Source and maintenance checks still run before any write; no storage default or persisted format changes.

The real File/SQLite HTTP journey covers both capture-module presence and physical absence, with physical/external registry routing: inventory, preview, explicit confirmation, server restart, original-operation recovery and later canonical writes. The merge repair composes main's alias-bound tests with capture-absence coverage, preserving source/backup and alias-retarget refusal. Narrative writes remain allowed; Todo/handoff injection, JSON type changes and maintenance failures reject without partial writes.

Validation on the final head:

  • Source guard/HTTP suite: 82 passed. Fresh-wheel receiver packages on CPython 3.14.8: the same 82 passed. Receiver provenance is asserted; parent pytest fixtures may import source.
  • The same physical-absence case on an immutable latest-main package fails at App startup; the repaired head passes it.
  • Existing capture/outbox/fence/cold-import integration: 88 passed. Canonical/legacy/CLI callers: 75 passed. Dispatcher/registry census: 16 passed.
  • Native premerge: 5 direct and 19 selected checks passed, zero failures, warnings or manual holds. Ruff, focused routing mypy, semantic advisory/full check and public/private scan passed; census remains 290 sites, zero unclassified. Remote CI was not fetched or awaited under the configured review policy.
  • Initial wheel construction correctly rejected stale frontend assets; the standard App build regenerated them, then the wheel was rebuilt, installed and validated.

Future-facing pass: remove duplicate function bodies and reuse one existing guard, projector and route owner. No new capability, switch, vocabulary or parallel Python decision owner. App controls and Lark are unchanged. Main's qualified historical-outbox disposition and independent full-data restore remain preserved; remaining writer callers, authorized reactivation and release-default qualification remain open. This PR does not delete supported capture modules or complete full legacy retirement.

…tion

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
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=xhigh (host observation; active_turn_verified=false).

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

动机

App 用户在配置、冷源导入与正文反馈路径上遇到这个依赖。
旧实现为了检查正文没有改动任务,必须导入整个旧写入捕获适配器;移除该适配器就无法启动相关入口。现在正文保护仍生效,配置与真实 HTTP 导入可在该适配器缺席时运行。
已验证 File/SQLite 导入、实际服务重启、后续任务写入与原操作读回;正文可写,注入 Todo 会在文件或索引改动前被拒绝。
本 PR 不删除受支持旧 writer,不改变存储默认,也不结算完整 Goal 恢复或发布资格。
完整 HTTP 仍通过纯 runtime-root 查询加载 outbox;下一步迁移这批实际调用方,再用相同 oracle 验证两个捕获模块同时缺席。

改动思路

保留现有保护并搬到 source/fence,减少捕获与普通正文的耦合;没有新增 authority、配置或状态。当前 PR 交付 guard 与 source projector 归属、writer 缺席的真实 HTTP;纯 root 路由迁移和完整 outbox 缺席验收沿现有 R5/T4 接续。 决策来源仍是既有 typed source/Todo 投影,Python 适配源读取和受保护 I/O;capture prepare/commit/history 保留原 owner。删除 guard 会丢保护,lazy import 延后失败。guard 与 projector 同迁是最小有效切片,兼容导出仍服务实际调用方、只共享同一对象。

具体改动

规范 docs/reference/local-authority-provider-selection.md,spec_revision ce0ed6e(改动前,不用本 PR 修订定义独立验收)。T4/C1 implemented:guard 归还 source/fence,配置/direct guard 两模块缺席通过。R5/D1 deferred:完整 HTTP outbox 缺席继续沿同一 roadmap 的 root 路由调用方验收。retained-prose-invariant implemented:只去 resume 读时钟,保留 bool/int、Todo/handoff、maintenance 先拒绝。original-operation-recovery implemented 于原路径:服务实际重启后原操作读回保留后来 canonical 写入。

关键代码讲解

  1. legacy_writer_fence.py:202 require_prose_state_write_allowed:先检查 source/maintenance,随后以既有 projector/canonical_bytes 比较原文和计划文。投影错误也在正文/索引 IO 前拒绝,错误文本和优先级保持。
  2. runtime_shadow.py:265 todo_partition_projector:typed Todo/archive 投影从 outbox 编排搬到 source owner;旧 adapter 重导出同一函数,capture 行为仍覆盖。
  3. feedback.py:403 append_human_reward:共享锁内使用迁移后的 guard,之后才原子写正文并追加索引。实际 receiver 验证合法 narrative 与 Todo 注入负例,文件字节、registry 和独立 canonical 读回保持。

HTTP fixture 验证真实进程/package provenance、原子启动信号、确认、重启和后来写入。源码/最终 fresh wheel 各48通过,capture/fence/import/canonical writer 71通过。census 随 codec read 迁移,全树语义检查通过。

对主干的风险

最强反例:配置导入通过但服务仍加载 outbox。物理移除两模块后实际暴露 canonical terminal lifecycle 的 root-helper 依赖,未记为通过,保留对应后续验收。支持的旧 writer、capture/history 和 Host IO 没有删除。既有 source/maintenance 优先级、锁等待、错误投影、handoff/JSON 类型与失败无效果均被覆盖,没有新增权限或默认。前端流程不变,真实 HTTP 已验;未声称重新渲染 UI 或跑真实模型。

语义与 CI 对齐

复用既有词汇和 typed owner。Ruff、diff hygiene、semantic/registry census 通过。预合并16通过/1失败:empty-Git canary fixture 在固定 f03a9ac 与此 head 同样尝试不存在的 maintainability script,期望 skip 的断言失败;相关因果路径从 f03→ce0→本 PR 未改动。依 policy20 归因 pre-existing,不计通过;保留独立 merge-validation hold,不要求当前 PR 修无关 canary。focused mypy head21/base22既有诊断、无新增,也不声称全绿。使用原生本地验证,未查/等待远端 CI。

我的整体评价

无当前切片阻塞发现;APPROVE 只覆盖 justified_increment。long_horizon preserved:恢复保留后来写入,捕获恢复义务不变;user_experience improved:同一配置/导入路径无需为正文检查加载 writer,也无新增确认或 authority。未来向重构已在 source/projector owner 应用,纯 root routing、完整两模块 HTTP、完整备份恢复和发布默认仍开放。head 601152c;独立 canary 合并障碍及维护者权限保留,runtime PR 不自合并。

English verdict: APPROVE - HEAD 601152c. No blocking finding in this bounded source/fence ownership increment. Actual File/SQLite HTTP and installed-wheel checks preserve later writes/prose guards with writer absent. Full outbox-free HTTP remains open. Baseline-reproduced canary fixture failure remains a separate merge-validation hold; existing mypy diagnostics remain.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent loopx-agent changed the title fix(coordination): keep prose guards independent of legacy capture fix(coordination): isolate App routing and prose guards from capture Oct 9, 2026

@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=xhigh (host observation; active_turn_verified=false).

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

动机

App 用户在冷源导入、正文反馈和后续任务写入时遇到这个依赖。
旧实现仅为解析运行目录或检查正文就加载旧捕获模块,移除模块后真实服务无法启动。现在两个捕获模块同时缺席时,原有导入和后续写入入口仍可运行。
已验证 File/SQLite 冷导入、实际服务重启、原操作恢复和后来写入保留;合法正文可写,任务注入在状态或索引改动前被拒绝。
本 PR 不删除受支持旧 writer,不改变存储默认,也不结算全部旧模块退役、完整 Goal 恢复或发布资格。
历史 pending outbox 处置、独立完整备份恢复,以及其他仍依赖旧 writer 的调用族继续沿既有 R5/T4 验收。

改动思路

复用既有 source/fence、source projector 和 paths owner,删掉旧函数体;Python 只负责源读取和目录路由,TS 决策与效果权限不变。 当前 PR 收齐 guard、projector 与纯目录路由归属,以及两个 capture 模块同时缺席的真实 HTTP;历史 outbox、独立完整恢复和其他旧 writer 调用族沿既有验收继续。
从真实 HTTP 启动追到 canonical terminal lifecycle 的纯目录调用,而不是只看配置导入。路由 helper 复用 registry codec 和 resolve_runtime_root;codec 在调用处导入是避免既有路径常量循环,没有 lazy capture import。旧 writer 的 prepare/commit、drain 和历史处置仍由原边界负责,兼容导出与新入口是同一对象。删除保护会丢失拒绝条件,只延后导入也不能通过真实服务验收。这三个相关 owner 调整和实际调用方迁移构成可回滚的完整切片,没有新增模块、状态、开关或 Python 决策源。

具体改动

规范 docs/reference/local-authority-provider-selection.md,spec_revision ce0ed6e,按改动前约束审查,未用本 PR 更新的 checkpoint 反向定义验收。T4/C1 implemented:保留 prose guard 并迁入现有 source/fence;配置与实际 App 两 capture 模块缺席通过。R5/D1 deferred:当前收齐两个 capture 模块缺席的 HTTP 子验收;全部四模块 App 删除、历史 outbox 与完整 Goal 恢复仍开放。retained-prose-invariant implemented:仅忽略已有 resume 读时钟,保留 bool/int、Todo/handoff 区分和源/维护态拒绝优先级。original-operation-recovery implemented:实际重启后读原回执,保留后来 canonical 写入。规范固定链接:source/import contract。

关键代码讲解

  1. legacy_writer_fence.py:202 require_prose_state_write_allowed:先检查注册源和维护态,再用同一 typed Todo/archive/handoff 投影及 canonical_bytes 比较;无法证明等价时在正文和索引 I/O 前拒绝。
  2. runtime_shadow.py:265 todo_partition_projector:源投影与 archive 依赖从 outbox 编排迁出;旧 adapter 重导出同一函数,捕获调用方仍使用它,没有第二份规则。
  3. feedback.py:403 append_human_reward:保持锁内重新读源、共享 guard 再写入的顺序;合法 narrative、并发 Todo 保留和注入拒绝均执行真实 readback。
  4. paths.py:329 effective_runtime_root:原 helper 的 fresh registry→resolve_runtime_root 流程原样归还路径 owner;None/空串、str/Path override、项目/standalone 相对路径和不同 cwd 保持。todos、terminal lifecycle、acceptance、team plan、chat actions 与 CLI 已迁实际 imports;管理侧实际 capture/drain imports 保留。todo_event 从 guard owner 导入同一错误类。

21 文件包括迁移/窄 imports、两套 durable tests、I/O census 和三份当前文档;没有新增 capability、协议或用户步骤。前移 route characterization8通过,迁移前同一缺席 HTTP arm5个启动错误。当前源码/新 wheel receiver 各56通过;capture/outbox/fence/import/canonical writer84通过,dispatcher/census16通过。wheel 子进程包路径被验证,父 pytest fixtures 仍可能从源码导入,未声称整个父进程仅使用 wheel。

对主干的风险

无当前切片阻塞发现。最强反例是配置通过但服务在 terminal lifecycle 导入 outbox;当前用同一真实 HTTP oracle 在两个模块存在/物理缺席时分别跑 inventory、preview、确认、进程重启、同操作恢复和后来写入,已消除这个反例。合法正文、任务/handoff 注入、类型差异、投影失败、源/backup 漂移、锁竞争和失败无效果均保留。旧 writer、capture/history 和 Host I/O 没有删除;此资格不能替代最后调用方核验、全历史恢复或发布默认。UI 控件和 Lark 未变,实际 App HTTP 已验,未声称重渲染 UI 或实跑模型。

语义与 CI 对齐

复用既有词汇和 TS owner;development advisory、全树语义、Ruff、diff/private boundary、census290/0及路由两文件 mypy通过。原生 premerge5项direct和19项selected全部通过,无失败、警告或manual hold;不查看/等待远端 CI。上次601152的 empty-Git catalog fixture 在固定f03基线也失败,本次完整catalog通过;未改canary因果路径、没有放宽预算,不能声称证明旧失败根因或修复。既有 projector/feedback 的非必需 mypy诊断保留,不声称全树类型全绿。错误文本、条件顺序、authority与停留/恢复义务没有缩写或改为建议。

我的整体评价

APPROVE,justified_increment:完成当前 guard/路由真实加载切片;long_horizon preserved,重启重试不抹后来数据;user_experience improved,同一导入路径无需旧捕获模块,也未新增确认或权限。未来向重构已应用到共享 guard、source projector 和 paths owner,旧函数体删除,真实 caller 需要的兼容导出保留。scope、机制成本与可逆性相称;父级历史 outbox、全备份恢复、其他旧 writer 和发布默认验收继续开放。精确 head 3e540c1,旧 review不继承;当前原生验证通过,但 runtime PR 仍交维护者合并。

English verdict: APPROVE - HEAD 3e540c1. No blocking finding in this bounded App routing/prose-guard ownership change. Paired physical capture-module absence passes actual File/SQLite HTTP, restart, original-receipt recovery and later writes: source/wheel56 each, legacy integration84, dispatcher16, native24 checks. Historical outbox/full restore/other callers and maintainer merge authority remain separate.

@mergify

mergify Bot commented Oct 9, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @loopx-agent.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Oct 9, 2026
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@mergify mergify Bot removed the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Oct 9, 2026

@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=xhigh (host observation; active_turn_verified=false).

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

Exact head: d75d744; base: 5e5f057.

动机

App 用户在导入旧 Goal、反馈正文和继续写入任务时会遇到这个依赖。

原实现为了检查正文或解析运行目录就加载旧捕获模块,模块缺席时服务无法启动;当前入口在两个模块同时缺席时仍可完成导入、重启恢复和后续写入。

真实 File/SQLite 和新安装包接收端已验证:路径别名及外置 registry 可导入,重试保留后来数据,合法正文可写,任务注入在写入前拒绝。

本 PR 保留受支持旧 writer、历史恢复义务和存储默认,不宣称全部 Python 退役或发布资格完成。

其余 App writer 调用族、恢复后的授权重新激活和发布默认资格继续由既有 R5/T4 计划推进;主干已合入的历史处置与独立数据恢复资格保留。

改动思路

复用现有 source/fence、source projector 和 paths owner,删除旧函数体并保留服务真实调用方的同对象兼容导出;Python 只适配现有 IO,TS 决策与效果权限不变。

当前 PR 交付两个 capture 模块缺席时的真实 App 导入与写入守卫,并收齐主干的别名保护;其余调用族和授权恢复沿既有验收推进。

保留正文保护是必要的:它防止反馈正文夹带任务或 ownership 修改。删除保护会丢失价值,延后 capture import 仍会在真实调用时失败。只迁 guard 也不够,canonical terminal lifecycle 的目录解析仍会加载 outbox。现在三项既有职责回到最近的现有 owner,无新模块、状态、开关或授权模型。

具体改动

规范基准是改动前的 source/import contract。“Prose-only source maintenance”要求精确 JSON 类型和 source/maintenance 拒绝优先级;“Recover the same operation”要求重试保留后来写入,二者均按原约束验证。T4/C1 的 retained prose/loading 子验收满足;R5/D1 的全部旧 writer 与授权恢复验收保持开放。

关键代码讲解

  1. legacy_writer_fence.py:202 的 require_prose_state_write_allowed 先核验 source/maintenance,随后比较完整 Todo/archive/handoff 投影的 canonical_bytes;无法证明不变就在正文和索引 IO 前拒绝。
  2. runtime_shadow.py:265 的 todo_partition_projector 接收现有 typed Todo 投影及 archive 依赖;旧 adapter 重导出同一对象,移除原函数体。
  3. paths.py:329 的 effective_runtime_root 保持 fresh registry、显式 override 优先和项目相对目录语义;codec 局部导入避免路径常量循环,不是延后 capture 依赖。
  4. cold_api:23 把模块存在/缺席与物理/外置 registry 两轴组合。真实 HTTP 子进程验证包来源;后来 Todo 及正文也在接收端执行,重启后以同一 carrier 恢复。

15 个产品路径包括窄 imports 与以上函数迁移;两套 durable tests、三份文档和现有 I/O census 共21文件。3e540→当前 head 的修复是主干合入和组合 fixture,保留主干 alias/source/backup 保护及历史资格,不继承旧 review。App 控件和 Lark 未改,没有新用户步骤或新能力。

对主干的风险

最强反例是单元测试从源码成功,而真实接收端仍加载缺席模块,或别名路径在重试时抹掉后来写入。本次用最新不可变 main 的同一缺席用例复现启动失败;当前源码和新 wheel 各82通过,含36项真实 HTTP组合。原 capture/outbox/冷导入集成88、canonical/legacy/CLI调用75、dispatcher/census16通过。合法 prose、任务/handoff注入、bool/int、读时钟、source/backup drift、alias retarget、维护态和失败不写均保留。

新 wheel 使用 CPython3.14.8,接收端包路径明确核验;父 pytest fixture 可以从源码导入,未声称父进程仅来自 wheel。初次 wheel 因旧前端产物过期正确拒绝;标准 build:chat 后重新构建、安装并跑相同 oracle。未放宽守卫或删负例。

语义与 CI 对齐

复用现有 typed owner 和词汇,无新增分类或协议。Ruff、路由两文件 mypy、完整 semantic、290站点/0未分类 census 和 diff/public-private 扫描通过;原生预合并5 direct+19 selected通过,0失败/警告/manual hold。按配置未获取或等待远端 CI。历史非必需 typing debt 和旧 canary fixture 不声称被修复,当前风险边界以新验证覆盖。没有 PG authority store 改动,也不声称此次资格化 PG、完整 UI 渲染或 live 模型。

我的整体评价

APPROVE,justified_increment。long_horizon preserved:真实重启/原回执恢复保留后来数据;user_experience improved:同一 Goal storage 旅程在移除两个 capture producer 后可继续,不增加确认或执行权限。未来向重构已应用在三个共享 owner,并删除重复函数体;受支持的兼容别名等实际调用族迁完再退役。整个改动可直接回滚,无持久化格式变更。

这是完整可用的当前加载/guard切片,尚不能推导全部退役或发布默认完成。本次用户明确授权 #6020 自修复自合并;通过精确 head 公开 review、原生质量凭证及合并 readiness 后执行授权合并。

English verdict: APPROVE - HEAD d75d744. No blocking finding in the complete App routing/prose-guard slice. Latest-main physical-absence startup fails; current source/wheel82 each, legacy88, caller75, dispatcher16 and native24 checks pass. Alias protection and later-write recovery remain intact; full retirement/release qualification remain separate.

@loopx-agent
loopx-agent merged commit 7222d54 into main Oct 9, 2026
10 of 27 checks passed
@loopx-agent
loopx-agent deleted the codex/app-prose-guard-isolation-r137 branch October 9, 2026 17:18
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