|
3 | 3 | - Status: Accepted, transaction-payoff phase in progress |
4 | 4 | - Proposed by: LoopX maintainers |
5 | 5 | - Date: 2026-08-15 |
6 | | -- Last revised: 2026-08-22 |
| 6 | +- Last revised: 2026-08-23 |
7 | 7 | - Scope: an incremental, replacement-first migration of the LoopX control-plane |
8 | 8 | core from Python to TypeScript without maintaining two semantic |
9 | 9 | implementations |
@@ -158,6 +158,7 @@ choice is now implemented rather than hypothetical. |
158 | 158 | | Todo, quota, and scheduler proof slices ([#3431](https://github.com/huangruiteng/loopx/pull/3431)–[#3434](https://github.com/huangruiteng/loopx/pull/3434)) | Completion fence/state, workspace causality, and scheduler transitions each have one TS rule owner | The cuts are mostly leaf-shaped; Python still composes several product transactions | |
159 | 159 | | Scheduler durable state ([#3440](https://github.com/huangruiteng/loopx/pull/3440)) | State normalization, persistence, replay, and one coarse transition are TS-owned | The Python compatibility path still pays a cross-runtime transport tax | |
160 | 160 | | Runtime decoders ([#3443](https://github.com/huangruiteng/loopx/pull/3443)) | Stable primitive decoding has one small shared module; domain decoders remain local | No larger schema framework is justified | |
| 161 | +| Transaction payoff ([#3464](https://github.com/huangruiteng/loopx/pull/3464), [#3481](https://github.com/huangruiteng/loopx/pull/3481), and Todo completion) | Turn settlement, quota delivery routing, and Todo completion each cross one coarse TS boundary; the Todo transaction owns identity, replay fencing, validation planning/result reduction, continuation/recovery, and completion metadata | Python still executes explicitly external providers and materializes legacy Markdown/event results; other domains still need their own bounded cutovers | |
161 | 162 |
|
162 | 163 | These slices proved correctness, packaging, Windows lifecycle, crash recovery, |
163 | 164 | real TS-owned writes, and acceptable warm primitive-call latency. They also |
@@ -223,40 +224,46 @@ domains would now increase total complexity. |
223 | 224 | ### Stage 2B — Complete transaction cutovers (active) |
224 | 225 |
|
225 | 226 | Select by deletion leverage and runtime traffic, not by ease of translation. |
226 | | -The first candidate is the complete Turn settlement/commit transaction because |
227 | | -the current Python settlement surface composes several TS calls and retains |
228 | | -duplicate settlement types. Subsequent candidates are complete Todo completion, |
229 | | -quota spend/settlement, and scheduler heartbeat/state transactions, chosen only |
230 | | -when each PR can retire an existing facade or materially shrink it. |
| 227 | +The shipped Turn settlement, quota delivery-routing, and Todo-completion |
| 228 | +cutovers establish the pattern. Subsequent candidates are quota |
| 229 | +spend/settlement and scheduler heartbeat/state transactions, chosen only when |
| 230 | +each PR can retire an existing facade or materially shrink it. |
231 | 231 |
|
232 | 232 | For each completed transaction, replace migration-only characterization workers |
233 | 233 | and Python implementation fixtures with native TS semantic/invariant tests plus |
234 | 234 | one durable end-to-end adapter contract. Retain a characterization corpus only |
235 | 235 | while an old authority remains executable or a versioned compatibility window |
236 | 236 | requires differential proof; record its deletion trigger when introduced. |
237 | 237 |
|
238 | | -Current implementation status: Stage 1 and the bounded Stage 2A proofs are |
239 | | -shipped. The first Stage 2B cutover is the complete Turn settlement/commit |
240 | | -transaction. TypeScript owns preflight authorization, ordered-prefix and replay |
241 | | -validation, provider failure classification, receipt construction, terminal |
242 | | -closeout joining, and the canonical result. Python is a mechanical adapter for |
243 | | -the still-external writeback, spend, and terminal providers. New work therefore |
244 | | -uses two coarse reductions and a completed replay uses one, replacing the prior |
245 | | -multi-helper bridge. The remaining fine-grained settlement facade can be |
246 | | -deleted after quota, host-adapter, and task-lease callers move to their own |
247 | | -coarse transactions. |
248 | | - |
249 | | -Quota delivery routing is the next bounded payoff cutover. TypeScript now owns |
250 | | -continuity-versus-fallback selection and the selected Todo's settlement boundary |
251 | | -behind one request. Python still prepares the normal fallback candidate and |
252 | | -projects the typed result into the legacy quota packet, but it no longer composes |
253 | | -two leaf decisions. The in-flight path moves from two cross-runtime calls to one; |
254 | | -no-anchor paths with a fallback candidate and preempted paths remain at one, |
255 | | -while an empty no-anchor candidate set remains at zero through a projection-layer |
256 | | -short circuit. The Python facade exits when the |
257 | | -quota route and CLI caller move into the native TypeScript transaction. Vision |
258 | | -checkpointing remains a separate refresh/writeback transaction because it does |
259 | | -not share the delivery-selection lifecycle phase. |
| 238 | +Current implementation status: Stage 1, the bounded Stage 2A proofs, and three |
| 239 | +Stage 2B cutovers are shipped: |
| 240 | + |
| 241 | +- Turn settlement/commit: TypeScript owns preflight authorization, |
| 242 | + ordered-prefix and replay validation, provider failure classification, |
| 243 | + receipt construction, terminal closeout joining, and the canonical result. |
| 244 | + A real Python provider uses two coarse reductions; completed replay uses one. |
| 245 | +- Quota delivery routing: TypeScript owns continuity-versus-fallback selection |
| 246 | + and the selected Todo's settlement boundary. The in-flight path moved from |
| 247 | + two cross-runtime calls to one; the empty candidate short circuit remains |
| 248 | + zero. |
| 249 | +- Todo completion: TypeScript owns completion identity, terminal replay fence, |
| 250 | + validation declaration/effect planning, validation-receipt reduction, |
| 251 | + continuation/recovery, and completion metadata in one transaction. A Todo |
| 252 | + without declared validation, including a replay, uses one reduction. A real |
| 253 | + caller-approved validation command remains an explicit Python provider |
| 254 | + between two reductions. A source snapshot is compared after the mutation |
| 255 | + lock so a receipt for one declaration cannot authorize a changed Todo. |
| 256 | + Materialized and event-projected writes consume the same typed result. |
| 257 | + |
| 258 | +The Todo cutover removes the Python state-evaluation dataclass, local identity |
| 259 | +projection, replay helper, and public runtime handlers for those implementation |
| 260 | +leaves. The remaining Python Todo facade owns transport, external command |
| 261 | +execution, source compare-and-swap, legacy response projection, and the actual |
| 262 | +Markdown/event write. It exits when those writers and the CLI move into the |
| 263 | +native TS transaction. The remaining fine-grained Turn facade exits after |
| 264 | +quota, host-adapter, and task-lease callers move to their own coarse |
| 265 | +transactions. Vision checkpointing remains a separate refresh/writeback |
| 266 | +transaction because it does not share the delivery-selection lifecycle phase. |
260 | 267 |
|
261 | 268 | ### Stage 3 — CLI and App convergence |
262 | 269 |
|
|
0 commit comments