Skip to content

Commit 3701644

Browse files
author
xiaoan17
committed
docs(rfc): record the Codex provider-routing activation seam
The package import ratchet fails on main. PR #7625 added from loopx.runtime_activation import managed_chat_activation_guard, RuntimeActivationDeferred to packages/loopx-codex-provider-routing/src/loopx_codex_provider_routing/native_host.py, and the pin that records every `loopx.*` module a co-located package imports does not carry that edge: AssertionError: co-located packages gained imports of loopx internals: {'loopx-codex-provider-routing': ['loopx.runtime_activation']} The pin's own note says a new edge needs a recorded design decision, and the monorepo-distribution-split RFC Section 5 holds that decision. This records it. `loopx.runtime_activation` owns the transition of services that are already installed. `managed_chat_activation_guard` holds the accepted-Chat-work fence and the ingress lock while a managed client restarts, and the Codex provider routing package uses it, and no other entry point of that module, to fence accepted Chat work before it restarts the Chat services it manages. The guard grants no work authority: it takes the ingress lock and refuses to continue while accepted work or ingress is pending. Section 5 now names that module as the third public module in the supported host integration seam, beside MemT's facade and `loopx.file_lock`, and says that the seam does not widen: a package still may not import the executor or another kernel-private module, and the pinned Ark/JEV edges stay migration debt. Both mirrors carry the same text. The RFC's Appendix A records the baseline, the boundary and the remaining gaps, and its decision log records the alternatives: restarting the Chat services without the fence, copying the lock and state check into the package, or leaving the edge unrecorded. The pin gains the edge and its note names the new seam member. No production code, schema, wire or default change. Validation: the import ratchet passes; the RFC bilingual diff check, the RFC status index check and the docs governance smoke pass; mkdocs --strict builds the docs site and both developer books. Signed-off-by: xiaoan17 <anbc1224@gmail.com>
1 parent 86dfa6f commit 3701644

4 files changed

Lines changed: 71 additions & 7 deletions

File tree

‎docs/architecture/rfcs/monorepo-distribution-split-v0.md‎

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,17 @@ records both edges. Existing Ark/JEV private edges remain migration debt and
302302
receive no new exemption. The facade forwards existing behavior; it must not
303303
copy candidate, acceptance, process-lifetime or locking decisions.
304304

305+
One more public module joins that seam. `loopx.runtime_activation` owns the
306+
transition of services that are already installed, and its
307+
`managed_chat_activation_guard` holds the accepted-Chat-work fence and the
308+
ingress lock while a managed client restarts. `loopx-codex-provider-routing`
309+
uses that guard, and no other entry point of that module, to fence accepted Chat
310+
work before it restarts the Chat services it manages. The guard grants no work
311+
authority: it takes the ingress lock and refuses to continue while accepted
312+
work or ingress is pending. The import ratchet records that edge as well. This
313+
is a third public module in the seam and does not widen it: a package still may
314+
not import the executor or another kernel-private module.
315+
305316
The stdio relay cancels its owned process group on parent EOF, SIGTERM or
306317
SIGINT and waits for the existing supervisor's cleanup before exiting. POSIX
307318
process-group behavior and Windows best-effort tree cleanup retain their
@@ -696,11 +707,34 @@ Approval needs a reviewed decision, not implementation progress or silence.
696707
- **Remaining:** the wider M1–M5 distribution and zero-private-import acceptance
697708
is not closed; D1–D4 stay open. No packaging or authority decision changes.
698709

710+
### 2026-10-29 — Codex provider-routing activation seam
711+
712+
- **Baseline:** `5d7f0a61b`.
713+
- **Delivered:** the supported host integration seam in Section 5 names one more
714+
public module. `loopx.runtime_activation` owns the transition of services that
715+
are already installed, and `loopx-codex-provider-routing` uses its
716+
`managed_chat_activation_guard` to hold the accepted-Chat-work fence and the
717+
ingress lock while it restarts the Chat services it manages. The import
718+
ratchet records that edge.
719+
- **Boundary repair:** the guard grants no work authority — it takes the ingress
720+
lock and refuses to continue while accepted work or ingress is pending — and
721+
the package uses no other entry point of that module. The seam stays closed: a
722+
package still may not import the executor or another kernel-private module,
723+
and the pinned Ark/JEV edges remain migration debt.
724+
- **Evidence:** the import ratchet pins the edge instead of leaving it
725+
unrecorded, and the Codex provider-routing native host smoke exercises the
726+
guarded restart path.
727+
- **Remaining:** the wider M1–M5 distribution and zero-private-import acceptance
728+
is not closed; D1–D4 stay open. The seam records one module for one caller,
729+
not a general package-to-kernel permission.
730+
699731
## Appendix B: Decision log
700732

701733
| Date | Decision | Owner / approval | Alternatives | Normative sections changed |
702734
| --- | --- | --- | --- | --- |
703-
| — | — | — | — | — |
735+
| 2026-10-29 | `loopx.runtime_activation` joins the supported host integration seam, so the Codex provider-routing package can hold the accepted-Chat-work fence while it restarts the Chat services it manages | Maintainers, through RFC review and merge | Restart the Chat services without the fence; copy the lock and state check into the package; keep the edge unrecorded | Section 5 |
736+
737+
No other decision is approved. D1–D4 remain open proposals.
704738

705739
## Appendix C: Evidence registry
706740

‎docs/architecture/rfcs/monorepo-distribution-split-v0.zh-CN.md‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ MemT 只使用这两个公开模块,不能直接 import executor 或其他内
208208
边。Ark/JEV 的既有私有边仍是迁移积压,不新增豁免。facade 只转发现有行为,
209209
不能复制候选、验收、进程生命周期或文件锁决策。
210210

