diff --git a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/article.css b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/article.css index 45273ebe86..5c41175a21 100644 --- a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/article.css +++ b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/article.css @@ -20,6 +20,8 @@ .ts-migration .desktop-contents { position: sticky; top: 32px; } .ts-migration .toc-caption { min-height: 44px; margin: 0; font-weight: 600; } .ts-migration .mobile-contents { display: none; } +.ts-migration .diagram-node.kernel strong { color: #fff; } +.ts-migration .diagram-node.kernel code { background: #2b2b2b; color: #f5f5f5; } @media (max-width: 768px) { .ts-migration .desktop-contents { display: none; } .ts-migration .mobile-contents { display: block; } diff --git a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/cli-agent-loop-en.svg b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/cli-agent-loop-en.svg new file mode 100644 index 0000000000..cf96d9599b --- /dev/null +++ b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/cli-agent-loop-en.svg @@ -0,0 +1,98 @@ + + CLI for Agents: a state-machine contract, not terminal prose + Four pillars of LoopX's Agent-facing CLI: one shared decision source with runnable recovery commands, honest completeness separated from display truncation, output budgets and suffix-only folding preserving prefix KV cache, and read-only previews plus CAS and idempotent receipt replay. + + + + + + + + + + + + CLI for Agents: a state-machine contract, not terminal prose + Runnable recovery, honest completeness, prefix-KV suffix folding, and CAS + idempotent receipt replay + + + + LLM Agent Turn + Stateless, literalist caller + + • Every stdout byte enters + prompt & prefix KV cache + + • Unlabeled truncation looks + like “0 tasks remaining” + + • Side-effecting previews & + timeouts cause retry loops + + + Suffix Fold (#9213) + Early prefix stays frozen; + finished task suffix folds + into a verified receipt + + + + 01 · SINGLE DECISION SOURCE + Runnable recovery, not prose + Plan, step & settle share one view + Copy-runnable repair CLI hints + 22k-row RPC: 2.35 MB → 959 B (#7462) + #4496 · #4595 · #6212 · #7462 + + + + 02 · HONEST READ COMPLETENESS + Display limit ≠ work finished + Kernel-sealed freshness & coverage + Full-graph check before --limit cap + Truncated view ≠ missing-source alert + #5085 · #5087 · #6679 · #6874 + + + + 03 · CONTEXT & KV-CACHE BUDGETS + Output gates & suffix folding + Hard byte/line & diff gates (#2144) + >=1 KiB SHA-256 subtree dedup (#7196) + Suffix fold keeps prefix KV (#9213) + #2144 · #6123 · #7196 · #9213 + + + + 04 · READ PURITY & IDEMPOTENT CAS + Pure dry-run & exact replay + Single write; keep rejections (#4286) + --dry-run triggers zero writes (#8685) + Explicit CAS revision + replay key + #4094 · #4286 · #7088 · #8685 + + + + + + + + + Every PR enforces CLI stdout budgets (#2144) and base/head semantic output diffs (#6123) across crowded fixtures. + diff --git a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/cli-agent-loop-zh.svg b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/cli-agent-loop-zh.svg new file mode 100644 index 0000000000..5a9c69d26a --- /dev/null +++ b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/cli-agent-loop-zh.svg @@ -0,0 +1,98 @@ + + 面向 Agent 的 CLI:状态机合同,而非人类终端文本 + LoopX 面向 Agent 的 CLI 四大支柱:返回可执行恢复命令的单一决策信源、区分展示截断与任务完成的诚实读取、输出预算门禁与保护前缀 KV 缓存的后缀折叠,以及纯只读预检与 CAS 加操作 ID 幂等重放。 + + + + + + + + + + + + 面向 Agent 的 CLI:状态机合同,而非人类终端文本 + 可执行恢复指令、截断与完成分离、保护前缀 KV 的后缀折叠,以及 CAS 与幂等回执重放 + + + + LLM Agent 调用方 + 跨轮无隐式记忆 · 按字面解析 + + • 每字节 stdout 直接计入 + 上下文窗口与前缀 KV 缓存 + + • 未标记截断的列表在字面上 + 等同于“剩余任务为零” + + • 预检副作用与超时丢包极易 + 触发盲目猜参和重复写入 + + + 后缀回执折叠 (#9213) + 早期前缀字节保持冻结; + 已完结任务后缀原子折叠 + 为保留失败事实的回执 + + + + 01 · 单一决策信源与恢复指令 + 返回可执行命令,而非报错文本 + 准入、单步与结算共享同一状态快照 + 阻断时直接投影可复制执行的恢复命令 + 2.2 万行动作载荷:2.35 MB → 959 B + #4496 · #4595 · #6212 · #7462 + + + + 02 · 诚实完整度与截断分离 + 展示行数上限 ≠ 任务全部完成 + 由内核统一密封新鲜度与覆盖率证明 + 在 --limit 截断前先对全量集合求值 + 严格区分正常展示截断与信源漏读告警 + #5085 · #5087 · #6679 · #6874 + + + + 03 · 输出预算与前缀 KV 经济学 + 体积差分门禁与后缀回执折叠 + 严格校验字节、行数与语义差分 (#2144) + 跨轮次 >=1 KiB 未变子树摘要去重 + 仅折叠已完成任务后缀保住前缀 KV + #2144 · #6123 · #7196 · #9213 + + + + 04 · 读写纯净与 CAS 幂等重放 + 纯只读预检与乐观并发重放 + 单次写入尝试,断连不丢冲突拒绝 (#4286) + --dry-run 零写钩子、零日志污染 (#8685) + 显式期望版本 CAS + 幂等键重放回执 + #4094 · #4286 · #7088 · #8685 + + + + + + + + + 每次 PR 在多任务拥挤夹具上校验 CLI 输出预算(#2144)与 base/head 语义差分门禁(#6123)。 + diff --git a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/preview-desktop-en.png b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/preview-desktop-en.png index 7a2af58492..61f60f6e23 100644 Binary files a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/preview-desktop-en.png and b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/preview-desktop-en.png differ diff --git a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/preview-mobile-zh.png b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/preview-mobile-zh.png index 4ee4ddd6b8..236549ee61 100644 Binary files a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/preview-mobile-zh.png and b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/preview-mobile-zh.png differ diff --git a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/task-composition-en.svg b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/task-composition-en.svg new file mode 100644 index 0000000000..07812afa32 --- /dev/null +++ b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/task-composition-en.svg @@ -0,0 +1,108 @@ + + Orthogonal Task Primitives Composing Over One TypeScript Effect Kernel + Six orthogonal primitive domains—User Gate × Fallback, Lineage × Successor, Acceptance × Cadence, Scoped Resume × Lease, Background Monitor, and Vision × Replan—compose as product state machines over one TypeScript Effect and Task Semantics Kernel backed by AuthorityStore and an append-only execution journal. + + + + + + + + + Orthogonal Task Primitives Composing Over One TypeScript Effect Kernel + Product state machines (×) preserve non-collapsible commit truths without static-DAG locks or cross-turn deadlocks + + + + + + + USER GATE × FALLBACK · #4292 #5277 #6327 #8844 + Scoped gate × dual channels + Typed decision-scope gates (#4292) + 0-spend ask + scoped fallback (#6327) + Consume covered scopes only (#8844) + + + + LINEAGE × SUCCESSOR · #4184 #5698 #5831 #8896 + Dynamic lineage × successor + Atomic supersede + lease drop (#5698) + Mandatory successor replan (#5831) + Compensating rollback history (#4184) + + + + ACCEPTANCE × CADENCE · #3058 #6357 #6784 #9165 + Acceptance × adaptive cadence + External acceptance oracles (#6784) + Live edits & Yardstick guard (#9165) + 8-tier backoff & reset token (#6787) + + + + SCOPED RESUME × LEASE · #4094 #6874 #8231 #9488 + Per-target resume × lease + Atomic full-graph readiness (#6874) + Per-target wakes, <=128 cap (#8231) + Fenced same-Agent takeover (#9488) + + + + BACKGROUND MONITOR · #4178 #4335 #5450 #9320 + Isolated background monitor + Edits keep done watches off (#4178) + Quiet vs. bound poll receipts (#5450) + No-LLM isolated watch lane (#9320) + + + + VISION × REPLAN · #4902 #5633 #8588 #8854 + Goal-first Vision × replan + Vision ahead of local quiet (#5633) + Keep trigger on watch exit (#8854) + Settle active turn pre-stop (#8588) + + + + + + + + + TypeScript Effect & Task Semantics Kernel + GoalState => F[Decision] (#2905) · Todo done ≠ Turn settled ≠ Peer delivered ≠ Goal accepted + Product composition (#6874, #7298, #9176): revision CAS · 3h lease fencing (#9487) · dual channels · settle-before-stop + + + + + + + + Transactional State Store (AuthorityStore) + Atomic state head, active leases, archive & receipts + #3798 · #4121 · #5805 · #7834 · #9223 + + + + Append-Only Execution Journal + Two-phase external effect preflight & crash recovery + #3416 · #3464 · #3485 · #4286 + + Orthogonal primitives compose in one transaction—keeping user gates non-blocking and plans malleable mid-flight. + diff --git a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/task-composition-zh.svg b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/task-composition-zh.svg new file mode 100644 index 0000000000..c230def678 --- /dev/null +++ b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/task-composition-zh.svg @@ -0,0 +1,108 @@ + + 正交任务原语在同一套 TypeScript 语义内核上乘积组合 + 六组正交原语域——User Gate × Fallback、Lineage × Successor、Acceptance × Cadence、Scoped Resume × Lease、Background Monitor 与 Vision × Replan——作为乘积状态机在同一套 TypeScript Effect 与任务语义内核上协同运行,底层连接 AuthorityStore 与只追加执行账本。 + + + + + + + + + 正交任务原语在同一套 TypeScript 语义内核上乘积组合 + 乘积状态机(×)守住四类不可坍缩的提交事实,既打破静态工作流 DAG 锁死,又消除跨轮死锁 + + + + + + + USER GATE × FALLBACK · #4292 #5277 #6327 #8844 + 作用域门禁 × 人机双通道 + 类型化 decision scope 门禁 (#4292) + 零消耗提问并行 scoped fallback + 审批仅核销对应受控范围 (#8844) + + + + LINEAGE × SUCCESSOR · #4184 #5698 #5831 #8896 + 动态谱系 × 强制后继派生 + 原子 supersede 关联并释租 (#5698) + 清障无后继强制 successor replan + 回滚追加补偿事件保谱系 (#4184) + + + + ACCEPTANCE × CADENCE · #3058 #6357 #6784 #9165 + 外部验收 × 8 档自适应节拍 + 外部 acceptance oracle 判定 (#6784) + 实时纠偏与 Yardstick 防刷分 (#9165) + 8 档退避遇 reset token 归零 (#6787) + + + + SCOPED RESUME × LEASE · #4094 #6874 #8231 #9488 + 分目标唤醒 × 跨租约续跑 + 单事务原子求值完整依赖图 (#6874) + 分目标唤醒代际 <=128 防误唤醒 (#8231) + 同主重领 fenced lease takeover + + + + BACKGROUND MONITOR · #4178 #4335 #5450 #9320 + 隔离后台监控 × 零消耗观测 + 局部编辑不重触发已完监控 (#4178) + 分离静默心跳与任务轮询回执 (#5450) + 独立后台通道免 LLM healthcheck + + + + VISION × REPLAN · #4902 #5633 #8588 #8854 + 目标优先 Vision × 自指重规划 + Vision 优先于静默并拒空确认 (#5633) + 重规划内退役监控仍保触发源 (#8854) + 派生停机前先结清当轮回执 (#8588) + + + + + + + + + TypeScript Effect & Task Semantics Kernel(语义与效应内核) + GoalState => F[Decision] (#2905) · Todo 完成 ≠ Turn 结算 ≠ Peer 送达 ≠ Goal 验收 + 乘积组合不变量(#6874, #7298, #9176):版本号 CAS · 3h 租约围栏(#9487)· 人机双通道正交 · 停机前结清回执 + + + + + + + + 事务状态存储(AuthorityStore) + 原子提交状态头、活跃租约、有界归档与操作回执 + #3798 · #4121 · #5805 · #7834 · #9223 + + + + 只追加执行账本(Append-Only Execution Journal) + 外部副作用两阶段预检与崩溃后原回执恢复 + #3416 · #3464 · #3485 · #4286 + + 正交原语在单次事务内乘积组合:既让人机审批不冻死全局支线,又让长程计划在运行中途安全演进。 + diff --git a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/timeline-en.svg b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/timeline-en.svg index 137c627076..14ac152b27 100644 --- a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/timeline-en.svg +++ b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/timeline-en.svg @@ -1 +1,88 @@ -Two months, three overlapping tracksOverlapping transaction, authority/storage, and Semantics tracks from August to October.Two months, three overlapping tracksRepresentative merged milestones · Overlapping work, not a claim of full qualificationMid / late AugustSeptemberOctoberTransactionsEffect ProgramTransactions / preflightTodo / quota / leaseReal producersCaller convergenceOrdinary writer retirementAuthority / storageCoordination coreReference / recoveryAuthorityStore / SQLiteCheckpoint + deltaNew-Goal defaultsRecovery / cost checksSemanticsRules converge Song: RFC / registryProducer / unknownBindings / interpretationCounterexample fixesAugust 15 formal RFC → mid-October retirement. #6396 is the closing phase. \ No newline at end of file + + Three converging control-plane tracks + Overlapping transaction and task-semantics, authority and storage, and vocabulary and Agent-CLI tracks from August to November 2026. + + + Three converging control-plane tracks + Representative milestones from transactional cutover to Agent task & CLI semantics (Aug – Nov 2026) + + Mid / late Aug + September + October + November + + Transactions + & task loop + + Effect Program + Complete tx + preflight + #3416 · #3447 · #3464 + + + Tasks / leases / quota + Real caller cutovers + #4032 · #4178 · #4286 + + + Writer retirement + Atomic swap & cleanup + #5450 · #5698 · #6396 + + + Task composition + Scoped wakes & leases + #7298 · #8231 · #9488 + + Authority + & storage + + Coordination core + Claims & replay refs + #3529 · #3669 · #3798 + + + AuthorityStore + SQLite + checkpoints + #4121 · #4408 · #4931 + + + SQLite + hard lease + Bounded task archive + #4778 · #5805 · #7834 + + + 3h lease & cloud SPI + 20k+ commits · custody + #8759 · #9223 · #9308 + + Semantics + & Agent CLI + + Interface budgets + Stdout & payload gates + #2144 · #3226 + + + Song: Semantics + Registry & single owner + #4433 · #4494 · #4496 + + + Honest CLI views + Truncation ≠ finished + #5085 · #6123 · #6874 + + + Zero-Any & KV fold + Dedup & suffix receipts + #7196 · #9213 · #9433 + + Aug 15 migration RFC (#3226) → Oct 16 legacy writer retirement (#6396) → Nov 27 composable task & Agent-CLI kernel. + diff --git a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/timeline-zh.svg b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/timeline-zh.svg index 710324228f..258fe83c2b 100644 --- a/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/timeline-zh.svg +++ b/apps/presentation/site/public/blog/images/typescript-control-plane-refactor/timeline-zh.svg @@ -1 +1,88 @@ -两个月,三条交错推进的工程线Overlapping transaction, authority/storage, and Semantics tracks from August to October.两个月,三条交错推进的工程线公开合并历史的代表节点 · 路线并行,未标记所有工作已完成8 月中下旬9 月10 月事务与调用方Effect Program完整事务 / preflightTodo / quota / lease真实 producer调用方收敛普通旧 writer 退役权威与存储Coordination coreReference / recoveryAuthorityStore / SQLiteCheckpoint + delta新建默认值恢复与成本验证Semantics迁移规则逐步收敛 Song: RFC / registryProducer / unknown绑定与解释继续收敛持续修复反例08.15 正式 RFC → 10 月中旬集中退役;#6396 是收尾阶段。 \ No newline at end of file + + 三条收敛进同一内核的控制面主线 + 2026 年 8 月至 11 月,事务与任务语义、共享权威与存储、词表棘轮与 Agent CLI 三条主线交错推进。 + + + 三条收敛进同一内核的控制面主线 + 从完整事务切换、共享存储到长程任务原语与 Agent CLI 的代表里程碑(2026.08 – 11) + + 8 月中下旬 + 9 月 + 10 月 + 11 月 + + 事务与 + 任务闭环 + + Effect Program + 完整事务与两阶段预检 + #3416 · #3447 · #3464 + + + 任务 / 租约 / 配额 + 真实调用方逐步切换 + #4032 · #4178 · #4286 + + + 旧写入路径退役 + 原子替代与路径清理 + #5450 · #5698 · #6396 + + + 长程任务原语组合 + 分目标唤醒与跨租约续跑 + #7298 · #8231 · #9488 + + 共享权威 + 与存储 + + 协调核心与回执 + 认领与可恢复引用 + #3529 · #3669 · #3798 + + + AuthorityStore + SQLite 与增量快照 + #4121 · #4408 · #4931 + + + SQLite 与强租约 + 默认切换与有界归档 + #4778 · #5805 · #7834 + + + 3h 租约与云端 SPI + 2 万+提交 · 成果托管 + #8759 · #9223 · #9308 + + 词表棘轮 + 与 Agent CLI + + 接口输出预算 + Stdout 与载荷门禁 + #2144 · #3226 + + + Song: Semantics + 词表登记与单一决策源 + #4433 · #4494 · #4496 + + + 诚实 CLI 读取视图 + 区分展示截断与任务完成 + #5085 · #6123 · #6874 + + + 零 Any 与后缀折叠 + 子树去重 · 保前缀 KV + #7196 · #9213 · #9433 + + 08.15 迁移提案(#3226)→ 10.16 退役旧写入路径(#6396)→ 11.27 任务原语组合与 Agent CLI 收敛。 + diff --git a/apps/presentation/site/public/blog/index.html b/apps/presentation/site/public/blog/index.html index eaa47487cd..d98da01fe2 100644 --- a/apps/presentation/site/public/blog/index.html +++ b/apps/presentation/site/public/blog/index.html @@ -43,8 +43,8 @@

EdgeBench / LHTB: notes from historical runs

Exploratory notes by songoow on historical, partly interrupted EdgeBench/LHTB runs. The feedback-first option is withdrawn; these are not official LoopX results or current capability claims.

Read the article
-

LoopX 2.0 · Engineering

-

LoopX 2.0: Two Months of TypeScript Control-Plane Engineering

From an incremental migration proposal to complete transactions, shared authority, semantic checks, and retirement of old paths. How real callers and counterexamples changed the design.

Read article
+

LoopX Control Plane · Engineering

· Updated November 2026

+

LoopX’s TypeScript Semantic Control Plane: Transactions, Task Semantics, and an Agent-Native CLI

LoopX is, at its core, a general-purpose long-horizon task semantics engine—unifying complete state transactions, shared AuthorityStore, zero-Any vocabularies, composable resume/monitor/replan/handoff primitives, and an Agent-native CLI.

Read article

Agentic Software · Development

diff --git a/apps/presentation/site/public/blog/typescript-control-plane-refactor/index.html b/apps/presentation/site/public/blog/typescript-control-plane-refactor/index.html index 3a02b31bf8..0d8b01db46 100644 --- a/apps/presentation/site/public/blog/typescript-control-plane-refactor/index.html +++ b/apps/presentation/site/public/blog/typescript-control-plane-refactor/index.html @@ -2,19 +2,19 @@ -LoopX 2.0: Two Months of TypeScript Control-Plane Engineering · LoopX - +LoopX’s TypeScript Semantic Control Plane: Transactions, Task Semantics, and an Agent-Native CLI · LoopX + - + -
← All articles

LoopX 2.0 · Engineering

LoopX 2.0: Two Months of TypeScript Control-Plane Engineering

An effect succeeds without a checkpoint. An expired executor returns with a valid receipt. An evidence correction restarts finished work. Two months of refactoring brought these problems under complete transactions and shared semantics.

-
-

Retrying an operation can execute its effect twice. Reading back a success receipt can revive execution rights that have already expired. These boundaries between execution, storage and recovery are central to LoopX’s TypeScript refactor.

+
← All articles

LoopX Control Plane · Engineering

LoopX’s TypeScript Semantic Control Plane: Transactions, Task Semantics, and an Agent-Native CLI

LoopX is, at its core, a general-purpose long-horizon task semantics engine—not a prompt wrapper, static DAG, or generic microservice queue. When an effect succeeds before its checkpoint lands, a resumed Agent outlives its task lease, or a truncated CLI view looks identical to finished work, conditional continuation, continuous observation, evidence-driven replanning, peer handoffs, and Agent-native CLI output must compose inside one TypeScript state machine.

+
+

Retrying an operation can execute its effect twice; reading back a success receipt can revive execution rights that have already expired. Across runs spanning hours or days, a general-purpose long-horizon task semantics engine must make conditional continuation, background observation, evidence-driven replanning, peer handoffs, prefix-KV-safe CLI interactions, and transactional state across local SQLite and cloud PostgreSQL composable and verifiable for long-horizon agents and agent teams.

1. The semantic questions we put stronger models to work on

We use stronger models in design, implementation and review, especially to trace assumptions across files and runtimes. The difficult cases often combine individually reasonable checks into an unsafe execution order. Core PRs in August and September already dealt with these problems; they were part of the migration itself.

The effect happened, but its checkpoint did not. Is retry safe?

@@ -34,13 +34,13 @@

Why could correcting evidence restart finished work?

Making a plausible model answer face a counterexample

Ask for the mistaken assumption, then an execution sequence that refutes it: disconnect after commit, replay an expired lease, correct only evidence, explicitly clear a value. Check the real owner, provider and caller.

Stronger models help connect scattered conditions; counterexamples, real storage and refusal paths constrain their answers. There is no per-PR model comparison here, so these examples cannot quantify a particular model’s independent contribution. They show the mechanisms and reasons for changing them. Later runtime routing in #7145 and original-Turn closeout in #7269 continue this work rather than defining its whole history.

-

2. Reconstruct the history: the migration plan changed too

-

The formal migration RFC merged on August 15. By the concentrated retirement of ordinary legacy writers in mid-October, the program had spanned roughly two months. Several tracks overlapped: transaction ownership, caller integration, shared authority, storage and history costs, Semantics, compatibility, and retirement.

-

The final relay by three developers and their agents in #6396 depended on that earlier work. Earlier choices determined what could be deleted and what still had to recover afterward.

-

Our new maintainer, Song (@songoow), has also been advancing the Semantics RFC, vocabulary convergence, production evidence, and checker fixes since mid-September. That track belongs alongside the transaction and storage story.

-

LoopX retains goals, tasks, evidence, and execution boundaries for long-running agents. Models propose routes. The control plane protects versions, execution authority, and state commits, then finds a valid recovery position after interruption.

+

2. Reconstruct the history: from migration plan to task semantics engine

+

The formal migration RFC merged on August 15 (#3226). Over the first two months through mid-October, the program migrated core transactions to TypeScript and retired ordinary legacy Markdown writers in #6396. Through late November, a second convergence wave built directly on that transactional kernel: composable task continuation, background monitoring, and replanning; peer delegation handoffs; closed-set vocabulary ratchets; and an Agent-native CLI.

+

The three-developer-and-agent relay in #6396 closed the dual-writer transition so later task, collaboration, and CLI state machines could rely on a single authority owner.

+

Our new maintainer, Song (@songoow), has also been advancing the Semantics RFC, vocabulary convergence, production evidence, and checker fixes since mid-September. That track belongs alongside the transaction, task-semantics, and CLI story.

+

At its core, LoopX is a domain-neutral, general-purpose long-horizon task semantics engine for long-horizon agents and agent teams. Models propose routes; the engine protects versions, execution leases, composable task transitions, and state commits, then locates a valid recovery position after interruption.

Much of the original implementation was Python. TypeScript hosts, Pi integration, and the dashboard already existed. A Python call to make a decision, followed by a TS host consuming the result, was a natural starting point. As the system grew, defaults, state interpretation, ordering, and persistence could become distributed across both runtimes.

-

We wanted clear typed ownership of control-plane rules and contracts shared by the CLI, hosts, and App. The history developed through overlapping stages.

+

We wanted clear typed ownership of control-plane rules and contracts shared by the CLI, hosts, and App. The 103-day history developed through overlapping stages.

@@ -71,8 +71,8 @@

2. Reconstruct the history: the migration plan changed too

- - + + @@ -86,11 +86,21 @@

2. Reconstruct the history: the migration plan changed too

- - + + + + + + + + + + + +
From mid-SeptemberSong advances Semantics; storage work tackles checkpoints, deltas, writes, and replay cost#4433, #4408Song advances Semantics; storage work tackles checkpoints, deltas, writes, and replay cost; sealed projection envelopes#4433, #4408, #5085
Late September
Mid-OctoberConcentrated retirement, followed by recovery, producer, and integration fixes#6396Concentrated legacy writer retirement, followed by single-transaction task reads and progressive context#6396, #6874, #7196
Late October–mid-NovemberUnify per-turn decision and settlement sources; per-target monitor wakeups, partial peer returns, and 20k+ commit PostgreSQL checkpoints#7462, #8139, #8211, #8231, #8759
Mid–late NovemberUnified turn loop by default; suffix-only context folding preserving prefix KV cache; 3-hour task leases and cross-lease continuation; zero-Any ratchet; Apache-2.0 storage SPI#9176, #9213, #9223, #9433, #9488
-
Migration history: overlapping transaction, authority/storage, and Semantics tracks
Migration history: overlapping transaction, authority/storage, and Semantics tracks Scroll on narrow screens; open the image for full size.
+
Converging transaction, authority/storage, and Semantics and Agent-CLI tracks
Converging transaction/task-loop, authority/storage, and Semantics/Agent-CLI tracks across the migration. Scroll on narrow screens; open the image for full size.

The original August proposal considered a read-first sequence and staged dual reads and writes. The accepted approach evolved toward Effect Programs first, then replacing complete transactions and deleting the old rules, with one production semantic owner. An early proposal's staging ideas should not be presented as the runtime architecture of 2.0.

Plans can change usefully. The important record is why the route changed, which slices cut over, and which remained references or candidates. The maintained TS RFC retains those checkpoints.

3. Start with the Effect Program: agree on what happened

@@ -131,7 +141,7 @@

4. Migrate a complete transaction: two calls can be right

Review caught an attractive but unsafe optimization: retaining only the final reduction. That saved a call, but malformed identity or journal state could be rejected only after an external provider had executed. The final design kept preflight. TS authorizes the exact pending effects; Python executes and checkpoints those effects before final reduction.

A correct check in the wrong position can fail to protect the user. Its order relative to an effect matters.

Later lease, Vision, monitor-poll, spend, and void slices followed the complete-transaction approach. Their migration economics must name the old rules removed, bridges added, happy and recovery crossings, scaffolding exit conditions, and correctness and latency through the full entrypoint. A net increase in code can be justified, but the extra code needs a purpose.

-

5. Shared authority: separate domain rules from storage primitives

+

5. Shared authority: connect distributed storage to Agent execution

In parallel, shared-authority work progressed from wchwawa's coordination core, aggregate/provider foundations, and recoverable references to the TS AuthorityStore in #3798.

Two responsibilities need distinct owners:

    @@ -170,6 +180,13 @@

    5. Shared authority: separate domain rules from storage primi

For example, a PostgreSQL connection may fail after COMMIT. The write may already be durable. A provider must distinguish missing, unavailable, failed, and ambiguous durability. A missing success response does not establish a missing commit. Reading the original operation's receipt is part of recovery. The PostgreSQL candidate also retained its separate deployment and adoption boundaries.

An earlier Python executor served reference and coverage purposes. The unused prototype was later deleted, while actual native File and SQLite paths became the corresponding qualification targets. Transitional references need an exit condition; they must not become a second production authority by accident.

+

When storage commits meet multi-hour Agent execution

+

Keeping pure storage commits separate from domain transition rules paid off once multi-hour Agents ran continuously across interrupted sessions:

+
    +
  • Incarnation-scoped history fencing (#3464, #8975): When a recreated goal reuses a logical identifier on one append-only log, un-scoped acknowledgments from a retired incarnation can falsely satisfy an open review gate; binding commit proofs to an immutable (goal_id, instance_id) pair isolates incarnations cleanly.
  • +
  • Separating lease renewal from concurrent mutation (#5805, #9257, #9487): Multi-hour tasks routinely renew execution leases mid-turn (now defaulting to 3 hours). Renewing a lease under the same epoch and idempotency key advances the lease version without invalidating an already-admitted turn settlement (#9257), whereas an expired or replaced lease grants authority only for zero-spend administrative closeout—never for continuing stale execution (#9487).
  • +
  • One state contract from local SQLite to cloud checkpoints (#4121, #4408, #9380, #8759, #9223): Periodic 64-commit snapshots and index-exact delta replay scaled from local files and SQLite (#4121, #4408, #9380) to tenant-isolated PostgreSQL recovery past 20,000 commits (historical adapter, #8759), before #9223 extracted server-side cloud storage behind a clean Apache-2.0 AuthorityStore SPI.
  • +

6. After SQLite: retained history needs a cost model

LIHUA919's #4121 connected an optional SQLite provider to the existing TS authority contract. A transaction atomically commits the head, receipts, events, and outbox. Domain claim and lease semantics stay with their owner.

Adding the database left three distinct engineering problems.

@@ -178,8 +195,8 @@

6. After SQLite: retained history needs a cost model

Third, object ownership during replay affects correctness. #4931 reduced copying, sorting, and encoding of unchanged subtrees, and stopped materializing unused full projections for receipt lookup. It also prevented a caller's mutation of a returned projection from poisoning the next replay basis. Persisted proof bytes remained unchanged.

Some paths improved substantially. Large-state latency, scan cost, and memory still had gaps, and the PR retained the unmet targets. Those distinctions are more useful than a single performance-improvement label for every path.

In October, #5805 changed unconfigured new-Goal defaults to canonical SQLite and hard leases. Existing Goals, explicit choices, and old operation retries retained their own contracts. A new default, migration of existing data, and retirement of old writers happened at different stages.

-

In early November, #7834 extended sqlite_v0 to own archived Todo history (todo_archive): during todo complete and todo supersede transactions, terminal items beyond the bounded active window (N = 5) are atomically archived into SQLite, decoupling the active ACTIVE_GOAL_STATE.md projection size from total historical volume while preserving exact ID readback and receipt recovery.

-

7. Song's Semantics: connect definition, production, and interpretation

+

In early November, #7834 extended the SQLite store to own archived task history: when tasks complete or are atomically superseded (#5698), terminal items beyond a small active window (N = 5) move into SQLite archive tables, decoupling live status-view size from total historical volume while preserving exact ID lookup and receipt replay.

+

7. Song's Semantics and the Zero-Any kernel

Our new maintainer, Song (@songoow), initiated and implemented the Semantics RFC, registry, and commit-path checks in #4433, merged on September 15. He continued advancing convergence afterward. This track governs how concepts grow as the software changes.

Cross-language migration readily creates duplicate knowledge. The same state can appear in a Python Enum, Literal, TS as const, a presentation layer, and a conditional branch. Even if the strings match today, one location may gain a value or change its interpretation tomorrow.

The Semantics RFC checks traceable relationships: definition owner, value set, generated binding, producer, and interpreter or projection. Runtime rules remain with typed owners. The registry constrains and checks them without becoming another production rule source.

@@ -191,8 +208,90 @@

Counterexamples for the checker itself

#4687 retained useful review counterexamples and fixed three confidently wrong answers: missed global rebinding, mutation after dictionary spread treated as the old initializer, and a shadowed String mistaken for the built-in conversion.

False alarms and missed values have different consequences. A conservative candidate set may report an extra problem. Missing a real produced value can let an unregistered output through. Unsupported dynamic forms must preserve an unknown.

The checks also need scan-coverage floors, so scanning fewer files cannot make the result green. Retiring an expanding committed inventory in favor of on-demand full-tree computation did not remove that obligation. Gaps outside supported forms remain explicit, and the tracking issue remains part of the work.

-

Generation and checking reduce synchronization mistakes. Their assumptions, coverage, and error direction still require review.

-

8. Callers and defaults determine whether migration reaches users

+

From registered vocabularies to the Zero-AST-Any ratchet

+

Two commit-time AST verifiers turned Song's vocabulary design (#4433, #4494, #4687) from a review guideline into an equality-anchored pre-merge ratchet across Python and TypeScript:

+
    +
  • Closed-set vocabulary verification (#4494, #8184): Full-tree AST scanning verifies all 34 registered vocabularies and 62 owner symbols with zero conflicting semantic values, pinning coverage floors by strict equality so constraints cannot silently loosen. For example, #8184 removed a local handoff-mode copy and enforced a typed subset rule: historical receipt decoding still recognizes "legacy" records, while fresh execution admission accepts only active claim and lease modes.
  • +
  • Zero-Any structural ratchets (#4178, #6396, #9282, #9433): Every one of the 43 tracked control-plane module baselines now pins dict[str, Any] counts to zero, preventing untyped dictionary merges from silently re-applying defaults or dropping fields across runtime boundaries.
  • +
+
Why eliminating dict[str, Any] surfaced latent concurrency and replay bugs

Replacing untyped dictionary carriers with explicit record types repeatedly exposed hidden state corruption during the refactor itself. Earlier in #4178, retiring serialize-and-reparse planning updates stopped partial edits from re-arming finished monitors; later, typing state-refresh records (#9418) exposed stale registry snapshots surviving replay across route switches, and replacing untyped hook dispatchers (#9433) uncovered and fixed seven real request-scope cache, symlink-ABA, and rollback-invalidation bugs in the same PR.

+ +

8. Long-horizon task semantics: orthogonal primitives composing beyond static DAGs

+

Traditional workflow DAGs collapse execution into a single node status (running → done). A general-purpose long-horizon task semantics engine cannot, because four commit truths are fundamentally distinct: Todo completion ≠ Turn settlement ≠ Peer delivery ≠ Goal acceptance. An in-flight progress writeback settles a Turn while the Todo stays open; a routine monitor observation closes at zero quota spend; a delivered peer message stays open while remaining work > 0; and Agent-declared "done" never satisfies Goal acceptance until external acceptance oracles validate cumulative outcome requirements.

+

Grounded in the Effect Interpreter formulation (#2905, GoalState => F[Decision]), LoopX models F not as one giant global enum, but as orthogonal product state machines (×)—Todo / Lineage × Claim / Lease × Scoped User Gate × Resume / Monitor × Vision / Replan × Quota / Scheduler Cadence—that compose in a single TypeScript transaction (#6874, #7298, #8211, #9176) without collapsing into global boolean locks or cross-turn deadlocks.

+
Orthogonal task primitives composing over one TypeScript Effect and Task Semantics Kernel
Six orthogonal primitive domains compose as product state machines over one TypeScript Effect & Task Semantics Kernel (GoalState => F[Decision]), backed by AuthorityStore and an append-only execution journal. Scroll on narrow screens; open the image for full size.
+

User Gate × Todo Fallback × Quota / Cadence

+

Naive agent frameworks treat human approval as a global boolean stop sign—either freezing the entire multi-hour run on a routine question or silently burying the gate. LoopX attaches a typed decision scope to each user gate (#4292), allowing the user channel and agent channel to intentionally diverge: the user channel surfaces the concrete owner decision at zero quota spend (paired with human-gate backoff), while the agent channel proves scope independence and executes safe scoped fallback work or settled monitor projections concurrently (#5277, #6327). Once answered, approval consumes only the covered decision scopes (#8844), while a causal reset token snaps the 8-tier adaptive scheduler cadence—spanning active work, peer-handoff wait, monitor watch, human-gate backoff, and derived terminal stop (#3058, #9459)—immediately back to active cadence whenever gate state or deadline buckets shift (#6787).

+

Blocker / Handoff Clearance × Atomic Supersede × Successor Replan

+

Long-horizon plans evolve mid-flight instead of following a frozen upfront DAG. Over a unified replan history reducer (#4902), atomic supersede links replacement tasks, retires predecessors, preserves decision and continuation lineage across archived history, and releases active leases in one commit (#4184, #5698). Crucially, when a blocking gate or peer handoff clears with neither an explicit successor nor a no-follow-up declaration, the kernel refuses to jump into blind execution or premature stop—routing into mandatory successor replan (#5831, #8896), while rollbacks append compensating events and spawn successors without erasing history.

+

Monitor × Scoped Resume × Vision / Self-Referential Replan

+

Deferred work resumes from a single atomic full-graph readiness read (#6874) keyed by per-target SHA-256 wakeup generations (capped at <=128 targets per monitor and refusing overflow rather than evicting waiter baselines, #8231). Pure observation reducers keep counter updates, omission, and explicit clearing distinct (#4178, #4335, #9249), while dedicated non-LLM background watch lanes stay isolated from foreground chat queues, live LLM healthcheck blips, and concurrent replans at zero routine spend (#5450, #9155, #9320, #9474). Above local waits, goal-level Vision and non-scalar Yardstick reversal cues (#7298, #8385, #9165) evaluate strictly ahead of quiet states—rejecting delta-free acknowledgements as replan no-ops (#5633, #5646), persisting trigger facts on turn receipts so retiring a stalled monitor mid-replan never deadlocks (#8854), reconciling whole-second vs. microsecond ACK clocks (#8804), stripping stale preflight companions (#9411), and settling the active turn before derived goal stop (#8588).

+

Turn Settlement × Lease Epoch × Live Goal Amendment & Acceptance Oracle

+

Closure binds to external acceptance oracles and cumulative outcome requirements shared across every turn view (#6473, #6784, #9328), while mid-flight user corrections and live conversation steering reconcile directly with Goal direction without invalidating active leases (#6357, #8270). When multi-hour execution crosses a 3-hour lease TTL, lazy rebinding avoids premature faults (#9183) and settlement splits cleanly by successor authority: foreign takeover triggers administrative zero-spend closeout (#9304), whereas same-Agent higher-epoch continuation executes a fenced lease takeover verified against fresh task and acceptance digests (#4094, #9488).

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Orthogonal composition (×)Failure mode before convergenceTypeScript kernel invariantVerified PRs
User Gate × Scoped Fallback × QuotaGlobal boolean locks froze entire multi-hour runs on local questions or over-cleared unrelated open gatesZero-spend user channel ask diverges cleanly from parallel scoped fallback; approval consumes covered decision scopes only#4292, #5277, #6327, #8844
Quota Gate × 8-Tier Cadence × Reset TokenIdle polls burned model tokens, or exponential backoff slept past shortened deadlines and fresh owner repliesSpend compute only after validated writeback; 8-class backoff snaps to initial cadence on causal reset token shift#3058, #6787, #9459
Blocker Clearance × Supersede × Successor ReplanStatic upfront DAGs broke mid-run; cleared blockers halted work without a pre-wired next step; rollbacks erased historyAtomic supersede + lease release; cleared blockers without no-follow-up force successor replan; compensating lineage#4184, #4902, #5698, #5831, #8896
Background Monitor × Scoped Resume × StorageGlobal counters woke unrelated waiters; partial edits re-armed watches; LLM healthcheck blips killed non-LLM pollsAtomic readiness & per-target wakes (<=128); omission-vs-clear reducer; model-free watch lanes serialized against replans#4178, #4335, #5450, #6874, #8231, #9155, #9249, #9320, #9474
Goal-First Vision × Yardstick × Self-ReplanLocal quiet states masked drift; scalar proxies hid regressions; retiring a stalled watch erased its trigger; stop stranded receiptsVision & Yardstick cues precede quiet/wait and reject no-op ACKs; receipt-persisted triggers; settle active turn pre-stop#5633, #5646, #7298, #8385, #8588, #8804, #8854, #9165, #9411
Turn Settlement × Lease Epoch × Acceptance OracleSelf-reported "done" closed unfinished goals; live chat edits clashed with leases; expired 3h leases either wrote stale or lost workExternal acceptance oracles & lease-safe live steering; zero-spend foreign closeout vs. digest-verified fenced lease takeover#4094, #6357, #6473, #6784, #8270, #9183, #9304, #9328, #9488
+ +

9. Peer collaboration: why “returned” is not “finished”

+

When an Agent delegates a slice to a peer worker, message delivery is only transport—neither proof that the delegated work is finished nor proof that the requester has adopted it. Building on revision-guarded claims and handoffs (#3529, #3669, #4032, #4094), LoopX keeps transport delivery, inbox reply completion, per-update requester consumption, and goal acceptance separate:

+
+

Peer return & custody contract · transport delivery ≠ reply completion ≠ requester adoption

+
+
1. Transport deliveryA locked four-phase send state machine confirms the message reached the inbox, ordered strictly so newer updates cannot overtake unverified sends.Transport status: delivered
+
2. Reply completion, consumption & acceptanceA request whose latest conclusion declares remaining work stays open in the inbox until the peer publishes a final conclusion with zero remaining work; turn-bound requester consumption only acknowledges an individual update so it stops re-alerting, while goal acceptance remains separate.Semantic state: open until final conclusion
+
+

Custody handoff (#4094, #9308): original authorship and historical review provenance remain immutable when active ownership transfers under a roster-fenced commit.

+
+
    +
  • Hash-chained partial returns (#3669, #8139): Workers frequently return an interim milestone alongside explicit remaining work and its wakeup condition. Conclusion updates form an immutable hash-linked chain under a 20,000-character combined budget, while replay preserves historical wire formatting so post-crash digest verification never drifts (#8139).
  • +
  • Read-only review isolation and per-Agent fault isolation (#8329, #8853): Inspecting an interrupted peer return does not consume the writable owner's execution reservation before native effect proofs are re-verified (#8329). Likewise, per-Agent turn closeout filters settlement history by explicit Agent identity so a peer's unrecorded or malformed receipt cannot deadlock another Agent's turn, while global status views still surface cross-Agent health (#8853).
  • +
  • Provenance-preserving custody transfer (#4032, #9308): When a collaborating peer retires, separating immutable authorship and per-review attribution from active ownership lets a local owner adopt open outcome responsibilities under a roster-version fence without rewriting who produced earlier evidence (#9308).
  • +
+ +

10. Callers and defaults determine whether migration reaches users

Complete transactions also need callers to express intent accurately. In #4178, a blank note means no update; an explicit empty list or false is interpreted by its field’s contract. These values cannot all be discarded as absent, or all treated as clearing. Dry-run must model that intent accurately. An unavailable selected provider must not trigger fallback elsewhere. #4279 later converged read classification and projection-delivery semantics. Some Python read ownership was deliberately retained. Clear ownership matters more than creating a second interpretation to pursue language purity.

Defaults expose similar distinctions. Current priority regressions protect these cases:

@@ -230,7 +329,7 @@

8. Callers and defaults determine whether migration reaches u

The File and SQLite regressions protect these cases. Applying new defaults after original-receipt recovery prevents an upgrade from making new decisions for history.

The closing review found another caller gap. The TS core passed direct tests for metadata-only completion repair. The normal Python producer automatically attached defaults such as completion policy and auto-acquire. The core interpreted them as fresh work mixed into a historical repair. The actual File and SQLite entrypoints failed in both dry-run and execution. The public counterexample records this.

That recovery gap also existed in the baseline, so it cannot all be attributed to the final contributor. The repair had to reach the normal producer while continuing to reject real changes to text, continuation, ownership, or validation. A correctly constructed typed request proves only that the inner boundary can handle it.

-

9. Recover the original result while protecting current authority

+

11. Recover the original result while protecting current authority

Recovery can confuse two points in time: whether the original operation was valid, and whether today's executor may continue changing state.

Suppose a team-plan committed but its response was lost. After an upgrade, the caller retries the same operation ID under stricter admission rules. Rejecting it as fresh work first can hide the original success. A closing recovery review caught that problem.

Separating original-receipt recovery from current execution authority
Separating original-receipt recovery from current execution authority Scroll on narrow screens; open the image for full size.
@@ -239,25 +338,29 @@

9. Recover the original result while protecting current autho

Types express the distinction too. Historical decoding still recognizes legacy; current fresh-execution handoff configuration accepts soft_claim and hard_lease. Reading an old record, recovering an original operation, and authorizing current execution each have independent conditions.

Atomic CLI self-claim in 2.2.0 (#7510, #7793) follows the same rule: one command atomically claims the task and acquires a hard_lease grant, returning progress and completion commands bound to the active lease_epoch, while replaying an old claim recovers only its original receipt without extending an expired generation.

An internal receipt also has a limited scope. If a remote external effect lacks a verifiable idempotent identity and readback, settling once in the control plane cannot establish that the remote effect executed exactly once. Uncertainty belongs at the boundary where it actually occurs.

-

10. CLI output budgets: protect decision semantics before compression

-

CLI language participates in an agent's decisions. This engineering constraint predates the final writer retirement and remained a validation boundary during migration.

-

The interface budget contract examines:

+

12. Designing a CLI for Agents, not just shell users

+

A human shell CLI assumes an operator with out-of-band working memory: someone who remembers passing --limit 5, visually discounts a stale cache, avoids mutating state while inspecting, and pays almost nothing per printed byte. An LLM Agent has no implicit memory across compaction boundaries, interprets output literally, retries aggressively after timeouts, and pays in both context window and prefix KV cache for every stdout byte.

+
LoopX CLI for Agents: one decision source, honest read completeness, prefix-KV budgets, and CAS plus idempotent replay
LoopX’s Agent-facing CLI turns shell invocations into a bounded, prefix-KV-preserving, CAS-fenced state-machine loop. Scroll on narrow screens; open the image for full size.
+

One decision source and runnable recovery commands

+

When check, plan, and execution commands assemble state independently, an Agent gets admitted at the start of a turn only to be rejected at settlement—triggering flag-guessing retry loops. Converging every turn entrypoint onto one shared decision snapshot (#4496) and moving primary-action selection into TypeScript (#7462, shrinking a 22,000-row backlog RPC payload from 2.35 MB to 959 bytes with 182-case byte parity) eliminated decision-to-settlement drift.

+

When an operation cannot proceed, the CLI returns copy-runnable recovery commands instead of prose tracebacks: separating an unbound turn receipt from a true version conflict and emitting exact prior-turn closeout commands (#4595, #4893, #6212), and distinguishing logical write-scope waits from directory collisions that an isolated git worktree can actually resolve (#9293).

+

Separating display truncation from task completion

+

After five incidents in 47 days (#5087) where an advisory Agent answered from stale or partial sources while health checks reported ok: true, #5085 introduced a kernel-sealed read envelope, extended to turn admission (#6679) and single-transaction task reads (#6874). Cached responses advance serving time without forging observation time, and task completeness is computed over the entire matching population before --limit slicing. Display caps set truncated: true without false alarms, whereas unreadable or omitted work forces complete: false with an explicit alert—preventing an Agent from ever mistaking top-N truncation for finished work.

+

Output budgets and prefix-KV cache economics

+

Since #2144, an interface budget contract and base/head differential verifiers (#6123, #9103) gate stdout bytes, line counts, per-task growth slopes, JSON key sets, and action digests across crowded multi-agent fixtures—for instance, stripping JSON indentation cut a 36-task output by ~18% (48,418 to 39,726 chars) with identical decoded semantics, while dropping an authority clause to pass a byte cap is forbidden. Three mechanisms extend that budget across multi-turn sessions:

    -
  • Actually printed stdout, alongside the in-memory payload.
  • -
  • Distinct character, UTF-8 byte, line, and JSON-structure costs.
  • -
  • Base and head on the same fixture, plus growth as Todos and history accumulate.
  • -
  • Required fields, action signatures, semantic anchors, and explicit detail paths.
  • +
  • Cross-turn subtree deduplication (#7196, #8100, #8523): Unchanged >=1 KiB context subtrees deduplicate across turns via SHA-256 digests, and appended task notes transmit only new UTF-8 suffixes (#8523) while keeping live revisions and execution controls inline.
  • +
  • Suffix-only receipt folding that preserves prefix KV (#9213): Sliding-window or mid-history summarization rewrites early tokens and invalidates the model's prefix KV cache across the entire suffix. Instead, LoopX anchors the prefix digest when a task starts; once the task settles cleanly, it folds only the completed suffix into a compact receipt preserving failure facts and open obligations—verifying untouched prefix bytes, intact tool-call pairing, and a net token savings floor before swapping, or keeping raw history atomically.
  • +
  • Single-read status convergence (#7755, #9392): Decision paths skip UI-only log scans (#7755) and collapse N+1 deferred-task paging into one atomic task read with pre/post revision checks against mid-read races (#9392).
-

Presentation reduction belongs after complete planning. Information omitted from display differs from information never read. Projection envelopes likewise separate observation time, service time, source coverage, and completeness. Serving a cached result again must not make its facts newer.

-

Natural language requires clause-level review: obligations, ordering, evidence provenance, authority qualifiers, scope, continuation, and stop conditions. Removing a phrase such as “only when the original proof is valid” can change behavior even when every field remains.

-

One bounded example removed JSON indentation and separator whitespace. On the same historical fixture of 36 Todos and 12 runs, output fell from 48,418 to 39,726 characters, about 18%, with the complete decoded payload unchanged. This establishes a presentation-size change. Tokens, cost, and agent outcomes need separate measurements.

-

The budget protects an interface the consumer can use. Valuable guidance may justify increasing it with matched evidence. Dropping decision conditions to make a size test green damages the interface.

+

Side-effect-free previews and CAS + idempotent replay

+

Because Agents preview guards before acting and retry after dropped connections, inspection and mutation must never blur. Read-only --dry-run previews fence off all notification hooks, rollout logs, and cache writes (#8685), while request-scoped snapshots avoid wall-clock TTL staleness (#4694, #6992, #9433). Across mutating commands—single-attempt command receipts (#4286), task handoffs (--expected-revision + --operation-id, #4094), goal acceptance (--expected-provider-revision + --operation-id, #7088), and task leases (--expected-version + --idempotency-key, where the key identifies the lease generation across renewals, #8310)—explicit CAS flags reject concurrent stale bases while resending the exact original request (including its original CAS version and parameters) replays the committed receipt without executing twice.

A recoverable file is not the model’s memory

The same recovery distinction appears in context delivery: an old receipt cannot renew a lease, and a complete baseline on disk cannot prove that the model has read and understood its constraints.

The native file-delta path in 2.2.0 separates those facts. The codec verifies complete files, versions and scope within a valid cycle and reconstructs the current structure exactly. The Agent progressively reads the current full view for the intent, requirements and evidence its decision needs. Even a delta permits direct selection of current facts without first draining the old baseline. Compaction during unfinished work requires recovering missing facts while preserving the original task and settlement identity.

This makes file reconstruction and model knowledge separately inspectable. The worked voice-task example explains JSON Pointers and the default file path. A working file/reader mechanism still needs evaluation against actual research outcomes.

-

11. Final retirement: preserve credit and account for the deletions

+

13. Final retirement: preserve credit and account for the deletions

Late-September work had already removed an unused authority prototype and the experimental Todo event overlay, dual-writer, and backfill. Old sources containing data received explicit preservation or refusal handling. This did not remove all event logging or the new authority's atomic events and receipts.

October work further isolated ordinary Markdown writers and validated real subsequent writes without the old modules. Concentrated deletion became possible after consumer routes and replacement paths were connected.

Duang777 led #6396. Song and maintainer-side agents continued recovery, producer, and integration work along the original branch, preserving contribution history. This three-developer-and-agent relay was the closing phase of the two-month program.

@@ -297,9 +400,9 @@

11. Final retirement: preserve credit and account for the de

Many removed lines were old tests. Deleted test lines do not establish product capability; the important question is whether current entrypoints and independent counterexamples still protect the intended invariants. These counts describe the closing scope. They do not validate the whole migration.

-

12. Core control-plane statistics across the full period

+

14. Core control-plane statistics: 62-day cutover and 103-day convergence

The reproducible scope here is loopx/control_plane/**. App, benchmark, documentation, and test-suite directories outside it do not enter the core code counts. Internal testing/support tools inside this directory remain included.

-

The baseline is d1fe059, immediately before the formal TS RFC. The endpoint is the October 16 snapshot 488e443. The formal RFC to that endpoint spans roughly 62 days, covering 63 calendar dates; 62 of those dates contain a core mainline commit. The source comparison fixes both versions.

+

The initial 2.0 cutover baseline is d1fe059, immediately before the formal TS RFC, and its first endpoint is the October 16 snapshot 488e443 (~62 days, covering 63 calendar dates; 62 of those dates contain a core mainline commit; 62-day source comparison). The tables and charts directly below preserve that frozen October 16 snapshot unchanged, followed by the reproducible 103-day convergence snapshot through November 27 (953377fd7b).

Engineering activity over the whole period

@@ -449,7 +552,105 @@

How the work continued over time

Reproduce the inventory

Public-safe PR records, core mainline commits, and metric JSON accompany the draft. The PR cohort joins mainline commits touching the directory to GitHub merge metadata, counting each PR once. Two mainline commits have no verifiable merged-PR association; their commits and churn remain included.

The research enumerated public PRs, then checked against mainline Git history. Direct reads supplemented 14 PR metadata records missed by search indexing. Source snapshots and processing scripts remain in the research materials. This inventory does not estimate tokens, model cost, CI compute, engineer-hours, or benchmark gains.

-

13. Community contributions and the next step

+

103-day convergence snapshot (August 15 – November 27, 2026)

+

Re-running the exact method_version: 1 Git stock and first-parent --no-renames churn formulas from d1fe05932a through 953377fd7b (103-day source comparison) captures the post-cutover unified turn loop, task-semantics, Agent-CLI, zero-Any, and cloud storage SPI waves using strictly Git-reproducible counts (the committed core-pr-cohort.csv and core-statistics.json artifacts remain frozen at the October 16 API snapshot):

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MetricBaseline (d1fe05932a, Aug 15)2.0 Snapshot (488e4438e0, Oct 16)Post-2.0 Delta (Oct 16–Nov 27)Current Snapshot (953377fd7b, Nov 27)
Elapsed span (active / calendar dates)0 days62 days (62 / 63)+41.6 days (+42 active)103 days (104 / 105)
Whole-repo 1st-parent mainline commits (at Nov 27)———9,024 (7,741 with #N in subject)
Whole-repo 1st-parent commits since Aug 1503,003+2,6135,616
loopx/control_plane/ 1st-parent landings (since Aug 15)01,144+1,0512,195 (2,759 all-time)
loopx/control_plane/ unique #N PRs in Git subjects (since Aug 15)01,058 (86 unnumbered; 1,121 in Oct 16 API CSV)+962 (90 unnumbered; 0 overlap)2,020 (176 unnumbered; 2,575 all-time)
loopx/control_plane/ Python stock256 files; 80,473 LOC471 files; 142,371 LOC+68 files; +27,261 LOC539 files; 169,632 LOC
loopx/control_plane/ TypeScript stock0 files; 0 LOC323 files; 87,268 LOC+107 files; +37,537 LOC430 files; 124,805 LOC
loopx/control_plane/ Markdown + JSON contracts0 files; 0 LOC7 files; 929 LOC+5 files; +321 LOC12 files; 1,250 LOC
loopx/control_plane/ Python + TS combined256 files; 80,473 LOC794 files; 229,639 LOC+175 files; +64,798 LOC969 files; 294,437 LOC
TypeScript share of Py+TS in loopx/control_plane/0.00%38.00%+4.39 pp42.39% (42.89% pre-#9223)
Cumulative TS churn (--no-renames, Aug 15–end)—+104,769 / −17,501+54,747 / −17,210+159,516 / −34,711 (net +124,805)
Cumulative Python churn (--no-renames, Aug 15–end)—+120,899 / −59,001+68,061 / −40,800+188,960 / −99,801 (net +89,159)
+

Immediately before #9223 extracted server-side PostgreSQL storage and the remote authority service behind the cloud SPI, core TypeScript stock stood at 435 files / 127,466 LOC (42.89%). Both endpoint-net and source-stock accounting identities hold identically across the 103-day span.

+

15. Community contributions and the next step

Multiple contributors advanced this program. Representative work is listed by its concrete boundary so readers can follow the history.

diff --git a/apps/presentation/site/public/blog/zh/index.html b/apps/presentation/site/public/blog/zh/index.html index 6110174755..caf7a90738 100644 --- a/apps/presentation/site/public/blog/zh/index.html +++ b/apps/presentation/site/public/blog/zh/index.html @@ -43,8 +43,8 @@

EdgeBench / LHTB:一轮历史试跑的工程复盘

songoow 对历史 EdgeBench/LHTB 实验配置的探索性工程记录,包含提前中断、局部修复与待验证假设。feedback-first 开关已撤回;不代表 LoopX 官方或正式评测结论及当前版本能力。

阅读全文
-

LoopX 2.0 · 工程复盘

-

LoopX 2.0:两个月的 TypeScript 控制面重构

从最初的渐进迁移方案,到完整事务、共享权威、语义约束和旧路径退役。记录方案怎样被真实调用与反例修正。

阅读全文
+

LoopX 控制面 · 工程复盘

· 11 月更新

+

LoopX 的 TypeScript 语义控制面:分布式事务、长程任务原语与面向 Agent 的 CLI

LoopX 本质是个通用长程任务语义引擎:将完整状态事务、共享 AuthorityStore、零 Any 语义词表、可组合的条件续跑 / 持续监控 / 证据驱动重规划 / 对等交接原语,以及面向长程 Agent 的原生 CLI 收敛进同一套内核。

阅读全文

Agentic Software · 开发范式

diff --git a/apps/presentation/site/public/blog/zh/typescript-control-plane-refactor/index.html b/apps/presentation/site/public/blog/zh/typescript-control-plane-refactor/index.html index 44e576f25c..0151c524e4 100644 --- a/apps/presentation/site/public/blog/zh/typescript-control-plane-refactor/index.html +++ b/apps/presentation/site/public/blog/zh/typescript-control-plane-refactor/index.html @@ -2,19 +2,19 @@ -LoopX 2.0:两个月的 TypeScript 控制面重构 · LoopX - +LoopX 的 TypeScript 语义控制面:分布式事务、长程任务原语与面向 Agent 的 CLI · LoopX + - + -
← 全部文章

LoopX 2.0 · Engineering

LoopX 2.0:两个月的 TypeScript 控制面重构

副作用做完却没记账,旧执行者拿着成功回执回来,修正证据意外重启任务——两个月的重构,逐步把这些问题收敛到完整事务和统一语义。

-
-

重试一次操作,可能把副作用做两遍;读回一张成功回执,也可能恢复了早已过期的执行权。LoopX 的 TypeScript 重构,要修的正是这些跨越执行、存储与恢复的语义问题。

+
← 全部文章

LoopX 控制面 · 工程复盘

LoopX 的 TypeScript 语义控制面:分布式事务、长程任务原语与面向 Agent 的 CLI

LoopX 本质是个通用长程任务语义引擎——不是提示词封装、静态有向图或通用微服务队列。当副作用在检查点落盘前崩溃、恢复运行的 Agent 越过原任务租约、或被截断的 CLI 输出在字面上等同于“任务清零”时,条件续跑、持续观测、证据驱动重规划、对等交接与面向 Agent 的 CLI 必须在同一套 TypeScript 状态机内可组合、可验证。

+
+

重试一次操作,可能把副作用做两遍;读回一张成功回执,也可能复活早已过期的执行权。在跨越数小时乃至数天的运行中,一个通用长程任务语义引擎必须让条件唤醒续跑、后台持续观测、证据驱动重规划、对等协作移交、保护前缀 KV 的 CLI 交互,以及横跨本地 SQLite 与云端 PostgreSQL 的事务状态,对长程 Agent 与 Agent 团队同时可组合且可验证。

1. 强模型参与的,是这些跨边界的语义问题

我们把强能力模型用在设计、实现和评审里,尤其是跨文件、跨 runtime 的假设检查。真正难的部分往往是:几个局部判断都对,组合起来却允许错误的执行顺序。8、9 月的核心 PR 已经反复遇到这类问题;它们不是迁移收尾后的补丁。

副作用已经发生,记录还没写下:重试会不会做两遍?

@@ -34,13 +34,13 @@

修正一条证据,为什么会重新触发已经结束的工作?

怎样约束模型给出的“看起来正确”

让模型先指出错误假设,再构造会推翻它的执行序列:提交后断连、旧 lease 重放、只更新证据、显式清空。随后检查真实 owner、provider 和调用入口。

强模型帮助把散在各处的条件连起来;反例、真实存储与拒绝路径约束它的答案。目前没有逐 PR 的模型型号对照,不能据此量化某个模型的独立收益。我们能展示的是这些机制怎样改变,以及为什么需要改变。后来的 #7145 运行时路由、#7269 原 Turn 收尾是这条主线的延续,不代替前中期的核心工作。

-

2. 先还原历史:迁移方案本身也在变化

-

正式迁移 RFC 在 8 月 15 日合入。到 10 月中旬集中清理普通旧 writer,这项工程已经跨了差不多两个月。它有多条并行线:事务规则迁移、调用方收敛、共享权威、存储与历史成本、Semantics,以及后续兼容与退役。

-

最后 3 位开发者与各自 Agent 接力的 #6396,是这些工作累积后的一次集中收尾。前面的选择和转折,决定了最后能删什么,以及删掉以后还能恢复什么。

-

其中,新 maintainer Song(@songoow) 从 9 月中旬持续推进 Semantics RFC、词表收敛、生产证据和检查器修复。这部分也值得与事务、存储放在一起讲。

-

LoopX 保存长程 Agent 的目标、任务、证据与执行边界。模型可以提出新路线,控制面要保护版本、执行权和状态提交,并在中断后找到正确的恢复位置。

-

最初的大量实现是 Python,TS 的宿主、Pi 集成与 dashboard 已经存在。通过一次 Python 调用来做决策,再把结果接回 TS,是自然的起点。随着规则增多,默认值、状态解释、调用顺序和持久化也可能分散在两边。

-

我们希望这些控制面规则有清楚的 typed owner,同时让 CLI、宿主和 App 共享合同。实际过程可以分成以下几个互相重叠的阶段。

+

2. 先还原历史:从迁移方案到通用长程任务语义引擎

+

正式迁移 RFC 于 8 月 15 日合入(#3226)。前两个月至 10 月中旬,工程将核心状态事务迁入 TypeScript,并在 #6396 集中退役普通旧 Markdown 写入路径;此后至 11 月底,第二轮收敛在这套事务底座之上建立起可组合的条件续跑、持续监控与重规划原语、对等协作交接、闭集语义棘轮,以及面向 Agent 的原生 CLI。

+

3 位开发者与各自 Agent 接力的 #6396 结束了双写过渡期,使后续的长程任务原语与 CLI 状态机得以建立在单一权威信源之上。

+

其中,新 maintainer Song(@songoow) 从 9 月中旬持续推进 Semantics RFC、词表收敛、生产证据和检查器修复。这条主线与事务、长程任务原语及 CLI 设计紧咬在一起。

+

LoopX 本质是个领域无关的通用长程任务语义引擎,服务于长程 Agent 与 Agent 团队。模型可以提出新路线,引擎负责约束版本、执行租约、可组合任务状态迁移与持久化提交,并在中断后定位合法的恢复位点。

+

最初的大量实现是 Python,TS 的宿主、Pi 集成与 dashboard 已经存在。通过一次 Python 调用来做决策,再把结果接回 TS,是自然的起点。随着规则增多,默认值、状态解释、调用顺序和持久化开始分散在两边。

+

我们希望这些控制面规则有清楚的 typed owner,同时让 CLI、宿主和 App 共享同一套合同。103 天的实际演进可拆为以下交错推进的阶段。

@@ -71,8 +71,8 @@

2. 先还原历史:迁移方案本身也在变化

- - + + @@ -86,11 +86,21 @@

2. 先还原历史:迁移方案本身也在变化

- - + + + + + + + + + + + +
9 月中旬起Song 推进 Semantics;存储线处理 checkpoint、delta、写入与 replay 成本#4433、#4408Song 推进 Semantics;存储线处理 checkpoint、delta、写入与 replay 成本;引入密封投影信封#4433、#4408、#5085
9 月下旬
10 月中旬集中退役普通旧写入路径,继续修恢复、producer 与集成反例#6396集中退役普通旧写入路径,随后收敛单事务任务读取与渐进式上下文#6396、#6874、#7196
10 月下旬–11 月中旬统一单轮决策与结算信源;分目标独立唤醒监控、对等协作部分返回与 PostgreSQL 2 万+提交快照#7462、#8139、#8211、#8231、#8759
11 月中下旬默认切换至统一轮次闭环;保护前缀 KV 缓存的后缀折叠;3 小时租约与跨租约续跑;零 Any 棘轮;确立 Apache-2.0 云端存储 SPI#9176、#9213、#9223、#9433、#9488
-
迁移历史:事务、权威与存储、Semantics 三条线交错推进
迁移历史:事务、权威与存储、Semantics 三条线交错推进 窄屏可横向滚动;点击查看原图。
+
事务与任务闭环、共享权威与存储、Semantics 与 Agent CLI 三条主线收敛
事务与任务闭环、共享权威与存储、Semantics 与 Agent CLI 三条主线收敛。窄屏可横向滚动;点击查看原图。

8 月原始提案考虑过 read-first 和分阶段 dual-read/dual-write。后来接受的方案改为 Effect Program 先行,再按完整事务替换、删除旧规则,生产路径只有一个语义 owner。最初提案中的阶段设想,不能直接当成 2.0 的运行时设计。

这种变化很正常。重要的是把为什么改路线、已经切到哪里、哪些仍是 reference 或候选写清楚。当前维护中的 TS RFC 记录了这些检查点。

3. Effect Program 先行:先统一“做过什么”

@@ -131,7 +141,7 @@

4. 迁移完整事务:一次少到两次,也可能是正

评审曾发现一个有诱惑力的错误优化:只保留最后一次 reduction。这样调用更少,但畸形身份或 journal 可能直到外部 provider 执行之后才被拒绝。最终保留 preflight,由 TS 先授权准确的待执行 effect,Python 只执行这些 effect,再返回最终归约。

这个负例让我更看重“检查放在什么位置”。一个正确判断,如果发生在不可逆 effect 之后,也可能保护不了用户。

后续 task lease、Vision、monitor-poll、spend/void 等切片也沿完整事务推进。迁移账本需要记录:旧规则删了什么;新 bridge 加了什么;happy/recovery path 跨几次运行时;哪些脚手架可以退役;完整入口的正确性和延迟怎样。代码净增可以有理由,但要说清楚多出的代码承担什么。

-

5. 共享权威:领域规则和存储原语分别归属

+

5. 共享权威:把分布式存储原语接到 Agent 执行语义

事务迁移时,共享权威也在发展。从 wchwawa 推进的协调核心、aggregate/provider 与可恢复 reference,到 #3798 的 TS AuthorityStore,逐渐收敛出一个 provider-neutral 的持久化合同。

这里的关键是把两类问题分开:

    @@ -170,6 +180,13 @@

    5. 共享权威:领域规则和存储原语分别归属

例如 PostgreSQL 在 COMMIT 后断连,结果可能已经持久化。provider 必须区分 missing、unavailable、failed 与 ambiguous durability。不能因为客户端没有收到成功,就当成没有提交。后续按原操作身份查 receipt,才有机会安全恢复。PostgreSQL candidate 的边界 也明确保留了部署与采用资格。

早期 Python executor 有 reference/coverage 作用,后来未使用的 prototype 被删除;实际 native File/SQLite 路径成为对应资格验证对象。保留过渡实现有期限,不能让 reference 悄悄变成第二套生产权威。

+

当存储提交遇上跨小时的 Agent 执行

+

将纯存储提交原语与领域状态机分离,使同一套持久化合同接住了多小时跨会话运行中的三类边界问题:

+

6. SQLite 之后:长程历史也要有成本模型

LIHUA919 的 #4121 把可选 SQLite provider 接到既有 TS authority 合同。一次事务原子提交 head、receipts、events 和 outbox;claim/lease 的领域语义仍从原 owner 来。

接入数据库以后,还有三个不同的工程问题。

@@ -178,8 +195,8 @@

6. SQLite 之后:长程历史也要有成本模型

第三,replay 的对象所有权会影响正确性。 #4931 减少未改变子树的复制、排序、编码,以及 receipt lookup 中无用的完整 projection 构造。同时保证返回给调用方的对象被修改后,不会污染下一次 replay 的内部基础状态;持久证明字节也保持不变。

这轮优化在一些路径上有明显收益,但大状态、扫描延迟和内存成本仍有缺口,PR 保留了未达到的目标。把这些差异留下,比给所有路径写一个统一“性能提升”更有用。

10 月的 #5805 又更新了未配置的新建 Goal 默认值,选择 canonical SQLite 与 hard lease。已有 Goal、显式选择和旧 operation retry 继续遵守各自合同。新建默认值、旧数据迁移、旧 writer 退役,是三件发生在不同阶段的事。

-

到 11 月初的 #7834,sqlite_v0 进一步接管了已完成与已替代 Todo 的归档权威(todo_archive 表):在 todo complete 与 todo supersede 提交事务内自动将超出有界窗口(最近 N = 5 条终态项)的历史项迁入 SQLite 归档,使活跃 ACTIVE_GOAL_STATE.md 投影体积与完整历史解耦,同时保留按 ID 精确回读与恢复回执的能力。

-

7. Song 的 Semantics:定义、生产、解释要接起来

+

到 11 月初的 #7834,SQLite 存储进一步接管了终态任务的归档权威:当任务完成或被单事务替代(#5698)时,超出活跃窗口(最近 N = 5 条终态项)的历史记录在同一次事务内迁入归档表,使实时状态视图体积与总历史解耦,同时保留按 ID 精确回读与回执重放。

+

7. Song 的 Semantics 与零 Any 内核收敛

新 maintainer Song(@songoow) 从 9 月 15 日的 #4433 发起并实现 Semantics RFC、registry 和提交路径检查,之后持续推进收敛。这条线让我们开始系统约束“概念怎样增长”。

跨语言迁移很容易产生重复知识:同名状态在 Python Enum、Literal、TS as const、展示层和判断分支中各出现一次。即使今天字符串一样,明天也可能有一处多加了值或换了解释。

Semantics RFC 将检查拆为可追溯关系:定义 owner、值域、生成绑定、producer、interpreter/projection。运行时从类型化 owner 取规则,登记表做约束与检查,不成为线上规则的另一个来源。

@@ -191,8 +208,90 @@

检查器也需要能推翻自己的反例

#4687 保留了评审中有价值的反例,修复三种“自信地答错”:全局重绑定被漏掉,字典 spread 后修改仍被当成旧初始化值,遮蔽的 String 被误认成内建转换。

这里误报与漏报的代价不同。保守扩大候选值可能多报一个问题;漏掉真实生产值,会让未登记输出通过检查。没有把握的动态形式应留下 unknown。

检查还要有扫描覆盖下限,不能靠少扫文件过线。后来删除持续膨胀的已提交 inventory,改成按需计算全树清单,也没有取消这个义务。当前支持形式之外仍有缺口,跟踪 issue 继续保留。

-

这项工作让我很认同一个实践:自动生成和自动检查,可以减少同步错误;它们自己的前提、覆盖和错误方向,也需要被审查。

-

8. 调用方和默认值,决定迁移能否到用户手上

+

从登记词表到零 AST Any 棘轮

+

两套提交期 AST 验证器将 Song 奠定的词表设计(#4433、#4494、#4687)从人工评审准则推进为跨 Python 与 TypeScript 的预合并等式棘轮:

+ +
为什么消灭 dict[str, Any] 直接抓出了真实的并发与重放缺陷

用显式记录类型替换无类型字典载体时,类型收紧本身反复暴露出潜伏的状态污染:早期 #4178 退役“序列化再解析”更新路径后,修掉了局部编辑误重触发已完结监控的缺陷;后期将状态刷新拆分为类型化记录(#9418)当场抓出路由切换后陈旧注册表快照在重放中残留的缺陷,而重构无类型钩子分发器(#9433)更在同一 PR 内直接定位并修复了 7 处请求级缓存失效、软链 ABA 竞态与回滚漏清缺陷。

+ +

8. 长程任务语义:超越静态 DAG 的正交原语乘积组合

+

传统工作流 DAG 把执行压扁成单一节点状态(running → done)。通用长程任务语义引擎无法这样做,因为在跨小时乃至跨天运行中,四类提交事实在语义上绝不可坍缩:Todo 完成 ≠ Turn 结算 ≠ Peer 送达 ≠ Goal 验收。一次在途进展写回会结清当轮 Turn,但 Todo 依然保持打开;一次无变化的后台观测以零配额消耗收口;一条已送达的对等消息只要仍声明 remaining work > 0 就不能结清收件箱请求;而 Agent 自报 "done" 也绝不构成目标完结,直到外部 acceptance oracle 核验通过累积的成果要求。

+

从 Effect Interpreter 形式化基础(#2905,GoalState => F[Decision])出发,LoopX 并未把 F 写成一张扁平的全局大枚举,而是建模为正交状态机的乘积组合(×)——Todo / Lineage × Claim / Lease × Scoped User Gate × Resume / Monitor × Vision / Replan × Quota / Scheduler Cadence——在同一套 TypeScript 事务内核(#6874、#7298、#8211、#9176)中单次提交闭环,既不退化为全局布尔大锁,也消除了局部覆盖带来的跨轮次死锁。

+
正交任务原语在同一套 TypeScript 语义内核上乘积组合
六组正交任务原语作为乘积状态机在同一套 TypeScript Effect & Task Semantics Kernel(GoalState => F[Decision])上组合运行,底层连接 AuthorityStore 与只追加执行账本。窄屏可横向滚动;点击查看原图。
+

User Gate × Todo Fallback × Quota / Cadence

+

朴素的 Agent 框架把人工审批当成全局布尔停车牌——要么一个局部提问冻死整场多小时运行,要么把待决门禁静默吞掉。LoopX 为每道人工门禁绑定类型化 decision scope(#4292),让 user channel 与 agent channel 有意正交分流:user channel 以零算力配额消耗向负责人呈现具体决策问题(伴随人工门禁退避节拍),而 agent channel 在证明作用域正交后,并行推进安全的 scoped fallback 任务或已结清的监控投影(#5277、#6327)。待负责人批复后,状态迁移仅核销该门禁覆盖的 decision scope(#8844);同时因果 reset token 驱动覆盖活跃执行、同伴交接等待、持续监控、门禁退避与派生停机的 8 档自适应节拍器(#3058、#9459)在状态或截止窗口收紧时立即跳回活跃节拍(#6787)。

+

Blocker / Handoff Clearance × Atomic Supersede × Successor Replan

+

长程计划在运行中途动态演进,而非死守预先编译的静态 DAG。在统一重规划历史归约器(#4902)之上,单事务 supersede 在一次提交内关联替代任务、退役前驱、跨归档保留决策与续跑谱系并释放旧租约(#4184、#5698)。关键在于,一旦前置门禁或同伴交接解除阻塞,却既无显式后继也未声明 no-follow-up,内核拒绝盲目跳步或提前停机,而是强制路由至 successor replan 派生下一步动作(#5831、#8896);回滚同样只追加补偿事件并派生后继,绝不抹除历史。

+

Monitor × Scoped Resume × Vision / Self-Referential Replan

+

挂起任务通过单次原子完整依赖图读取恢复(#6874),并按目标维护上限 <=128 的 SHA-256 独立唤醒代际——超限时明确拒收而非驱逐既有等待基线(#8231)。纯观测归约严格区分计数推进、省略与显式清空(#4178、#4335、#9249),独立无模型后台 monitor 通道则在常规轮询零配额消耗下,与前台对话队列、实时 LLM healthcheck 抖动及并发重规划彻底隔离(#5450、#9155、#9320、#9474)。在局部等待之上,目标级 Vision 与非标量 Yardstick 逆转信号(#7298、#8385、#9165)严格优先于静默状态求值——拒绝无实质增量的空确认(#5633、#5646),将触发原因固化在轮次回执上以防重规划轮内退役失效监控引发自指死锁(#8854),对齐整秒与微秒确认时钟(#8804),剥离升级残留伴随字段(#9411),并在派生停机前优先结清当轮回执(#8588)。

+

Turn Settlement × Lease Epoch × Live Goal Amendment & Acceptance Oracle

+

终态收口绑定外部 acceptance oracle 与跨轮次视图共享的累积成果要求(#6473、#6784、#9328),而运行中途的用户纠偏与实时群聊引导直接对齐至 Goal 方向,不误伤活跃执行租约(#6357、#8270)。当跨小时执行越过 3 小时租约 TTL 时,惰性重绑避免过早报错(#9183),并按后继执行权精确分流:已被异主接管则执行零扣费管理态收尾(#9304),同一 Agent 在更高代际重领则通过核验最新任务与验收摘要的 fenced lease takeover 无损续跑(#4094、#9488)。

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
正交原语乘积(×)收敛前的跨状态机故障TypeScript 内核不变量代表 PR
User Gate × Scoped Fallback × Quota全局布尔锁因局部提问冻死整场长程运行,或一次审批误清其他待决门禁零消耗 user channel 提问与正交 scoped fallback 并行分流;批准仅核销覆盖的 decision scope#4292、#5277、#6327、#8844
Quota Gate × 8 档节拍 × Reset Token空转轮询白烧模型配额,或指数退避睡过收紧的截止窗口与新人工批复仅在有效写回通过校验后扣费;8 档退避遇因果 reset token 变化立即归零回活跃节拍#3058、#6787、#9459
阻塞清障 × Supersede × Successor Replan静态前置 DAG 半途失效;阻塞解除但无预设下一步时提前停机;回滚抹掉历史单事务 supersede 并释租;清障无后继且未标 no-follow-up 强制 successor replan;补偿只追加#4184、#4902、#5698、#5831、#8896
后台 Monitor × 分目标 Resume × 存储层全局计数误唤醒无关等待者;局部编辑重触发监控;LLM healthcheck 误杀纯观测轮询单事务就绪求值与分目标代际(<=128);省略与清空分离;免模型探活后台通道与重规划串行隔离#4178、#4335、#5450、#6874、#8231、#9155、#9249、#9320、#9474
目标优先 Vision × Yardstick × 自指 Replan局部静默掩盖偏航;单一标量掩盖退化;轮内退役监控抹掉触发源;提前停机卡死回执Vision 与 Yardstick 逆转信号优先于静默并拒空确认;回执固化触发源;停机前先结清当轮回执#5633、#5646、#7298、#8385、#8588、#8804、#8854、#9165、#9411
Turn 结算 × 租约代际 × Acceptance Oracle自报完成提前关单;实时对话纠偏打断活跃租约;越过 3h 租约要么脏写要么丢弃在途成果外部 acceptance oracle 与不伤租约的实时纠偏;异主零扣费收尾与同主摘要围栏 fenced lease takeover#4094、#6357、#6473、#6784、#8270、#9183、#9304、#9328、#9488
+ +

9. 对等协作:为什么“已返回”不等于“已完结”

+

当一个 Agent 把子任务委派给对等同伴时,消息送达只是传输层事件——既不证明子任务已经完结,也不证明委托方已经采纳该结果。在版本受控的认领与交接基础(#3529、#3669、#4032、#4094)之上,LoopX 将传输送达、收件箱答复完结、逐条结果消费与目标验收严格拆开:

+
+

对等返回与成果托管合同 · 传输送达 ≠ 答复完结 ≠ 委托方采纳

+
+
1. 传输层投递加锁的四阶段发送状态机确认消息进入收件箱,并由前驱顺序门禁阻止后续更新抢跑未确认的前序发送。传输状态:已送达(仅限传输层)
+
2. 答复完结、单条消费与目标验收只要最新结论仍声明存在未完余量,原请求在收件箱中就保持未结清,唯有对等方发布无剩余事项的完整结论才满足答复义务;委托方绑定轮次的消费记录仅确认单条进展不再重复提醒,目标级验收亦独立判定。语义状态:待完整结论结清
+
+

成果托管移交(#4094、#9308):在成员表版本围栏下移交当前负责人时,原始声明归属与历史审查归因保持不可变。

+
+ + +

10. 调用方和默认值,决定迁移能否到用户手上

完整事务还要求调用方准确表达意图。前述 #4178 中,空白 note 表示不修改;显式空列表和 false 则是按对应字段解释的输入。不能把它们统一过滤为“没传”,也不能一律解释成“清空”。dry-run 要准确模拟,不能因为选定 provider 不可用就回退别处。随后 #4279 也收敛了读取分类与投影交付语义;部分 Python read owner 被有意保留。一个 owner 是否清楚,比为了语言纯度再造一份解释更重要。

新建默认值是另一个例子。当前 priority 回归保护以下区别:

@@ -230,7 +329,7 @@

8. 调用方和默认值,决定迁移能否到用户手上<

这些区别由 File/SQLite 回归 保护。把“新建默认值”放在原回执恢复之后,才能避免升级替历史做决定。

最后一轮评审还发现:TS 核心的 metadata-only completion repair 可以通过直接测试,普通 Python producer 却会自动带上 completion policy 和 auto-acquire 等默认参数,被核心视为混入了新工作,导致 File/SQLite、dry-run/执行的实际入口都失败。公开反例 记录了这一点。

这个恢复缺口在基线也存在,不能全部归因给最后的贡献者。修复要走到普通调用方,同时继续拒绝真正的新正文、continuation、所有权或验证修改。直接构造正确 typed request,仅证明内层会处理它。

-

9. 恢复原结果,同时保护当前执行权

+

11. 恢复原结果,同时保护当前执行权

恢复最容易混淆两个时间点:原操作当时合法,现在的执行者是否还能继续改状态。

设想一次 team-plan 已经提交,响应丢了。升级后,调用者拿原 operation ID 重试,新准入规则却变严了。若先按新操作拒绝,就会把原成功结果挡住。最后的 恢复评审 抓到了这个问题。

原回执恢复与当前执行权的分离
原回执恢复与当前执行权的分离 窄屏可横向滚动;点击查看原图。
@@ -239,25 +338,29 @@

9. 恢复原结果,同时保护当前执行权

类型也表达这种区别:历史解码仍认识 legacy,当前新执行的 handoff 配置只接受 soft_claim 与 hard_lease。旧记录可读、原操作可恢复、当前执行获准,各自有独立条件。

2.2.0 的 CLI 原子自认领(#7510、#7793)同样遵循这一边界:单条命令在 hard_lease 下原子完成认领与租约授予,并直接返回绑定当前 lease_epoch 的后续进度写回与完成结算命令;重放旧认领只恢复原回执,不隐式顺延已过期的执行代际。

内部回执保护的范围也有限。一次外部远端 effect 若没有可核验的幂等身份与回读,不能只凭控制面只结算一次,就宣称远端恰好执行一次。unknown 应在它实际发生的边界上保留。

-

10. CLI 输出约束:压缩前先保护决策语义

-

对 Agent 来说,CLI 的文字会参与决策。这项工程约束早于最后的 writer 退役,在迁移中继续作为验证边界。

-

接口预算合同 关注:

+

12. 为 Agent 设计 CLI,而不只是给人类敲命令

+

面向人类的终端 CLI 默认操作者拥有带外记忆:人类记得自己刚传过 --limit 5,能肉眼识别陈旧缓存,查看状态时不会顺手改写数据,且多打印几千字节几乎没有边际成本。而大模型 Agent 在压缩边界后没有隐式记忆,严格按字面解释输出,超时后极易重试,且每一字节 stdout 都同时消耗上下文窗口与前缀 KV 缓存。

+
LoopX 面向 Agent 的 CLI:单一决策信源、诚实读取完整度、前缀 KV 预算与 CAS 加操作 ID 幂等重放
LoopX 面向 Agent 的 CLI 将命令行调用收敛为受输出预算约束、保护前缀 KV 缓存、带 CAS 与幂等回执围栏的状态机闭环。窄屏可横向滚动;点击查看原图。
+

单一决策信源与可直接复制执行的恢复命令

+

当准入检查、计划预览与单步执行各自拼装状态时,Agent 常在轮次开头获准运行、却在结尾结算时被拒,进而陷入盲猜命令行参数的死循环。将所有轮次入口收敛到同一份决策快照(#4496),并把主动作指令选择迁入 TypeScript(#7462,将 2.2 万行积压任务下的跨进程 RPC 载荷从 2.35 MB 压降至 959 字节,通过 182 组字节级等价校验),从源头消除了准入与结算的脑裂。

+

当操作受阻时,CLI 直接返回可复制执行的恢复命令,而非抛自然语言异常栈:将“尚未绑定任务的轮次回执”与真正的版本冲突拆开并给出前序欠账收尾命令(#4595、#4893、#6212),同时明确区分必须等待释放的逻辑写域冲突与可通过新建独立 git worktree 解决的目录占用冲突(#9293)。

+

区分展示截断与“任务已做完”

+

复盘 47 天内 5 次“健康信号全绿、顾问 Agent 却基于过期或残缺信源作答”的事故(#5087)后,#5085 引入了由内核统一密封的读取信封,并延伸至轮次准入(#6679)与单事务任务读取(#6874)。命中缓存只更新响应时间而不伪造采样时间,且任务覆盖率在执行 --limit 截断之前的全量匹配集合上计算:正常展示行数上限仅标记 truncated: true 而不误报,信源未读或漏项则强制置 complete: false 并拉响告警——彻底杜绝模型把“只展示了前 N 条”误判为“所有任务已完成”。

+

输出预算门禁与前缀 KV 缓存经济学

+

自 #2144 起,接口预算合同与 base/head 差分验证器(#6123、#9103)在多任务拥挤夹具上持续门禁 stdout 字节数、行数、单任务增长斜率、JSON 键集与动作摘要——例如去掉 JSON 缩进使 36 任务夹具输出缩减约 18%(48,418 降至 39,726 字符)且语义完全一致,而靠删减权限限定句来迎合体积上限则被明确禁止。三项机制将这一预算保护延伸至长会话多轮运行:

    -
  • 实际打印的 stdout,而不只是内存里的 payload;
  • -
  • 字符、UTF-8 字节、行数和 JSON 结构的不同成本;
  • -
  • 同一 fixture 的 base/head,以及 Todo、history 增长时的斜率;
  • -
  • 必需字段、action signature、语义锚点和明确的 detail 路径。
  • +
  • 跨轮次子树摘要去重(#7196、#8100、#8523):未变化的 >=1 KiB 上下文子树通过 SHA-256 摘要跨轮去重,任务备注追加只传输新增 UTF-8 后缀(#8523),同时每轮强制内联最新版本号与控制指令。
  • +
  • 保护前缀 KV 缓存的后缀回执折叠(#9213):滑动窗口或中段摘要会改写早期 token,直接击穿整段后缀的前缀 KV 缓存。LoopX 改为在任务启动时锚定前缀摘要;待该任务干净完结后,仅将已完成的尾部区间原子折叠为保留失败事实与未结义务的紧凑回执——交换前严格核验前缀字节未变、工具调用配对完整且净省 token 达标,任一条件不满足则原子保留原始历史。
  • +
  • 状态读取收敛为单次事务(#7755、#9392):决策路径跳过仅用于界面的全量日志扫描(#7755),并将随挂起任务数线性增长的 N+1 分页收敛为单次任务读取,辅以读前读后版本复验封堵并发改写窗口(#9392)。
-

展示压缩应在完整规划之后发生。少展示了什么,要与根本没读到什么区分开。projection envelope 也分别表达观测时间、服务时间、来源覆盖和完整性;缓存重新返回,不能给旧事实刷新时间戳。

-

自然语言还需要逐条看:义务、顺序、证据来源、权限限定、适用范围、继续和停止条件。删除一句“仅在原证明成立时”可能比改一个字段更影响行为。

-

一个有界实例是去掉 JSON 缩进与分隔空白。在同一历史 fixture 的 36 个 Todo、12 条 run 上,输出从 48,418 降到 39,726 字符,完整 payload 解码保持一致,字符数减少约 18%。它证明展示体积变化;token、费用和 Agent 效果需要另测。

-

预算保护的是消费者能用的接口。新增指导确实有用,可以带同条件证据提高预算;为了变绿而删掉决定所需的条件,反而损坏接口。

+

纯只读预检与 CAS 幂等重放

+

由于 Agent 频繁在动作前执行预检并在超时断连后重试,读取与写入绝不能混杂。--dry-run 预检将启动通知钩子、运行日志与缓存写入全部隔离在外(#8685),请求级快照则避免了基于挂钟 TTL 的过期脏读(#4694、#6992、#9433)。在所有写命令上——单次尝试命令回执(#4286)、任务交接(--expected-revision + --operation-id,#4094)、目标验收(--expected-provider-revision + --operation-id,#7088)与任务租约(--expected-version + --idempotency-key,其中幂等键标识整轮租约代际并在续租间沿用,#8310)——显式期望版本 CAS 参数拦截并发陈旧基线,而按原始 CAS 版本与请求参数完整重送原请求则精确重放原回执,绝不重复执行。

可恢复的文件,也不能当成模型的记忆

前面的恢复问题还在上下文交付中出现:一张旧回执不能续租,一份保存在磁盘上的完整基线也不能证明模型已经读懂其中的约束。

2.2.0 的原生文件差分把这两层分开:编码器核验同一有效周期内的完整文件、版本与 scope,准确还原当前结构;Agent 则从当前完整视图,渐进式读取本次判断需要的目标、要求与证据。即使收到 delta,也能直接选读当前事实,不必先读完整旧基线。压缩发生在未结束的工作中时,补回缺失事实,同时保留原任务与结算身份。

这项边界让“文件可还原”和“模型掌握了什么”各自可检查。具体的语音任务、JSON Pointer 与默认文件路径,见渐进与差分交付的完整例子。文件与读取路径成立,仍需继续检验它们是否改善了真实研究。

-

11. 最后退役:保留贡献,核对删除的究竟是什么

+

13. 最后退役:保留贡献,核对删除的究竟是什么

9 月下旬已经删除了未使用的 authority prototype,以及实验性 Todo event overlay、dual-writer 和 backfill;其中有数据的旧来源有显式保留或拒绝处理。这里没有删除所有 event logging,也没有取消新 authority 的原子事件与回执。

10 月继续隔离普通 Markdown writer,验证模块不在时真实后续写入仍走正确 owner。等 consumer 路由与替代路径接上,才具备集中删除的条件。

#6396 由 Duang777 主导,Song 和维护侧 Agent 接力补恢复、producer 与集成,沿原分支保留贡献历史。这一轮 3 位开发者与 Agent 的接力,是整个两个月工程的收尾阶段。

@@ -297,9 +400,9 @@

11. 最后退役:保留贡献,核对删除的究竟是

大部分删除也包括旧测试。不能把被删测试行当成业务能力;应继续核对原来保护的 invariant 是否由现有入口和独立反例接住。这里的数字用于说明收尾范围,不能替代整个迁移的结果验证。

-

12. 只统计核心 control plane:研发规模与代码变化

+

14. 核心 control plane 统计:62 天切换与 103 天收敛快照

为了把整段工程的规模说清楚,这里固定一个可复算的窄范围:loopx/control_plane/**。其他目录的 App、benchmark、文档、测试套件不计入核心代码量。这个目录自身的测试支持工具仍在目录口径内。

-

基线是正式 TS RFC 合入前的 d1fe059,终点是 10 月 16 日的 488e443。从正式 RFC 到终点约 62 天,跨 63 个日历日期;其中 62 个日期有核心目录的主干提交。起止源码对照可以复查版本。

+

首阶段 2.0 切换基线是正式 TS RFC 合入前的 d1fe059,首个取证终点是 10 月 16 日的 488e443(约 62 天,跨 63 个日历日期,其中 62 个日期有核心目录主干提交;见前 62 天起止源码对照)。下方原有表格与图表完整保留 10 月 16 日快照不变,并在小节末尾增补截至 11 月 27 日(953377fd7b)的可复算 103 天收敛快照。

整个周期的研发活动

@@ -449,7 +552,105 @@

节奏:这段工程怎样持续推进

统计如何复查

公开安全的PR 清单、核心主干提交清单和指标 JSON随稿提供。PR 集合来自触及该目录的主干提交与 GitHub 合并元数据的对应关系;同一 PR 只计一次。2 次主干提交没有可核验的合并 PR 对应,仍计入提交和代码变化量。

取证中先枚举公开 PR,再用 Git 主干反查;直接读取补齐了搜索索引漏掉的 14 个 PR 元数据。源数据与处理脚本保留在本次调研材料中。没有从这份盘点推算 token、模型费用、CI 算力、研发工时或 benchmark 收益。

-

13. 社区贡献与下一步

+

103 天收敛快照(2026 年 8 月 15 日至 11 月 27 日)

+

沿用完全一致的 method_version: 1 源码存量与第一父链 --no-renames 累计变更公式,从 d1fe05932a 复算至 953377fd7b(见 103 天起止源码对照),以下纯 Git 历史可复算指标完整刻画了 #6396 之后的统一轮次闭环、长程任务原语组合、面向 Agent 的 CLI、零 Any 棘轮以及云端存储 SPI 抽离阶段(随仓提交的 core-pr-cohort.csv 与 core-statistics.json 保持冻结在 10 月 16 日 API 快照):

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
指标基线(d1fe05932a,08-15)2.0 快照(488e4438e0,10-16)后半程增量(10-16 至 11-27)当前主干快照(953377fd7b,11-27)
跨度(活跃提交日 / 日历日)0 天62 天(62 / 63)+41.6 天(+42 活跃日)103 天(104 / 105)
全仓第一父链主干提交(截至 11-27)———9,024(7,741 次提交标题含 #N)
8 月 15 日以来全仓第一父链提交03,003+2,6135,616
loopx/control_plane/ 第一父链落地提交(08-15 起)01,144+1,0512,195(全历史 2,759)
loopx/control_plane/ 提交标题去重 #N PR(08-15 起)01,058(86 次无编号;10-16 API 清单为 1,121)+962(90 次无编号;零重叠)2,020(176 次无编号;全历史 2,575)
loopx/control_plane/ Python 源码存量256 个文件;80,473 行471 个文件;142,371 行+68 个文件;+27,261 行539 个文件;169,632 行
loopx/control_plane/ TypeScript 源码存量0 个文件;0 行323 个文件;87,268 行+107 个文件;+37,537 行430 个文件;124,805 行
loopx/control_plane/ Markdown + JSON 合同0 个文件;0 行7 个文件;929 行+5 个文件;+321 行12 个文件;1,250 行
loopx/control_plane/ Python + TS 合计256 个文件;80,473 行794 个文件;229,639 行+175 个文件;+64,798 行969 个文件;294,437 行
核心目录中 TypeScript 占 Py+TS 比重0.00%38.00%+4.39 个百分点42.39%(#9223 抽离前为 42.89%)
TypeScript 累计新增 / 删除(--no-renames,08-15 起)—+104,769 / −17,501+54,747 / −17,210+159,516 / −34,711(净增 124,805)
Python 累计新增 / 删除(--no-renames,08-15 起)—+120,899 / −59,001+68,061 / −40,800+188,960 / −99,801(净增 89,159)
+

在 #9223 将服务端 PostgreSQL 存储与远端权威服务抽离至云端 SPI 边界之前一刻,核心目录 TypeScript 存量为 435 个文件 / 127,466 行(占比 42.89%)。整个 103 天窗口内,端点净差等于第一父链差分和、源码存量差等于代码净变化这两条恒等式继续严格成立。

+

15. 社区贡献与下一步

这项工程有多位贡献者逐步推进。下面按具体边界列出代表工作,便于继续读历史。