Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
11ef9b3
docs(agent): specify long-horizon orchestration
QiaolongLi1201 Aug 18, 2026
79b157e
feat(agent): add durable execution graph store
QiaolongLi1201 Aug 18, 2026
0b36b4d
feat(agent): schedule isolated implementation work
QiaolongLi1201 Aug 18, 2026
d9800f8
feat(agent): route expert roles with evidence gates
QiaolongLi1201 Aug 18, 2026
7605593
feat(agent): isolate implementation subagents
QiaolongLi1201 Aug 18, 2026
4cdb456
refactor(agent): own durable orchestration state
QiaolongLi1201 Aug 18, 2026
b3fb98a
feat(agent): add durable task controls
QiaolongLi1201 Aug 18, 2026
6d2aaf7
feat(agent): expose execution graphs in web workbench
QiaolongLi1201 Aug 18, 2026
d9da6dd
feat(agent): project plans and task runs into execution graphs
QiaolongLi1201 Aug 18, 2026
6fe62bf
feat(agent): persist background task lifecycle
QiaolongLi1201 Aug 18, 2026
27c5e38
feat(agent): import legacy execution checkpoints
QiaolongLi1201 Aug 18, 2026
d1a8ce2
feat(agent): complete long-horizon product integration
QiaolongLi1201 Aug 18, 2026
80ff6bb
feat(agent): enforce durable long-horizon execution
QiaolongLi1201 Aug 18, 2026
24b1f9b
fix(ci): build agent before long-horizon acceptance
QiaolongLi1201 Aug 18, 2026
a0ba3bc
fix(agent): keep execution cancellation observable
QiaolongLi1201 Aug 18, 2026
749a6f1
fix(agent): support durable graph writes on Windows
QiaolongLi1201 Aug 18, 2026
d65c773
test(web): await narrow layout transition
QiaolongLi1201 Aug 18, 2026
dd7441c
test(agent): normalize Windows patch line endings
QiaolongLi1201 Aug 18, 2026
ca6a869
test(agent): normalize copy patch line endings
QiaolongLi1201 Aug 18, 2026
7337a42
fix(ci): accommodate Windows package smoke
QiaolongLi1201 Aug 18, 2026
012eff5
docs(agent): close long-horizon delivery checklist
QiaolongLi1201 Aug 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .autopilot/PROGRESS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# PROGRESS

## 当前

- 下一项:T11 full verify, merge-main, push, and CI
- 最近绿 tag:autopilot/unify-long-horizon-green-010
- 备注:Execution Graph 已接入 Plan、TaskRun、后台任务、CLI/TUI/Web/ACP;真实验收 long_task_loop 与 subagents_concurrency 均为 10/10。

## 棒日志

| 棒 | 时间 | 认领项 | 门禁 | 证据 | 备注 |
| --- | ---------- | ------------------------------------------ | ----- | ----------------------------------------- | ----------------- |
| 001 | 2026-08-18 | T1 Execution Graph contracts and stores | GREEN | `test/execution-graph.spec.mjs` | 4/4 focused cases |
| 002 | 2026-08-18 | T2 DAG scheduler and recovery policy | GREEN | `test/execution-graph-scheduler.spec.mjs` | 5/5 focused cases |
| 003 | 2026-08-18 | T3 Workspace Lease and guarded patch merge | GREEN | `test/workspace-lease.spec.mjs` | 5/5 focused cases |
| 004 | 2026-08-18 | T4 Role routing, synthesis, completion | GREEN | role/completion/plugin focused tests | 11 focused cases |
| 005 | 2026-08-18 | T5 Instance-owned durable state | GREEN | durable agent + Plan isolation tests | 2 focused cases |
| 006 | 2026-08-18 | T6 CLI/TUI task control | GREEN | task controller/command tests | 2 focused cases |
| 007 | 2026-08-18 | T7 Web graph control and view | GREEN | control plane + Playwright | browser passed |
| 008 | 2026-08-18 | T8 Plan/TaskRun graph projection | GREEN | DAG + projection tests | 5 focused cases |
| 009 | 2026-08-18 | T9 Durable background task projection | GREEN | async task lifecycle tests | 2 focused cases |
| 010 | 2026-08-18 | T10 Legacy import + real acceptance | GREEN | runtime evidence JSON | 10/10 + 10/10 |

## 仲裁队列

| 编号 | 类型 | 状态 | 摘要 |
| ---- | ---- | ---- | ---- |

## 打回记录