211+
该接缝再增加一个公开模块。`loopx.runtime_activation` 负责已安装服务的切换,
212+
其 `managed_chat_activation_guard` 在受管客户端重启期间持有"已受理 Chat 工作"
213+
栅栏与入口锁。`loopx-codex-provider-routing` 只使用该栅栏、不使用该模块的其他
214+
入口,在重启自己管理的 Chat 服务之前为已受理的 Chat 工作加栅栏。该栅栏不授予
215+
工作权限:它获取入口锁,并在仍有已受理工作或入口流量时拒绝继续。import ratchet
216+
同样钉住这条边。这是接缝中的第三个公开模块,并没有放宽接缝:包依旧不能 import
217+
executor 或其他内核私有模块。
218+
211219
stdio relay 在父进程 EOF、SIGTERM 或 SIGINT 时取消所持进程组,并等待已有
212220
监督器完成回收再退出。POSIX 进程组行为与 Windows 尽力而为的进程树回收仍沿用
213221
原资格边界。这是进程监督,不是沙箱;操作者选择的工具只保有原先获准的效果。
@@ -498,11 +506,29 @@ R0 可以先于目录移动交付,但不代表内核合格。R3/R4 可选,
498506
- **剩余:** 不关闭更广的 M1–M5 发行物与零私有 import 验收;D1–D4 仍未决。
499507
不改变打包方案或权威决策。
500508

509+
### 2026-10-29 — Codex provider-routing 激活接缝
510+
511+
- **基线:** `5d7f0a61b`。
512+
- **交付:** 第 5 节的受支持宿主接入接缝再增加一个公开模块。
513+
`loopx.runtime_activation` 负责已安装服务的切换,
514+
`loopx-codex-provider-routing` 使用其 `managed_chat_activation_guard`,在重启
515+
自己管理的 Chat 服务期间持有"已受理 Chat 工作"栅栏与入口锁。import ratchet
516+
钉住这条边。
517+
- **边界修复:** 该栅栏不授予工作权限——它获取入口锁,并在仍有已受理工作或入口
518+
流量时拒绝继续——且该包不使用该模块的其他入口。接缝仍然闭合:包依旧不能
519+
import executor 或其他内核私有模块,已钉住的 Ark/JEV 私有边仍是迁移积压。
520+
- **证据:** import ratchet 钉住这条边,而不是让它处于未记录状态;Codex
521+
provider-routing 的 native host smoke 覆盖受保护的重启路径。
522+
- **剩余:** 不关闭更广的 M1–M5 发行物与零私有 import 验收;D1–D4 仍未决。
523+
该接缝只为一个调用方记录一个模块,不是通用的包到内核许可。
524+
501525
## 附录 B:决策日志
502526

503527
| 日期 | 决策 | 负责人 / 批准 | 备选 | 变更的规范章节 |
504528
| --- | --- | --- | --- | --- |
505-
| — | — | — | — | — |
529+
| 2026-10-29 | `loopx.runtime_activation` 加入受支持的宿主接入接缝,使 Codex provider-routing 包能在重启自己管理的 Chat 服务期间持有"已受理 Chat 工作"栅栏 | maintainers,经 RFC 评审与合并 | 不带栅栏重启 Chat 服务;把锁与状态检查复制进包;让这条边保持未记录 | 第 5 节 |
530+
531+
除此以外没有已批准的决策。D1–D4 仍是未决提案。
506532

507533
## 附录 C:证据登记
508534

‎tests/architecture/package_kernel_import_pins.json‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
22
"schema": "loopx_package_kernel_import_pins_v0",
3-
"baseline_commit": "70bc98198ce9e8c33e461cc41fe77243d713dcf0",
4-
"note": "Exact pin of every `loopx.*` module imported by a co-located package. Pre-existing private edges remain migration debt. The supported-host-integration decision in the monorepo-distribution-split RFC Section 5 permits MemT's two public integration imports; it does not permit private kernel imports. Remove an entry in the PR that removes the import. Adding an entry needs a recorded design decision.",
3+
"baseline_commit": "5d7f0a61b0b79876801c05e1d26352687f270794",
4+
"note": "Exact pin of every `loopx.*` module imported by a co-located package. Pre-existing private edges remain migration debt. The supported-host-integration decision in the monorepo-distribution-split RFC Section 5 permits MemT's two public integration imports and the Codex provider-routing activation guard; it does not permit private kernel imports. Remove an entry in the PR that removes the import. Adding an entry needs a recorded design decision.",
55
"imports": {
66
"loopx-ark-turn": [
77
"loopx.control_plane.turn_driver.host_candidate",
88
"loopx.file_lock"
99
],
10+
"loopx-codex-provider-routing": [
11+
"loopx.runtime_activation"
12+
],
1013
"loopx-finance-value-discovery": [
1114
"loopx.extensions.lark.presentation.message_card",
1215
"loopx.extensions.presentation"

‎tests/architecture/test_package_kernel_import_ratchet.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
contracts and CLI subcommands through `CapabilityRegistry`; it never imports
66
kernel-private modules." Three packages already do. The Section 5 supported
77
host integration decision adds MemT's public facade and shared file-lock API,
8-
not another private-kernel exception. This guard pins those
9-
edges exactly so a new one needs a recorded decision and a removed one
10-
lowers the pin in the same PR, following `test_top_level_module_budget`.
8+
plus the Codex provider-routing activation guard, not another private-kernel
9+
exception. This guard pins those edges exactly so a new one needs a recorded
10+
decision and a removed one lowers the pin in the same PR, following
11+
`test_top_level_module_budget`.
1112
"""
1213

1314
from __future__ import annotations

0 commit comments

Comments
 (0)