| 时间 | 打回内容 | 蒸馏成的验收器 |
| ---- | -------- | -------------- |
5 changes: 5 additions & 0 deletions .autopilot/acceptance/accept-01-execution-graph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -euo pipefail
npm run build -w @rdk-moss/agent
npm run test:filter -w @rdk-moss/agent -- --filter execution-graph

5 changes: 5 additions & 0 deletions .autopilot/acceptance/accept-02-workspace-lease.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -euo pipefail
npm run build -w @rdk-moss/agent
npm run test:filter -w @rdk-moss/agent -- --filter workspace-lease

5 changes: 5 additions & 0 deletions .autopilot/acceptance/accept-03-completion-arbiter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -euo pipefail
npm run build -w @rdk-moss/agent
npm run test:filter -w @rdk-moss/agent -- --filter completion-arbiter

11 changes: 11 additions & 0 deletions .autopilot/acceptance/accept-04-product-surface.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
npm run build -w @rdk-moss/agent
(cd packages/moss-agent && node --input-type=module - <<'NODE'
const orchestration = await import('@rdk-moss/agent/orchestration');
for (const name of ['InMemoryExecutionStore', 'JsonlExecutionStore', 'ExecutionGraphScheduler', 'CompletionArbiter']) {
if (!(name in orchestration)) throw new Error(`missing orchestration export: ${name}`);
}
NODE
)
npm run test:filter -w @rdk-moss/agent -- --filter task-command --filter plugin-agent-role
8 changes: 8 additions & 0 deletions .autopilot/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BUILD_CMD="npm run build -w @rdk-moss/agent"
TEST_CMD="npm run test:filter -w @rdk-moss/agent -- --filter execution-graph --filter workspace-lease"
FULL_CMD="npm run verify"
FULL_EVERY=2
CONTRACT_PATHS="openspec/changes/unify-long-horizon-execution/"
RUNNER_CMD="codex exec --full-auto"
PROVIDER_PROBES=()
REQUIRED_ENV=()
5 changes: 5 additions & 0 deletions .autopilot/no-touch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
packages/moss/src/
packages/create-moss-app/
:(glob)**/.env
:(glob)**/*.lock

3 changes: 3 additions & 0 deletions .autopilot/sprint-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
你是 Moss 长程执行图实施任务的一棒。先读 qiaolong-autopilot Phase 3、`.autopilot/task.md`、
`.autopilot/PROGRESS.md`、`.autopilot/state` 和最近五个提交;恰好认领一项,以测试先红后绿推进,
保存真实命令证据,门禁绿后提交。禁止削弱 OpenSpec、工具安全、审批与插件原子生命周期。
5 changes: 5 additions & 0 deletions .autopilot/state
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
STATUS=RUNNING
SPRINT=3
CONSEC_RED=0
SAME_ERR_COUNT=0
LAST_ERROR_SIG=
46 changes: 46 additions & 0 deletions .autopilot/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Autopilot 合同:Moss 长程执行图与专家团

## 1. 目标与 Done(机器可判定)

- 问题本质:把分散、不可恢复、不可合并的 agent 工作转换为单一持久执行图与证据闭环。
- 自治级别:L3(合并和推送是扳机,但用户已在任务中显式授权)。
- Done = 下列验收器全绿 + `npm run verify` 全绿 + CI 全绿:
- [ ] `acceptance/accept-01-execution-graph.sh`
- [ ] `acceptance/accept-02-workspace-lease.sh`
- [ ] `acceptance/accept-03-completion-arbiter.sh`
- [ ] `acceptance/accept-04-product-surface.sh`

## 2. Non-goals

- 不实现分布式高可用、递归专家树、共享目录并行直写或外部工作流引擎。
- 不削弱现有工具安全、审批、插件原子生命周期与错误边界。

## 3. 改动范围与禁区

- 允许改:`packages/moss-agent/`、相关 docs、OpenSpec、API reports、benchmarks、changelog。
- 禁改清单:见 `no-touch.txt`。
- 契约冻结:本 OpenSpec 在实现期间只做纠错,不为让测试变绿而弱化验收。

## 4. Checklist

- [x] T1 Execution Graph contracts and stores
- [x] T2 DAG scheduler and recovery policy
- [x] T3 Workspace Lease and guarded patch merge
- [ ] T4 Expert routing, synthesis, and completion arbiter
- [ ] T5 MossAgent, plugin, CLI/Web/TUI/ACP integration and migration
- [ ] T6 public API, docs, benchmarks, full verification, merge, push, CI

## 5. 风险与不确定

- Windows 无法在本机真跑;以路径单测和 GitHub Windows CI 作为平台证据。
- 真实模型场景依赖 provider 凭据;无凭据时必须明确 SKIP,不能用 fixture 冒充。

## 6. 扳机操作

- 合并到 `main` 与 push;用户已明确授权,仅在全量门全绿后执行。
- 不执行 npm publish、删除用户数据或生产部署。

## 7. 预算与阈值

- 最大阶段:6;每个阶段 focused tests 后提交可恢复绿点。
- 同一错误连续三次或连续两阶段全量门红即熔断并报告。
1 change: 1 addition & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ State has an explicit owner and scope:
| -------------------- | ----------------------------------------------------- | -------------------------------------------------- | ----------------------------------------- |
| Conversation | Session store and event contracts | JSONL or in-memory stores, depending on entry path | Inject durable, tenant-scoped storage |
| Active run | Run/session identity, abort and steering state | Process-local orchestration | Project events into a host job system |
| Execution graph | Goal, DAG nodes, budgets, evidence, leases, verdict | `ExecutionStore` under `.moss/runtime/executions` | Subscribe/project; never infer completion |
| Context | Messages, budgets, pruning and compaction checkpoints | Runtime-managed per run | Configure budgets and observe usage |
| Skills and knowledge | Registries, loaders, capability packs | Bundled/workspace discovery | Inject product or domain sources |
| Memory | Scoped memory interfaces and stores | CLI/runtime-selected local stores | Provide tenant-aware persistence |
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,35 @@ Categories: **Added** · **Changed** · **Fixed** · **Removed** · **Internal**

### Fixed

- **Windows execution-store durability**: atomic lease and snapshot publication now retains file
fsync while avoiding unsupported Windows directory-handle fsync, so durable long-horizon runs can
acquire and renew graph ownership on Windows.
- **Clean-checkout long-horizon acceptance**: the acceptance command now builds the agent before
importing its distribution entrypoints, including on macOS, Ubuntu, and Windows CI.
- **Repeated legacy TaskFrame recovery**: migration markers now resolve their persisted graph ID,
so a later turn with a new run ID reuses the original execution graph instead of failing the Web
conversation before approval or tool execution.
- **Cross-platform plugin process lifecycle**: active Worker RPC calls now keep their worker alive
until every pending promise settles, and exact-version plugin installation runs npm's JavaScript
CLI directly on Windows instead of failing through the `npm.cmd` shim.

### Added

- **Durable long-horizon execution and expert teams**: the beta
`@rdk-moss/agent/orchestration` surface adds a CAS event-sourced execution graph, JSONL snapshots
and owner leases, dependency-aware parallel scheduling, explicit budgets/retries, Git/copy
workspace leases with guarded patch merge, capability-routed advisor/implementer/verifier roles,
deterministic evidence-bound completion arbitration, and safe legacy checkpoint import. CLI/TUI
`/tasks` and `/task inspect|resume|retry|stop` plus the Web details panel expose the same graph
identity, revision, nodes, evidence, recovery state, and verdict. Recorded runtime acceptance now
requires `long_task_loop` 10/10 and `subagents_concurrency` 10/10. Scheduler owner leases now fence
every event for the complete execution wave and abort workers on stop or lease loss; capability
routing and structured synthesis run through `MossAgent`; routed coding work provisions an
isolated lease, requires explicit host merge approval and a distinct zero-exit verifier receipt;
direct store callers cannot forge arbiter terminal events. Isolated patches merge only through
adapter-verified approval paths. The acceptance gate now exercises the packaged CLI and real
loopback Web task API while emitting reproducible tracked evidence.

- **Complete local Web workbench**: `moss web` now provides the responsive three-column Moss design
system, durable searchable sessions, resume/rename/export/delete/fork/rewind, cursor-based SSE,
rich conversation and tool evidence, bounded text/image attachments, generated-file downloads,
Expand Down Expand Up @@ -60,6 +83,12 @@ Categories: **Added** · **Changed** · **Fixed** · **Removed** · **Internal**

### Changed

- **Plan, background-task, and TaskRun state converge on Execution Graph**: Plan dependencies now
admit independent siblings concurrently while omitted dependencies retain ordered compatibility;
Plan tools, background tasks, and TaskRun v1 shadow-write graph facts. A TaskRun `run.completed`
claim cannot complete a graph until a verifier binds evidence. Full sub-agents require declared
write paths and return retained lease/patch references instead of working in deleted empty folders.

- **Audited Cordis vendoring direction**: the agent package now carries a licensed, revision-pinned
effect-ownership kernel and an OpenSpec migration plan for service seams, shared skill catalogs,
full-core evaluation, controlled loading, and eventual quiescent HMR.
Expand Down
Loading