Compare commits

..
Author SHA1 Message Date
weichen cafd10b44b Backfill the RDM baseline review and MS1 acceptance audit
Why: The RDM plan's 2026-10-07 snapshot (downstream at zero, N1 in
flight, O1/O3/O7 blocked) was contradicted by the RDM repo's 103 merged
PRs; the planning index registered this as an open reconciliation item
and named it the preferred follow-up to the stage-record task.

Evidence: isolated clone replay at RDM 4feb2f0 (pins=v0.1.0) - make
test exit 0, -ms1 PASS (same-source gold caveat recorded), ms0
acceptance PASS=9/SKIP=0 on a disposable postgres container, five
upload probes, and entrance probes (chat 400 vs commands 200); card/
PR snapshot JSON; all receipts SELF (RDM has no CI), stored under
docs/records/2026-10-08-rdm-status-*.json. The private minutes probe
receipt stays local by decision; only hashes and metrics are recorded.

Impact: adds plan SS2.3 (row-by-row re-verdict, MS1 seven-clause audit,
six registered gaps), marks SS2 as a historical snapshot, updates the
index milestone table and closes the RDM-snapshot open item, registers
the dual-main-record ruling and the missing-CI gap.

Refs: Dev task feature/rdm-status-review; Documents index next-step
(2026-10-08).
2026-10-08 09:21:45 +00:00
weichen d630a040be Merge pull request 'Backfill N1/Q1/I1/I2 stage status and scope differences' (#46) from feature/stage-records-status into main 2026-10-08 06:30:03 +00:00
weichen ec5114d621 Backfill N1/Q1/I1/I2 stage status and scope differences
Why: The planning index listed the stage-record reconciliation as the
preferred next task: N1 WP6b/6c transfers, the Q1 platform-task vs
squad-run boundary, I1 reserved command consumption, and the I2 card's
dangling reference all feed N2/Q3 and RDM dependency judgments.

Evidence: Dev merges #230/#231/#234/#235/#237/#240/#242 verified in
main via git log --merges on 2026-10-08; stage claims are SELF-level
card statements, explicitly not replayed; intent command.go:18-25/78-84
checked for the Cancel/Handoff ruling.

Impact: Adds a status-backfill section (SS7) to the N1/Q1/I1 plan with
per-item done/transferred/todo ownership, an I2 status note in the
stack completion plan (the sole I2 main record), and INDEX navigation
updates; registers the truncated Q2/Q3 archive lines as a new open
item.

Refs: Dev task feature/agent-stack-stage-records; planning index
"next-step" recommendation (2026-10-08).
2026-10-08 06:28:19 +00:00
weichen c39efdc501 Index project plans and record the post-sync coverage
Refs: #45
2026-10-08 05:26:38 +00:00
weichen b825945c1d Record N3 and Q2/Q3 plans in the planning index
Why: documents main gained two plans after the index snapshot, and Dev has since merged N2, N3, Q2, and Q3.
Evidence: 21 markdown proposals are present at HEAD; merge SHAs were read from Dev origin/main git log --merges.
Impact: navigation only; proposal bodies and acceptance claims are unchanged.
Refs: Documents #43 #44; Dev #244 #247 #248 #249 #250 #251 #253
2026-10-08 05:25:44 +00:00
weichen b9590150cc Merge authoritative documents main into the planning index
Why: the index branch was cut before N3 and Q2/Q3 plans landed on main.
Evidence: merge-tree reported no content conflicts against origin/main 16795ed598.
Impact: bring those two proposal files into the index branch without rewriting history.
Refs: documents main
2026-10-08 05:20:23 +00:00
weichen 16795ed598 Merge pull request 'Propose the Q2 and Q3 implementation plans: topologies and convergence' (#44) from feature/agent-stack-q2q3-plans into main
Propose the Q2 and Q3 implementation plans
2026-10-07 23:28:31 +00:00
weichen a042edaa73 Propose the Q2 and Q3 implementation plans: topologies and convergence
Why: N1-N3/Q1/I1-I2 are closed; per the completion doc dependency
order Q2 then Q3 are next. Both need plans grounded in current code:
squad has no topology abstraction (two modes, dormant Cond
combinators, dead FactItem.Verified), RespondDecision has no actor
attribution (the mailbox acceptance attack surface), WorkflowDef
execution compresses steps into SpawnSubagent, and adapters/a2a does
not exist.
Evidence: three-area survey with file:line citations at the pinned
baselines (agent-squad c462bc4, backend 6e02a1f); the review
equivalence baseline is quoted from backend runReview with its test
anchors; the P4 ruling is quoted verbatim from agent-harness.md.
Impact: documentation only; Q2 implementation starts after merge,
Q3 after Q2 closes.
Refs: 2026-10-02-agent-stack-completion.md Q2/Q3 sections
2026-10-07 23:27:56 +00:00
weichen 5ccbe027ca Merge pull request 'Propose the N3 implementation plan: durability and observability' (#43) from feature/agent-stack-n3-plan into main
Propose the N3 implementation plan: durability and observability
2026-10-07 14:56:11 +00:00
weichen c13c79ebac Propose the N3 implementation plan: durability and observability
Why: N2 is closed; per the completion doc's dependency order N3 is
next and needs a plan grounded in current code (the crash window
between persist and intent commit is unprotected, the product
conversation path has zero durability, span names/attributes do not
follow the GenAI convention, the memory port does not exist).
Evidence: five-area survey with file:line citations at the pinned
baselines (agent-native 74aa60b, backend 7980a8a, core 0b5c774);
audit N1/N21 verified fixed, N6/N20 verified still open.
Impact: documentation only; work starts after this plan merges.
Refs: 2026-10-02-agent-stack-completion.md N3 section
2026-10-07 14:55:37 +00:00
weichen f8cc211296 Link historical milestones without overstating validation
Why: expose existing milestone records and distinguish source observations from combination tests.

Evidence: linked records exist at the fixed source version; proposal blobs and the observation receipt remain unchanged.

Impact: index wording and navigation only; no plan or acceptance decision changes.

Refs: docs/proposals/INDEX.md
2026-10-07 14:02:50 +00:00
weichen 8366668e44 Keep unassigned planning ownership explicit
Why: author and task-account names do not establish ownership of a plan.

Evidence: independent review found four missing owner fields in the adopted set and N2 also has none; fourteen source headers explicitly name weichen.

Impact: correct the index attribution and clarify the local N2 document adoption boundary; source proposals remain unchanged.

Refs: planning-index review P2; docs/proposals/INDEX.md
2026-10-07 13:58:35 +00:00
weichen b87b929673 Index project plans and distinguish their evidence states
Why: make existing directions, milestones and tasks discoverable without treating document claims as acceptance.

Evidence: fixed file blobs, 55 PR API records and Git ancestry are preserved as SELF observations; document links and all 19 proposals are checked.

Impact: navigation and evidence only; original plans, approval scope and business code are unchanged.

Refs: Dev feature/planning-index; docs/proposals/INDEX.md
2026-10-07 13:47:49 +00:00
weichen 5542319a04 Merge pull request 'Propose the N2 implementation plan: context, protocol, and tools' (#42) from feature/agent-stack-n2-plan into main
Propose the N2 implementation plan: context, protocol, and tools
2026-10-07 12:38:28 +00:00
weichen 96fd6599d1 Propose the N2 implementation plan: context, protocol, and tools
Why: N1/Q1/I1/I2 are closed; per the completion doc's dependency order
N2 is next and needs a plan grounded in current code (the audit's N4 is
still open; the product-side ctxasm trim is the real gap for acceptance
clause 2; MCP 2026-07-28 features are absent).
Evidence: six-area survey with file:line citations at the pinned baselines
(agent-native ead690b, backend 68addfd); audit items N2/N3/N18/N19/N22
verified fixed against current code, N4 verified still open.
Impact: documentation only; work starts after this plan merges.
Refs: 2026-10-02-agent-stack-completion.md N2 section
2026-10-07 12:27:31 +00:00
weichen 0551d00300 Merge pull request 'Propose the RDM phase plan: direction, invariants, and stage gates' (#41) from feature/rdm-phase-plan into main 2026-10-07 04:34:51 +00:00
weichen b8eaa1676f Propose the RDM phase plan: direction, invariants, and stage gates
Why: The further-objective docs are now the system's next big-phase
target; the plan pins the two-tree-one-net product on top of the
generic platform with two hard invariants - downstream-only domain
logic and always-degradable-to-generic-agent when the plugin is off.

Evidence: docs-only change; milestone mapping verified against
further-objective 10 (W1-W16), readiness claims verified against the
pinned worktrees (EXT-1 symbols in surface.txt, v0.1.0 tags, RDM repo
seed facts as recorded in vision doc 13).

Impact: Adds one proposal; no code changes.

Refs: docs/proposals/2026-10-07-agent-stack-n1q1i1-plans.md
2026-10-07 04:25:23 +00:00
weichen dd9c1ba558 Merge pull request 'Propose N1/Q1/I1 implementation plans for the agent stack' (#40) from feature/agent-stack-n1q1i1-plans into main 2026-10-07 02:51:30 +00:00
17 changed files with 3299 additions and 0 deletions
+3
View File
@@ -2,6 +2,9 @@
系统文档与过程记录仓:架构决策、方案与验证记录、使用与插件开发指南;不含产品代码。
从 [项目方向与规划索引](docs/proposals/INDEX.md) 查找主记录、里程碑、关联任务及待确认差异。
索引给出固定版本的核验快照;方案批准、PR 合入和运行验收分别记录。
## 目录
```text
@@ -252,6 +252,13 @@ Backend 把 `WorkflowDef` 编译成 Squad 的图。`internal/workflow` 与把小
验收:分类器返回未知 ID 时结果保持 Ambiguous。eval 对一份不少于现有语料规模的多轮夹具给出指标,而不是只打印分支名。
状态回填(2026-10-08):I2 已实施并合入(Dev #242,merge d308ed6;R1–R4 验收声明 PASS,
SELF;各组件仓 CI 在 merge 前 success,GATE)。本节是 I2 的唯一规划主记录——I2 任务卡
原先误引「N1/Q1/I1 实施案的 I2 部分」(该文档不含 I2),链接已在 Dev 侧修正指向本节。
剩余项:慢通道开启态的端到端灰度与阈值调参(原记随 RDM MS1 插件语料一并)、
SetSlot/Cancel/Handoff 命令的运行时消费(无阶段载体,见
[N1/Q1/I1 案回填 §7.3](2026-10-07-agent-stack-n1q1i1-plans.md))。开启态完整用户验收未重放。
### E 评测(每阶段都带,不单列阻塞)
Native:配对、取消、预算、压缩。Squad:步边界杀进程。Intent:多轮语料。Dev 组合:少量真实任务加人工复核,不把模型自报当通过。
@@ -321,3 +321,63 @@ WP1 命令模型 → WP2 ActionRef 迁移(刻画测试先行)→ WP5 决胜
- 三个阶段的实施方案各自满足:工作包可独立派生任务卡、验收条款可机器核对、与总提案逐条映射(§2.6 / §3.6 / §4.6 的表)。
- 现状陈述均有 file:line 证据(撰写日 pin 见 §1.1);评审重放 = 按表中证据抽查。
- 三任务协调规则(§1.2)与 AGENTS.md 分支层级一致。
## 7. 实施状态回填与范围差异(2026-10-08)
本节回填三个阶段的实施结果与本文原设计的范围差异,来源为已归档任务卡(SELF 声明)与
Dev main 的合入记录(2026-10-08 经 `git log --merges` 核对,#230/#231/#234/#235/#237/#240
均在 main)。本节不重放各任务测试,不把闭卡文案升级为重新验收;「完成」指卡内验收条款
声明 PASS 且 PR 已合入。每个转出/待做项标注依据、归属与适用版本,供 N2/Q3 之后的工作
与 RDM 依赖判断使用。
### 7.1 N1 内核 harness
已合入:Dev #230(merge 42f5ac4)/ #231(merge b6974fa);组件链 Agent-Native
#17–#20、Agent-Squad #16–#18、Backend #69–#73(卡内记录,CI 在各 merge 前 success,GATE)。
卡内验收两条(A/B 对照、插件 AgentSpec 校验)声明 PASS(SELF)。
与本文 §2.2 的范围差异(依据:N1 卡增量三/四及「影响与剩余项」):
| 项 | 本文原设计 | 实施结果 | 状态 | 归属/载体 |
|---|---|---|---|---|
| WP6b 小队成员级 deliverable Stop/提醒拉齐 | §2.2 WP6「三条路径注入同一套…」的小队成员级部分 | 任务内裁定转出:需 adapters 成员级执行信号(工件产出追踪+工具轮计数) | 待做;原建议载体 Q1 未承接(Q1 卡剩余项无此项,Q2/Q3 亦未涉及) | owner weichen;载体待定 |
| WP6c 直连/子代理改经 adapters 消费 | §2.2 WP6「不再裸调 nruntime.Run」 | 转出:需 exec.Request 表达 History/工件追踪/证据回收;ContractBackend+conformance 部分已落地(卡增量四②) | 待做;未承接 | owner weichen;载体待定 |
| prompts.SubagentSpec 迁移 | §2.2 WP1「迁移为读 AgentSpec 文件」 | 裁定不迁移:与 agent-*.md 两套格式并存,新字段暂无消费者(卡增量三) | 有意搁置 | owner weichen;有消费者时再启动 |
| runmgr 派生路径 Start/Stop | §2.2 WP2 发射点补齐的产品侧外延 | 裁定不覆盖:非工具调用、无总线上下文(卡增量三) | 有意搁置 | 同上 |
| AllowStore 持久化 | §2.2 WP3「持久化形态留给 N3」 | N3 再转出(N3 卡「影响与剩余项」:memory 回合后抽取接线与 AllowStore 持久化转后续) | 待做;已经 N3 二次转出 | 见 N3 卡记录 |
### 7.2 Q1 图执行
已合入:Dev #237(merge 3bf2441)/ #240(merge ba36d47);组件链 Agent-Squad #23–#26、
Backend #79–#82。卡内验收三条声明 PASS(SELF)。
与本文 §3 的范围差异(依据:Q1 卡增量四及「影响与剩余项」;Q2/Q3 卡对照):
| 项 | 本文原设计 | 实施结果 | 状态 | 归属/载体 |
|---|---|---|---|---|
| platform task 队列翻译成 squad run | §3.2 WP5 收编裁定「Claim 到的任务翻译为 squad run 并交给引擎」 | Store 层合一已做(SQLiteStore、X6 改走 Executor 端口、serve 单库挂载);task 队列本身的翻译转出为「更深的产品合一,Q 系列/EXT 范畴」;Q2 卡明确记非目标(「平台队列桥接…(后续)」),Q3 未涉及 | 待做;Q 系列已收口仍未承接 | owner weichen;按 RDM 总案 §3.3 走 EXT 申请或后续产品任务 |
| 黑板可回放增量与 Reads 读集 | §3.2 WP4「留给 Q2 拓扑」 | Q1 卡转出至 Q2;Q2 卡通篇无黑板/读集内容(实施为拓扑注册表等) | 待做;Q2 未承接 | owner weichen;载体待定 |
| leader 模式 SQLite 端到端 | §3.2 WP2「leader.json 的状态并入检查点」 | Store 已实现 SaveLeader/LoadLeader;leader 模式回归在 FileStore 上证明(卡「影响与剩余项」) | 待做(回归补证) | owner weichen |
| 验收表「schema 断言」 | §3.6 第三条「platform 侧无独立 run 状态表残留(schema 断言)」 | 卡内验证记录为 TestSQLiteStoreRoundTrip、TestEngineRunsOnSQLiteStore 与单库挂载;未见 schema 断言测试记录 | 证据口径差异;补断言或由负责人裁定豁免 | owner weichen |
| 拓扑库 | Q1 卡转出至 Q2 | Q2 已落地(Dev #250/#251) | 完成(在 Q2) | — |
### 7.3 I1 命令化识别
已合入:Dev #234(merge 1f7217f)/ #235(merge eafe1e1);组件链 Agent-Intent #6–#8、
Agent-Squad #19–#22、Agent-Native #21/#22、Backend #74–#78。卡内验收四条声明 PASS(SELF)。
与本文 §4.2 的范围差异(依据:I1 卡「影响与剩余项」;代码核对 command.go:18-25/78-84):
| 项 | 本文原设计 | 实施结果 | 状态 | 归属/载体 |
|---|---|---|---|---|
| blueprint per-run entry 覆盖 | §4.2 WP3 squad 蓝图链接入的延伸 | 裁定为独立设计项;blueprint 决策已达 Router | 待做 | owner weichen |
| ambiguous→Clarify 产品化 | §4.2 WP1 消歧路径 | Router v1 保持普通回合;产品化需澄清 UI/HITL | 待做 | owner weichen |
| SetSlot/Cancel/Handoff 的产出与消费 | §4.2 WP1「否定/取消语义 → Cancel(收编 recognizer.go:66 注释承诺)」与命令展开 | Command 类型已定义且有意裁定「规则漏斗不产出 Cancel/Handoff」(command.go:78-84 注释:留给声明 action 的意图与语义层);运行时消费(会话槽位状态机)未做 | 待做;原记「I2 附近」,I2 已收口未承接(I2 卡同项转出) | owner weichen;无阶段载体,需排期 |
### 7.4 对后续依赖的提示
- N2/N3/Q2/Q3/I2 均已各自合入(见[规划索引](INDEX.md)阶段导航),但上表转出项无一被
这些阶段承接;引用「N1/Q1/I1 已完成」作依赖判断时,须扣除上表待做项。
- RDM MS3 依赖的 Q1 图执行与 Q3 编排收敛不受上表影响;受影响的是「platform task 队列
合一」与「SetSlot/Cancel/Handoff 消费」两条产品化路径。
- 本节维护规则与索引一致:状态再次变化时先更新本节并同步索引导航。
@@ -0,0 +1,148 @@
# 方案:N2 上下文、协议与工具——现状核验与增量实施
日期:2026-10-07。上游:[2026-10-02-agent-stack-completion.md](2026-10-02-agent-stack-completion.md)「N2 上下文、协议与工具」节(范围与三条验收的唯一权威)、[2026-10-02-agent-stack-audit.md](../records/2026-10-02-agent-stack-audit.md)(审计项逐条对当前代码复核后引用)。
基线 pin:agent-native `ead690b`、backend `68addfd`、agent-squad `029edc0`、agent-intent `343b1e6`(均为已合入 main)。本文所有 file:line 以这些 SHA 为准;实施时先复核再引用(与 N1/Q1/I1 同一纪律:审计与本文都不是证据,当前代码才是)。
依赖状态:N1/Q1/I1/I2 全部闭卡(任务卡归档)。总提案依赖序「N1/Q1/I1 → N2/Q2/I2;N3 在 N2 之后」满足,N2 开工。
## 一、现状核验(六路侦察 + 关键处亲验)
### 1. 上下文与压缩
库层三件已就位且配对安全:
- **会话压缩**:`runtime/session/compact.go:78-146`;`alignToolTail`(compact.go:148-154)回退 tailStart 至工具结果组之外,头段整体换摘要,不留孤立调用。回归:`TestR2CompactKeepsToolPair`、`TestCompactLeavesNoOrphanToolCall`(runtime/session/r2_regression_test.go:12-46,105-162)。
- **微压缩**:`runtime/session/microcompact.go:44-70` 只改写旧工具结果正文为转录指针占位,不增删消息、不动配对(loop.go:759-776 接入)。
- **适配层自动压缩**:`adapters/native/backend.go:95-103,412-470`。
- **提醒**:`runtime/reminders/reminders.go:70-97` 并入最后一条消息,不新建 user 消息(审计 N22 已修)。
仍开放:
- **产品侧裁切破坏配对(验收②的真缺口)**:`modules/backend/internal/ctxasm/finish.go:200-242` `trimOldest→oldestDrop` 逐条丢弃「系统前缀后第一条」,无工具配对意识——丢掉带 tool_calls 的 assistant 会留下孤立结果,丢掉结果会留下悬空调用。渲染阶段(ctxasm.go:174-277)本是配对安全的,裁切在其后发生,把安全性破坏掉。
- **旧工具结果没有落盘路径**:微压缩占位指向转录调用 ID(microcompact.go:58-68),不是文件路径;总提案 N2 行「运行内把旧工具结果换成路径」(ZCode compact 模式)未实现。
- **缓存友好无契约**:全仓无 `cache_control`;系统文本+工具清单的稳定性是事实性而非设计(registry.go:136-148 注册序、loop.go:380-401 拼接),无测试钉住;backend 有 PrefixHash 观测(finish.go:252-277)但无稳定契约测试。
- **`alignToolTail` 无直接单测**(仅经 Store.Compact 端到端覆盖,边界形态靠偶然)。
- filestate 读后才能写只在 agent-native 路径(backend.go:210);产品直连路径不过 `WorkspaceToolsTracked`(llm_direct.go:191-193)——划归 Q3 收敛范畴(见边界节)。
### 2. Anthropic 原生协议(审计 N4 仍开放)
- 线上 Client 只讲 OpenAI chat:`runtime/llm/client.go:14,71,76` 固定 POST `…/chat/completions` + Bearer。
- `Protocol` 枚举五方言(providers.go:123-129),`ClientFor` 只实现 `openai-chat`,其余 fail-closed(providers.go:201-208)。审计 N4 的「选了不能用」已被缓解:anthropic/google 预设改指 OpenAI 兼容端点(providers.go:143,146)——但**原生方言不存在**。
- 离线组包 `anthropicMessages`(providers.go:320-352)丢 tool_use/tool_result、不挂 tools(providers.go:270-289);`Message`(types.go:48-57)无 thinking/signature 存储,签名块无法往返。
- 无录制 HTTP 夹具机制(无 testdata/;现有测试全是内联 httptest 脚本)。
- 审计 N4 验证结论:**部分缓解、主体仍开放**。
### 3. 延迟工具 / tool_search / 代码编排(基座已在,剩收口)
已就位(agent-native):`ExposureDeferred` 两级暴露(runtime/tools/registry.go:56-73)、`tool_search`/`call_tool` 元工具(deferred.go:13-68)、激活持久化(deferred.go:94-128 → `.agentx/activated-tools.json`)、MCP 延迟连接 `StartBackground`(manager.go:124-135)与 >8 工具自动 deferred(manager.go:197-207)、代码编排 `run_tool_script`(code_tool.go:14;codeorch/host.go 进程外执行、中间结果不进上下文、50 次上限、禁名单)。backend 双路径接线:`runtime.codeOrchestration` 默认关(settings.go:95;app.go:241 agent-native 路径;codeorch_tool.go:15-78 + runmgr.go:348-355 直连路径)。
仍开放/风险:
- 激活恢复只记名字,激活工具永不进 `Decls()`(deferred.go:100 注释为有意设计,call_tool 间接层即机制)——**保持,不扩**。
- 代码编排在两处各有一份实现(库 code_tool.go vs 产品 codeorch_tool.go),开关两点判定,可漂移;N2 只做「同一语义」契约测试,不做合并(合并属 Q3 退役直连路径时自然发生)。
- 审计 N30(native.Options 单件)仍在;本阶段不做大重构,只在新端口上不再加字段。
### 4. MCP(审计 N3/N18/N19 已修;2026-07-28 未对齐)
- **验收③已满足**:stdio 单读循环按 id 分发(stdio.go:192-231),取消只 dropPending;回归 `TestStdioSlowCancelThenEcho`(mcp_test.go:78-105)断言 `Readers()==1`。审计 N3 关闭;N18(重连一次,manager.go:243-250)、N19(HTTP 会话 DELETE,http.go:95-119)同闭。
- **未对齐 2026-07-28**:`ProtocolVersion="2024-11-05"`(protocol.go:16)且服务端协商版本从不检查;`callToolResult` 无 `resultType`(protocol.go:138-141);`input_required` 只是成功结果里的内容块特例(ask.go:20-27),应答直接当终态返回(manager.go:254-264),不**重试原请求**;ask 端口(ask.go:7-18)接的是自由输入而非审批面;`tasks/get|update|cancel` 客户端面无;工具 schema 透传无 2020-12 声明(manager.go:174-177 合成默认 schema 时也未声明)。
### 5. skills 校验(开放规范未对齐)
- 现校验仅:目录名字符集 `[a-zA-Z0-9_-]`、64KiB 截断、描述 200 字截断、每根 100 个(runtime/skills/skills.go:22-26,140-186)。frontmatter 只按行前缀扫 `description:`(有意不引入 YAML 依赖,skills.go:4);`name:` 被忽略(目录名权威);未知键静默通过;不合规范式静默跳过(skills.go:79-81)。
- 开放规范差距:name 必填且须 kebab-case 并与目录同名、description 必填(规范上限 1024)、已知键白名单(license/compatibility/metadata/allowed-tools)、字段形态校验、**错误上浮**而非静默。
- backend 侧零校验:种子(internal/skills/skills.go:52-127)与插件技能落盘(plugins/host_v2.go:56-74)都不验;内置 recipes 只有 `description:`,缺 `name:`(dogfood 欠账)。
### 6. 子代理后台/转录/恢复
- **后台机制产品层已有**:`spawnBackground`(runmgr.go:1447-1474,上限 3、detached ctx、完成入 notice 队列、空闲合并投递);模型经 delegate 工具 `background:true` 触发(llm_direct.go:459-492)。但 `AgentSpec.Background`(agentspec.go:28,156-161)**除测试外无消费者**;notice 队列是内存 map(runmgr.go:1487-1494),重启即丢。
- **无独立转录**:子 run 共享父会话 messages 表、仅 `run_id` 分区(runmgr.go:1352,1426;store/messages.go:101-116 排除);SubLLMRunner 直连 `nruntime.Run`(sub_loop.go:98),不建 workDir、不写 .agentx。
- **零恢复**:`ReconcileInterrupted`(runmgr.go:1606-1634)对子 run 只 seal 成 interrupted,无续跑/重跑路径;恢复测试只覆盖会话 run。
- `WorktreeIsolation/OutputSchema`(agentspec.go:29-30)declared-only——本阶段保持,记为边界。
### 7. 审计 N2(并行工具事件竞争)——已修,仅引用
`serializeHostCallbacks`(loop.go:468-480,Run 入口 :170 调用)用一把锁串行 OnEvent/BeforeTool/AfterTool;`GOWORK=off go test -race ./runtime/` 全绿(本方案亲验,2026-10-07)。不再安排工作,作为既有证据引用。
## 二、工作包划分
| WP | 内容 | 主要仓 | 对应验收 |
|---|---|---|---|
| WP1 | 上下文配对收口 + 工具结果落盘 + 前缀稳定契约 | backend + agent-native | ② |
| WP2 | Anthropic 原生客户端 + 录制夹具端到端 | agent-native | ① |
| WP3 | MCP 2026-07-28 对齐(版本协商 / resultType / input_required 重试 / approval 接线) | agent-native + backend | ③(回归引用) |
| WP4 | skills 开放规范校验 + dogfood + 插件路径复用 | agent-native + backend | — |
| WP5 | 子代理:Background 消费、独立转录、恢复与通知持久化 | backend(+agent-native 小面) | — |
| WP6 | 装配收口 + A/B 验收证据 + 级联闭链 | backend + Dev | ①②③ 总验 |
依赖:WP1 先行(验收②、风险最小、产品直接受益);WP2 与 WP3/WP4 可并行;WP5 独立;WP6 收全部。每个 WP 走「库 PR → backend PR → 级联 → Dev gitlink PR」既有链式,逐 WP 合入,不做长分支。
### WP1 上下文配对收口
1. **ctxasm 裁切配对对齐**:`oldestDrop` 改为工具组对齐——候选索引落在 tool 结果组内或带 tool_calls 的 assistant 上时,整组同退(对齐 `alignToolTail` 语义,但方向是丢弃侧)。测试:构造带多轮工具调用的装配输出,裁切后断言(a)无孤立 tool_call(每个 call 有结果)、(b)无悬空结果(每个结果有 call)、(c)`Report.Truncations` 仍记录。**这是验收② 的机器证据。**
2. **旧工具结果落盘**:微压缩清理时把旧结果写入 `<workDir>/.agentx/results/<toolCallID>.txt`,占位改为路径指引(「完整内容见 <路径>」);保留 keepLastN 语义。库内实现 + 单测(写盘、占位、配对不变、文件可被 fs 工具读回)。
3. **前缀稳定契约测试**:钉住系统文本与 `Decls()` 顺序在同一注册序列下逐字节确定(含 tool_search/call_tool 注入位置);backend 侧钉 `PrefixHash` 在同输入下不变。只测不改行为。
4. **`alignToolTail` 直接单测**:tail 恰落多调用 assistant、keepLastN 大于工具组、全为 tool 角色三种边界。
### WP2 Anthropic 原生客户端
1. **客户端**:`ClientFor` 增 `ProtocolAnthropic` 分支——POST `{base}/messages`,头 `x-api-key` + `anthropic-version`,SSE 解析 Anthropic 事件族(`message_start`/`content_block_start|delta|stop`/`message_delta`;`text_delta`/`input_json_delta`/`thinking_delta`/`signature_delta`),映射到既有 `Event` 类型;stop_reason `tool_use`→StopToolCalls、`end_turn`→StopEnd。
2. **消息形态**:`anthropicMessages` 重写——assistant `tool_use` 块(id/name/input)、user `tool_result` 块(tool_use_id/content)、`tools` 数组(name/description/input_schema);`Message` 增 thinking 块与 `signature`(含 `redacted_thinking`)存储与往返;system 与 tools 挂 `cache_control`(原生路径上的缓存友好,呼应 WP1-3)。
3. **预设**:`anthropic` 预设切到 `ProtocolAnthropic`(用户预期即原生);compat shim 经 `models.json` 自定义仍可配。`BuildBody` 的 Anthropic 分支与线上客户端统一(同一组包函数,消灭「离线/线上两张皮」的 N4 根因)。
4. **录制夹具(验收①)**:新增 `runtime/llm/testdata/anthropic/` 录制字节流(非真实密钥、非线上依赖):一轮完整工具调用——带 tools 请求 → SSE 含 `tool_use` → `tool_result` 请求 → 终文本。端到端断言:`ClientFor(Lookup("anthropic"))` 走通全程;第二次请求体中 thinking 块带原签名(签名往返);请求头含 `anthropic-version`。
5. 审计 N4 随本 WP 关闭(预设即真实客户端;未实现协议仍不出现在预设)。
### WP3 MCP 2026-07-28 对齐
1. **版本协商**:通告 `2026-07-28`;读取服务端 `initializeResult.protocolVersion`,按协商版本分流(低版本回落现行行为,不留半新半旧)。
2. **resultType**:`callToolResult` 增判别字段;`input_required` 升格为协议级结果类型——经 ask 端口取得应答后**用原参数重试 `tools/call`**(不再把应答当终态内容返回);重试次数有界(防循环)。
3. **approval 接线**:ask 端口在 backend 接到审批/确认卡面(复用 N1 的 HITL 卡与 PermissionAsk 通路),自由输入与批准两类语义分清。
4. **tasks 客户端面**:`Client` 增 `tasks/get|update|cancel` 方法 + 双传输实现 + 假服务器用例;产品侧映射只做最小集(run 中断时对进行中的 MCP task 发 `tasks/cancel`),完整后台任务映射记录为后续项(N3 持久化阶段)。
5. **schema 2020-12**:合成默认 schema 时声明 `$schema: 2020-12`;透传保持不透明(不重写方言,注释记为有意)。
6. 回归保持:`TestStdioSlowCancelThenEcho`(验收③)全程原样通过,作为 WP3 不得破坏的既有证据。
### WP4 skills 开放规范校验
1. **严格子集解析器**:坚持不引入 YAML 依赖(skills.go:4 的既有约束),手写支持规范字段形态的子集(标量、`metadata` 字符串映射、`allowed-tools` 空格分隔列表);形态不合法即错误,不猜测。
2. **校验规则**:`name` 必填 + kebab-case(小写、1–64、无连续/首尾连字符)+ 与目录同名;`description` 必填、≤1024(上限对齐规范,替换现 200 截断);已知键白名单 `{name,description,license,compatibility,metadata,allowed-tools}`,未知键带字段定位拒绝;`compatibility` ≤500;不合规**错误上浮**(List 返回逐技能诊断;load_skill/declared-skill fail-closed 带错误正文,替换静默跳过)。
3. **dogfood**:内置 recipes 全部补 `name:`;不合规目录改名随本 WP 同 PR(不另起 PR)。
4. **backend 复用**:插件技能落盘(host_v2.go:56-74)过同一校验器,失败带字段定位拒绝装载(与 N1 插件 AgentSpec 拒禁键同款形态);种子路径在校验失败时拒写并日志上浮。
### WP5 子代理后台/转录/恢复
1. **Background 消费**:`AgentSpec.Background=true` 时 factory 选择后台派生(squadadapter.SubagentFactory 与 delegate 工具同样语义:声明驱动,不再只靠模型参数)。`WorktreeIsolation/OutputSchema` 保持 declared-only,文档记为边界。
2. **独立转录**:每个子 run 落独立转录文件(`<data>/workspaces/<owner>/<conv>/subagents/<runID>/transcript.jsonl`,由 finishChild 从 messages 表按 run_id 导出 + 后续增量直写);父会话分区保持系统记录不变。SubLLMRunner 迁 exec.Backend 属 Q3,本 WP 不做(边界记明)。
3. **恢复**:`ReconcileInterrupted` 对子 run 不再只 seal——有存储请求与转录的子 run 标记 resumable,父会话下一轮空闲时提示/自动续跑(续跑=以原请求+转录起新子 run,接续语义写清);恢复测试补子代理场景。
4. **通知持久化**:notice 队列落盘(SQLite 表或 JSONL,随 runmgr 既有存储面),重启后重投未投递的后台完成通知;内存 map 只做热缓存。
### WP6 装配收口与 A/B 验收
1. app 装配复核:新端口/开关全部有默认关或行为不变证明;需要设置项的(如 Anthropic 原生端点 key 环境约定)进 settings Schema。
2. A/B 验收证据(写任务卡):① anthropic 录制夹具端到端(WP2-4);② 配对断言测试 + 既有 `TestCompactLeavesNoOrphanToolCall` 原样通过;③ `TestStdioSlowCancelThenEcho` 原样通过。三条全部 GATE(各仓 CI)+ Dev `make test` 收据。
3. 级联 pin 收齐、Dev gitlink PR、任务卡闭链。
## 三、验收总表
| 总提案验收 | 机器证据 | 所在 WP | 现状 |
|---|---|---|---|
| ① 选 anthropic 预设能完成一轮工具调用(录制 HTTP 夹具,不要求真实密钥) | `runtime/llm/testdata/anthropic/*` 夹具 + `TestAnthropicPresetToolRound`(端到端:tools 请求→tool_use→tool_result→终文本→签名往返) | WP2 | 未实现 |
| ② 压缩后的历史不出现孤立 tool_call | 库:`TestCompactLeavesNoOrphanToolCall`(既有,原样保持);产品:`TestTrimOldestKeepsToolPairs`(新,WP1-1) | WP1 | 库已修 / 产品侧仍开放 |
| ③ MCP 取消不再留下第二个读者 | `TestStdioSlowCancelThenEcho`(既有,`Readers()==1`,WP3 不得破坏) | WP3(回归引用) | 已满足 |
## 四、边界与非目标
- **不做** backend 直连路径的延迟工具层与 filestate 接线:该路径属 Q3 退役对象,避免双线建设;N2 的延迟工具成果经 agent-native 路径消费(已通)。
- **不做** `SubLLMRunner` 迁 exec.Backend(Q3 范围);WP5 的独立转录用产品侧导出实现。
- **不做** native.Options 单件重构(审计 N30);新端口不再往里加字段。
- **不做** MCP tasks/* 的完整产品映射(最小集 only:客户端面 + 中断取消);完整后台任务子系统归 N3。
- **不做** token 计费口径拆分(审计 N20 残余)、RunState/OTel/模型回退链/流重试——全部是 N3 范围。
- 激活工具不进 `Decls()` 保持现状(call_tool 间接层即设计)。
- 审计 N2(事件竞争)、N3/N18/N19(MCP)、N22(提醒角色)、N7/N8(压缩配对/并发)已修,仅引用不返工;审计 N4 随 WP2 关闭。
## 五、风险与回退
- **Anthropic 方言漂移**:以录制夹具锁定请求/响应字节形态,预设切换属行为变化——任务卡明示;回落手段:models.json 自定义指回 compat 端点(无需改码)。
- **skills 严格化拒旧内容**:bundled recipes 同 PR 修齐;用户/插件目录里的不合规技能从「静默可用」变「报错可见」——这是本 WP 的有意行为变化,验收时以插件演示技能全绿为门槛。
- **ctxasm 裁切语义变化**:整组同退可能多丢一条 assistant——以配对安全为优先;`Report.Truncations` 文案同步更新。
- **MCP 版本协商**:服务端低版本时必须逐字节回落现行行为(WP3-1 的回落用例为放行门槛)。
@@ -0,0 +1,170 @@
# 方案:N3 持久与可观测——现状核验与增量实施
日期:2026-10-07。上游:[2026-10-02-agent-stack-completion.md](2026-10-02-agent-stack-completion.md)「N3 持久与可观测」节(范围与三条验收的唯一权威)、[2026-10-02-agent-stack-audit.md](../records/2026-10-02-agent-stack-audit.md)(审计项逐条对当前代码复核后引用)。
基线 pin:agent-native `74aa60b`、backend `7980a8a`、agent-squad `6306451`、core `0b5c774`(均为已合入 main)。本文所有 file:line 以这些 SHA 为准;实施时先复核再引用。
依赖状态:N1/Q1/I1/I2/N2 全部闭卡(任务卡归档)。总提案依赖序「N3 在 N2 之后」满足,N3 开工。
## 一、现状核验(五路侦察 + 关键处亲验)
### 1. RunState 可恢复(验收①)
已就位(库层、native 适配路径):
- **意图日志**:`runOne` 先 `commitToolIntent`(记 CallID/参数/Replay 声明)再执行(runtime/loop.go:649-654,738-749;session/intent.go:9-25);执行失败于写意图即产 IsError 配对。
- **恢复配对**:`recoverPending`(loop.go:707-736)对未配对意图——存储声明与注册表现行声明**双 safe 才重放**(completion doc row 75 的不变式),否则补「副作用未知,未重试」IsError 配对。任一情形配对不变式都成立。
- **预算停配对**:`appendSkippedToolResults`(loop.go:452-469,N1 已修,回归 loop_budget_test.go:78)。
- **毒化轮转**:`rotateIfPoisoned` + `.native-last-failure` 落盘(adapters/native/backend.go:529-593,N21 已修,跨进程回归 r2_regression_test.go:19)。
- 回归测试:durable_test.go 四组(safe 重放一次/unsafe 不重放/存储 safe+现行 never 不重放/follow-up 持久序)。
仍开放:
- **崩溃窗口无保护**:`persist(assistant)`(loop.go:265)→ 首个 `commitToolIntent`(loop.go:650)之间被杀,转录留下带 tool_calls 的 assistant 且零意图;`recoverPending` 无计可施,新 user 消息追加在孤立尾巴后,下一个请求被提供方拒绝。**无任何与意图无关的尾部配对兜底**。
- **产品会话路径零持久**:`llm_direct.go:172-193` 调 `nruntime.Run` 不传 `Session`——意图日志/恢复配对在产品会话 run 上全部不生效;中断后部分 parts 只存内存,seal 即丢。**这是验收① 对产品的真缺口。**
- 无 mid-turn RunState 类型(turn 序号/在途调用/累计用量);`runtime/checkpoint` 是文件回滚日志,不是循环状态(checkpoint.go:13-22)。
- 无「杀进程中途」测试:现有 durable 测试手喂意图,没有覆盖 persist→intent 窗口。
- **N6 残余**:`Stop.Replacement` 仍把内存 assistant 改为替换文(loop.go:339-347),磁盘上 assistant 是原文——内存/转录分叉跨重启可见(追加的 user 替换消息只缓解了「模型能看到」)。
- **子代理优雅停机不续跑**:`InterruptRunning` 对所有子 run 写 `done.json{status:"interrupted"}`(runmgr.go:1658),而 `ResumeInterruptedChildren` 遇 done.json 即跳过(subagent_transcript.go:119)——WP5 续跑只对 SIGKILL 式死亡生效,优雅停机语义上反而不续。
### 2. 文件检查点可回滚(验收②)
已就位:
- 库 checkpoint 包:append-only JSONL(Record{Seq,Anchor,Root,Path,Existed,Before,After})、`Plan/Rewind`、内容漂移跳过(stateRestore/Already/Skip,checkpoint.go:194-229)、包注释与结构双重保证「shell/python 不追踪」。
- write/edit/multi_edit 三工具经 `WorkspaceToolsCheckpointed` 挂 mark(registry.go:370-394;builtin.go:111-117,153-168,333-353)。
- backend rewind:每会话 `.agentx/checkpoints.jsonl`(rewind.go:12-17)、anchor=用户消息 ID、HTTP 两路由(server.go:169-170)、regenerate 复用(borrow.go:218)、忙时 409。
- ZCode 边界全符合:只动文件不回滚历史(追加 system 消息而非删除)、不透明续跑(regenerate 显式起新 run)。
- 测试:checkpoint_test.go 两组、checkpoint_hook_test.go、rewind_test.go(backend 端到端)。
仍开放(收口项,无根缺):
- 回滚资格**隐式**(struct 有 mark 字段即入集):无导出断言/注册表查询,未来工具可静默入集或出集。
- `restore` 用 `os.WriteFile` 跟随符号链接(checkpoint.go:241)——fs_write_file 有符号链接防护(fs.go:142-146),回滚路径没有。
- `Rewind` 顺序恢复、首错即返(checkpoint.go:108):中途失败留下部分恢复,且部分态不进 Result。
- 无保留策略:`Record` 每次全读算 Seq(checkpoint.go:57-62),日志无界增长。
- HTTP 层无测试;root 移动、空 `ordered` 边界(selected() checkpoint.go:146)未测。
- backend 自家工具面只有 `fs_write_file` 挂检查点(tools/fs.go:158-162),无 fs_edit/fs_multi_edit(产品面不暴露编辑工具)——验收② 的 write/edit/multi_edit 语义在库与适配层成立,验收测试按层分配(见 WP3)。
### 3. Memory 端口
已就位(全是产品侧资产):`memory_entries` 表(migrate v13)+ `PutMemory/ListMemory`(platform.go:137,157,仅 INSERT、无 scope 过滤无语义排序);HTTP 手工面(server.go:245-246);被动 recall(runmgr.go:409-426 全量过期过滤 + ctxasm.InjectMemory ≤20 条注入系统消息);`session_note`、plans/todos;预置 prompts(aux-session-memory.md、agent-memory-extractor.md,**无消费者**);`AgentSpec.MemoryScope` 已解析(agentspec.go:26,152-153)**零消费**。
仍开放:库内零 memory 面(端口不存在);无写回路径(模型不可自服务,回合后抽取未接线);recall 无 scope 过滤;MemoryScope 无消费。
### 4. OTel GenAI span(验收③)
已就位:telemetry 包(Span/StartFunc/手写 OTLP HTTP JSON 导出,telemetry.go:18-106);**`publicAttrs` 拒绝名单丢 prompt/messages/content 且被测试钉住**(telemetry.go:53-62,89;telemetry_test.go:35-41)——验收③「默认不含提示词正文」已满足且有机器证据;Trace 钩子三处 span(loop.go:174 invoke_agent、:407 chat、:655 execute_tool);backend 全线注入(app.go:87,258,284-285 → llm.go/sub_loop)。
仍开放:
- **span 名无后缀**:约定是 `chat <model>`/`execute_tool <tool>`/`invoke_agent <agent>`,现名裸词。**这是验收③ 的主缺口。**
- 属性未 `gen_ai.*`:缺 `gen_ai.system`、`gen_ai.request.model`、`gen_ai.tool.name`、`gen_ai.usage.input_tokens/output_tokens`(token 在循环有,从未进 span)。
- 无 trace 关联:每 span 随机新 TraceID(telemetry.go:33),无 parentSpanId,Span 无 Parent/Status/Kind 字段。
- 配置面只有环境变量 `OTEL_EXPORTER_OTLP_ENDPOINT`(telemetry.go:30),无 settings 项。
- resource 无 `service.name`;导出错误丢弃(:46);属性值全 string(token 应 intValue)。
### 5. 成本「上一请求/累计」
已就位:`Usage.Last*` 三字段(types.go:90-99)+ 循环覆盖(loop.go:262-264);预算检查用 `LastPromptTokens`(loop.go:872-873,正确——prompt 成本按整段历史计);`message_end` 事件带单请求值(loop.go:269)。
仍开放:cache tokens 从不累计(loop.go:259-264 只动 Prompt/Completion/Total);`"usage"` 事件只带累计(loop.go:853-855,且 budgetStop/错误路径不发);`core.Usage` 无 Last*/cache 字段(modules/core model.go:205-213);**子代理 run 零 token 记录**(runmgr.go:1399 只记 DurationMs;sub_loop 不调 AddUsage);前端只显示 total(AgentTracker.tsx:79-83);无逐请求台账。completion 预算用累计(loop.go:875)经复核为**正确语义**(run 级输出预算),不动。
### 6. 模型回退链(基本已修,剩收口)
已就位:库 `WithFallback`(llm/fallback.go:7-47——5xx 且未出增量才切换,测试 fallback_test.go 三组);backend `ChatFallbacks` 解析(model.go:65-81)+ 消费(llm_direct.go:103、sub_loop.go:61 chat 档子代理)+ `noteModelSwitch` 通知与 servedModel 落账(llm_direct.go:210-240)。回退条目共享主端点(记录为有意)。
仍开放(收口项):verifier 与 lightweight 档未接;切换无可观测事件类型(仅 process part 文案);agent-native CLI 未用 WithFallback。
### 7. 流式错误默认重试
已就位:`WithRetry`(providers.go:447-524——Retryable 分类 408/429/529/≥500 与容量文案、Retry-After 上限 30s、指数退避加抖动、**只在未出增量时重试**、上下文溢出不重试;providers_test.go 五组钉住);backend `runtime.llmRetries` 默认 2 接直连(llm.go:208-209;settings.go:43,94);agent-native CLI 接 2 次(main.go:121)。
仍开放:**库循环无默认**——重试是宿主 opt-in,子代理/verifier/squad 路径未接(`sub_loop.go:52-59` 无 WithRetry);`onEvent` 为 nil,重试不可观测;run 记录无重试次数。
## 二、工作包划分
| WP | 内容 | 主要仓 | 对应验收 |
|---|---|---|---|
| WP1 | RunState 收口:崩溃窗口尾部配对兜底 + 杀窗口测试 + N6 残余 + 子代理优雅停机续跑语义 | agent-native + backend | ①(库层) |
| WP2 | 产品会话路径持久化:llm_direct 接 Session(transcript.jsonl),产品会话 run 获得意图日志与恢复配对 | backend | ①(产品层) |
| WP3 | 检查点收口:资格断言、符号链接防护、部分恢复进 Result、保留策略、HTTP 与边界测试 | agent-native + backend | ② |
| WP4 | OTel GenAI 对齐:span 名后缀、gen_ai.* 属性、trace 关联与 parent、resource、settings 面 | agent-native + backend | ③ |
| WP5 | Memory 端口:runtime/memory 包 + 循环 recall 消费点 + MemoryScope + backend scope 实现 + memory_write 工具 | agent-native + backend | — |
| WP6 | 计费拆分与回退/重试收口:cache 累计、usage 事件与 run 记录带 Last*/cache、子代理 token、库默认重试、可观测事件 | agent-native + core + backend + frontend | — |
依赖:WP1 先行(验收① 库层核心,WP2 依赖其兜底语义);WP2 随后(产品落点);WP3/WP4/WP5 独立可并行;WP6 收尾(含 core 字段级联与重试语义变化,WP6 后做总装与 A/B)。每 WP 走既有链式(库 PR → 级联 → backend PR → Dev gitlink PR),逐 WP 合入。
### WP1 RunState 收口(验收① 库层)
1. **尾部配对兜底**:`recoverPending` 之后加 `repairOrphanTail`——Load 后若活动分支尾部是带 tool_calls 的 assistant 且其 ToolCalls 存在无结果项,对每个无结果调用补一条 `tool` 消息(`Content: "进程中断,该调用未执行"`, IsError: true)并 persist。与意图路径正交:意图已配对的调用不受影响(按 CallID 判重)。这样无论死在哪个窗口,下次 Run 前转录配对恒成立。**这是验收① 的机器核心。**
2. **杀窗口测试**:循环测试钩子(在 persist(assistant) 之后、首个 intent 之前让测试能停住循环,或直接构造该转录形态——两态都测:窗口内死亡(无意图)与执行中死亡(有意图未配对)),断言:恢复后 assertToolPairs 双向成立 + 兜底结果文案正确 + 已配对项零重复。
3. **N6 残余**:`Stop.Replacement` 不再改内存 assistant(只追加 user 替换消息)——内存与转录一致;`loop_harness_test.go:17-63` 同步改断言(替换文案不再出现在 res.Messages 的 assistant 上,而是新 user 消息)。行为变化入卡。
4. **子代理优雅停机续跑语义**:done.json 按 status 分流——`completed/failed/cancelled` 挡续跑;`interrupted` 不挡(优雅停机=可续跑现场)。`ResumeInterruptedChildren` 改判据并补回归(模拟 InterruptRunning 路径后仍被续跑一次且仅一次)。
### WP2 产品会话路径持久化(验收① 产品层)
1. `llm_direct.go` 的 `directRun` 打开会话工作区 transcript:`<workspaceRoot>/<owner>/<conv>/.agentx/transcript.jsonl`,经 `runtime.Session` 传入 `nruntime.Run`——产品会话 run 获得意图日志、恢复配对与(WP1-1 的)尾部兜底。
2. 历史来源对齐:现 `History` 来自 store 重放;Session 模式以 transcript 为准(库语义:Session 非空时 transcript 是权威,History 仅在 transcript 为空时作种子——llm.History 的既有语义 loop.go:76-78)。迁移语义:首次启用时 transcript 为空 → 用 store 历史种子;此后 transcript 权威。种子与续接的一致性测试(不丢不重)。
3. **不做透明续跑**(ZCode 边界,入卡):`ReconcileInterrupted` 对会话 run 仍 seal interrupted;配对修复在下一条用户消息触发的新 run 前完成(WP1-1 兜住),用户看到的是「中断」标记 + 可继续对话,不是自动重跑。
4. 端到端测试:产品路径杀窗口形态 → 新 run 前配对成立 + 用户可继续发消息(种子不丢历史)。
### WP3 检查点收口(验收②)
1. **资格断言**:导出 `Registry.Checkpointed(name) bool`(struct mark 非空即真)或同语义测试辅助;测试钉住入集集合恰为 {write_file, edit_file, multi_edit}(库)与 {fs_write_file}(backend 自家面),防静默漂移。
2. **符号链接防护**:`restore` 落盘前 `Lstat`——目标为符号链接时跳过并进 Skipped(与 fs_write_file 的防护同语义)+ 测试。
3. **部分恢复进 Result**:`Rewind` 单文件失败不中止,记录 `Failed []string` 续跑其余;Result 增字段(additive);测试(一个失败一个不失败)。
4. **保留策略**:按 anchor 裁剪——`Log.Compact(keepAnchors int)` 只保留最近 N 个 anchor 的记录(重写日志文件);backend 在 RewindFiles 成功后以 keepAnchors=200 调用;`Record` 的 Seq 改由文件尾行号维护(去全读)。
5. **测试补齐**:HTTP happy + busy 409(server 层);root 移动场景(restore 按记录内 Root 恢复,不窜根);空 `ordered` 边界行为钉住;「外部同字节改写」分类为 Already 的语义钉住。
### WP4 OTel GenAI 对齐(验收③)
1. **span 名带后缀**:`invoke_agent <agent|agent-native>`、`chat <model>`、`execute_tool <tool>`(loop.go 三处改名;适配器/宿主传 agent 名——invoke_agent 的 agent 名用 Config.ExecutionID 或新增 Config.AgentName,默认 "agent-native")。
2. **`gen_ai.*` 属性**:`gen_ai.system`(openai/anthropic,由客户端协议名上抛——Stream 事件或 Config 显式字段,取后者简单:`Config.ProviderName string`,宿主可设,空=openai);`gen_ai.request.model`(chat span);`gen_ai.tool.name`(execute_tool span);`gen_ai.usage.input_tokens/output_tokens`(chat span 结束时由该轮 Usage 填入)。
3. **trace 关联**:一次 Run 共享一个 TraceID,`invoke_agent` 为根、`chat`/`execute_tool` 为其子(parentSpanId)。Trace 钩子签名扩展:`Trace func(name string, attrs map[string]string) func()` 保持,Span 增 ParentSpanID/TraceID 注入位(telemetry.StartFunc 返回的闭包按 name 层级维护栈——invoke_agent 入栈为根,出栈弹出;简单确定性强)。
4. **resource 与导出**:resource 增 `service.name=agent-native`(宿主可覆盖:telemetry.StartFunc 的选项参数);token 属性 intValue;导出失败记日志(不静默吞)。
5. **settings 面**:`telemetry.otlpEndpoint`(默认 "" = 不导出,保持现状语义;环境变量继续有效,settings 覆盖环境);`telemetry.serviceName`(默认 agent-native)。两处 default 的行为不变证明测试。
6. **测试(验收③ 机器证据)**:span 名后缀与属性键枚举断言(钉住约定);一次 Run 的 span 共享 TraceID 且 parent 链正确;token 进 chat span 且为 intValue;拒绝名单保持(prompt/content 永不序列化——既有测试原样通过)。
### WP5 Memory 端口
1. **runtime/memory 包**:`Entry{ID,Scope,ProjectID,Type,Content,Source,Confidence,CreatedAt,ExpiresAt}` + `RecallQuery{Scope,ProjectID,Limit}` + `Store interface{ Recall(ctx,q) ([]Entry,error); Append(ctx,e Entry) error }`。端口形态对齐 squad/runstore.go 的先例(库定义+宿主实现)。
2. **循环消费点**:`Config.Memory memory.Store`(nil=不启用)+ `Config.MemoryScope string`(对应 AgentSpec.MemoryScope 的消费);`prepareRequest` 时在系统前缀后追加 recall 注入块(替换文案形态与 ctxasm.InjectMemory 对齐:`[记忆]\n- (typ) content`,上限 20 条,确定性排序)——行为对齐测试(端口注入的条目出现在请求里、nil 时无变化)。
3. **backend 适配**:`storeMemory{st, owner}` 实现端口(Recall=ListMemory scope/过期过滤+Limit;Append=PutMemory);`llm.go` 装配把现 `Memories()` 断言路径(llm.go:231-233 + runmgr.go:409-426)迁到端口(语义等价:同条目同排序同文案——迁移前后注入文本一致的对照测试)。`AgentSpec.MemoryScope` 经 squad/native 适配传入 Config.MemoryScope(plugin agents 的画像驱动 scope)。
4. **memory_write 工具**:库内工具(模型自服务写回;参数 {scope,type,content,expires_in_days?},经 `Config.Memory.Append` 落库;未配置不注册);scope 校验(user|project)与类型校验(fact|preference|decision|episode|procedure)fail-closed。
5. 后续项(入卡剩余项,不在本 WP):回合后抽取接线(agent-memory-extractor 子代理 + SessionEnd 事件驱动)、AllowStore 持久化形态(N1 deferred)。
### WP6 计费拆分与回退/重试收口
1. **cache tokens 累计**:loop.go:259-264 增 CacheRead/Write 累计与 Last* 对应位(Usage 增 LastCacheReadTokens/LastCacheWriteTokens?——决策:Last* 只对 Prompt/Completion/Total 已有三字段,cache 只入累计位,避免字段膨胀;记录决策依据)。
2. **usage 事件与 run 记录**:`emitUsage` 带 Last*+cache;settle 之外的路径(budgetStop/错误)也发一次终态 usage(口径=当时累计,标注终止原因在既有错误面);`core.Usage` 增 `LastPromptTokens/LastCompletionTokens/CacheReadTokens/CacheWriteTokens`(additive JSON,core 仓 PR+级联);backend AddUsage 链路上抛新字段;**子代理 token 记账**(sub_loop AddUsage 接线,finishChild 写入 child.Usage 的 token 字段)。
3. **前端**:contracts.ts Usage 增可选字段;UsageBadge 显示「上一请求 / 累计」(如 `+12.3k · 累计 98.1k`)。
4. **库默认重试**:`Config.RetryAttempts`(默认 2,0=关)——`Run` 内包装 `cfg.Stream = llm.WithRetry(cfg.Stream, attempts, onEvent)`;backend 直连的显式包装退役(防双重),子代理/verifier/squad 经库默认获得(行为变化:这些路径从 0 次变 2 次重试——入卡;onEvent 接 runCtx 事件面,`auto_retry_start/end` 成为可见事件)。
5. **可观测**:`auto_retry_start/end` 与 `model_fallback_switch` 事件类型入事件面(库 Event 类型 + backend 映射 + 前端展示沿用现有 process part 形态)。
6. **回退链接 verifier/lightweight**:verifier 的流包 WithFallback(lightweight 档回落主档的既有语义不动);CLI 记录边界(不接)。
## 三、验收总表
| 总提案验收 | 机器证据 | 所在 WP | 现状 |
|---|---|---|---|
| ① 回合中途杀进程,恢复后工具配对仍成立 | 库:`TestResumePairsOrphanTailAfterCrashWindow`(无意图窗口)+ 既有 durable 四组(原样保持);产品:`TestDirectRunPairsAfterKillSeed`(种子不丢+配对成立) | WP1+WP2 | 库有意图路径覆盖、窗口无保护;产品零持久 |
| ② 回滚只撤销 write / edit / multi_edit | 资格集合钉住测试(库 {write_file,edit_file,multi_edit}、backend {fs_write_file})+ 既有 rewind/checkpoint 测试原样通过 + shell 文件存活断言(既有) | WP3 | 结构性成立、断言隐式 |
| ③ span 名与约定一致,默认不含提示词正文 | `TestSpanNamesFollowGenAIConvention`(名称后缀+gen_ai.* 键枚举+intValue token+TraceID 共享+parent 链)+ 既有 publicAttrs 拒绝名单测试原样通过 | WP4 | 正文拒绝已有;名称/属性/关联未对齐 |
## 四、边界与非目标
- **不做透明续跑**(ZCode 边界):配对修复后等新用户消息;会话 run 仍 seal interrupted。WP5 子代理续跑(重派新 run)是既有有意设计,不扩展到会话 run。
- **不回滚对话历史**(ZCode 边界):rewind 只动文件,WP3 不碰消息面。
- **不做** memory 回合后抽取接线、AllowStore 持久化、RAG 语义检索 memory_entries(WP5 是端口与接线,召回排序升级留后续)。
- **不做** OTel SDK 引入/gRPC/batch/采样(保留手写 HTTP JSON 导出;WP4 只做语义对齐与可靠化小修)。
- **不做** completion 预算口径改动(loop.go:875 经复核为正确语义)、prompt 预算口径改动。
- **不做** 回退条目独立端点(共享主端点记录为有意)、CLI 的 fallback 接线(记录边界)。
- 审计 N1/N21 已修只引用;N6 随 WP1 关闭;N20 随 WP6 关闭(预算语义不动,展示/记录口径拆分)。
## 五、风险与回退
- **产品路径接 Session(WP2)**:transcript 成为权威是会话语义变化——种子迁移必须保「不丢不重」(WP2-2 的对照测试为放行门槛);出问题回退 = 不传 Session(单点开关,代码内常量而非设置项,回退 PR 即可)。
- **N6 行为变化(WP1-3)**:Stop.Replacement 的展示形态变化(assistant 不再显示替换文,替换文以 user 消息出现)——guardrails 消费方(verify 回路)逐一回归。
- **WP6 重试默认化**:子代理/verifier/squad 从 0 变 2 次重试——超时/配额消耗上升;`RetryAttempts=0` 可全关(测试钉住 0=不重试)。
- **core.Usage 加字段**:additive JSON 兼容旧记录;级联链 core PR → backend PR → frontend PR → Dev。
- **done.json 语义分流(WP1-4)**:interrupted 从「挡续跑」变「可续跑」——优雅停机后重启会多一次重派;幂等由 resumed.json 保证,测试钉住「一次且仅一次」。
@@ -0,0 +1,100 @@
# 方案:Q2 拓扑 + Q3 收敛与互通——现状核验与增量实施
日期:2026-10-07。上游:[2026-10-02-agent-stack-completion.md](2026-10-02-agent-stack-completion.md)「Q2 拓扑」「Q3 收敛与互通」节(范围与验收的唯一权威)、[2026-10-01-agent-harness.md](2026-10-01-agent-harness.md) P4 裁定(Q3 行为等价的判据原文)。
基线 pin:agent-squad `c462bc4`、agent-native `1ac21c6`、backend `6e02a1f`、core `a253a40`(均为已合入 main)。本文所有 file:line 以这些 SHA 为准;实施时先复核再引用。
依赖状态:N1/N2/N3/Q1/I1/I2 全部闭卡。总提案依赖序「Q3 在 Q2、N1、I1 之后」满足。两阶段各自单独任务卡(本文覆盖两个方案;Q2 先实施,Q3 在 Q2 闭卡后开工)。
## 第一部分:Q2 拓扑
### 一、现状核验(三路侦察)
引擎面:只有 `standard`/`leader` 两个 mode(engine.go:94-96,383-400,RunMetadata.Metadata 字符串),**无拓扑抽象**。Q1 图层可表达 sequential(graph.go:62-68 链式默认)与 parallel(Parallel/Needs 同层 + 写集串行,graph.go:56-61,165-182);环 fail-closed(graph.go:71-73)。router 只有 pre-plan 分诊(router.go:24-52)。leader 有 delegation 循环(leader.go:180-385)但账本只有 `Delegations`(leader.go:51-66),无卡顿检测;轮次上限有(MaxLeaderTurns=8,termination.go),**无独立重规划上限**;leader 绕过图循环直接 runOneStep(leader.go:328-341)。Termination 的 Cond/And/Or 组合子(termination.go:59-120)已建但**休眠**(只有测试消费)。`FactItem.Verified`(models.go:148)声明未用。
mailbox 攻击面:`RespondDecision`(hitl.go:99-108)**无 actor 归属**——任何能调 `engine.Respond` 的调用方发 `Choice:"approve"` 都清权限门。现有防线:fireWakeup 只自动决 gap/escalation(engine.go:1216-1227,回归 TestWakeupDoesNotApprovePermission)、自由文本不决议 choice 门、过期只合成 fail/cancel、wakeup 上限自动 abort。mailbox 若经 Respond 投递或扩 fireWakeup 白名单即破防。
review 等价基线(backend runReview,review.go:41-92):并行 N finder(semaphore 3,真并发被 review_test.go:16-33 钉住)→ 宽松 JSON 解析(首 `[` 末 `]`,丢空 issue)→ 按 (location,issue) 去重、上限 10 → 每条独立 verifier(VERDICT: PASS/FAIL/PARTIAL 尾行判定)→ 只留 PASS(fail-closed)→ severity 稳定排序 → 报告恒带「已丢弃 N 条未验证」。squad 侧今天只有质量 Checker+修复预算(单轮),无此拓扑。
task-board/long-running:平台 SQLite 队列有 claim/lease/heartbeat/orphan 恢复(adapters/sqlite/queue.go:133-348)但未接 Steps 图;checkpoint 三档+图连续性+run 锁已就位(runstore.go:94-212)。conformance 基建齐全:scriptBackend/replayBackend/leaderScriptBackend + MockPlanner(engine_test.go:13-80、conformance_test.go:19-47、leader_test.go:15-90)。
### 二、设计决策
1. **拓扑一等化但不做大重构**:`Blueprint` 与 `RunOptions` 增 `Topology string`(空 = 现行 standard 图,零行为变化);`squad/topology.go` 注册内置拓扑名与各自 Spec。图可表达的(sequential/parallel/loop/router/evaluator-optimizer/long-running)编译为 Steps+引擎旗标;需要独立驱动的(leader 增强/review/group-chat/task-board)走驱动分支;handoff/mailbox 是**跨拓扑原语**(任何拓扑可用)。
2. **loop 不做图环**:保持环 fail-closed。`StepSpec.Loop *LoopSpec{MaxIterations, UntilField, UntilEquals}`——步骤完成后条件不满足且预算未尽时**重置为 pending 再武装**(推广 rerunForRepair 语义);预算走 Termination(唤醒休眠的 Cond 组合子)。
3. **router 进图**:`StepSpec.Branches []Branch{When{Field,Equals}, Then []stepID}`——router 步完成后按黑板字段/步骤输出判定,未选中分支的步骤置 skipped(skipped=依赖已满足,join 步照常推进)。
4. **mailbox 的防线是构造性的**:投递路径**永不经过 Respond**;同时给 `RespondDecision` 加 `Actor`(human/system/agent,空=human 保持既有调用方语义),`applyDecision` 对 permission/confirmation/quality_review 三类门拒绝非 human 的 choice 决议(双保险)。
5. **review 等价以报告字节形态为判据**:squad review 驱动复用 backend runReview 的解析/去重/判定/排序/文案常量(同一格式串),conformance 断言与 review_test.go 同款(并发找、去重后逐条验、丢弃计数、severity 序)。
6. **task-board 做 squad 侧原语**(claim/lease/complete + 依赖门),语义与平台队列对齐;平台队列桥接记为后续项(completion doc 的「platform 队列改成 task-board」在桥接层,非本 WP 阻塞)。
### 三、工作包
| WP | 内容 | 验收对应 |
|---|---|---|
| Q2-WP1 | 拓扑面 + 图可表达五件:Topology 字段与注册表;sequential/parallel conformance;loop 再武装(LoopSpec+Cond 预算);router 分支(Branches+skipped);evaluator-optimizer(loop 复合:draft→evaluate→MinScore 不达标再武装,MaxRounds 预算);long-running(Deadline 打包进 terminationOf + checkpoint 组合 conformance) | 验收一(6/12 拓扑) |
| Q2-WP2 | leader 增强 + mailbox:进度账本(Progress 条目+卡顿检测 StuckTurns)、重规划上限(Replans/MaxReplans 独立于 MaxTurns,触顶降级收口);mailbox 原语(RunState 邮箱、PostMessage、步前投递进任务书、永不触 Respond)+ RespondDecision.Actor + 非 human 决议拒绝 | 验收一(8/12)+ 验收三 |
| Q2-WP3 | review + handoff + group-chat:review 驱动(并行 finder→解析去重→逐条 verify→fail-closed 过滤→等价报告);handoff 原语(StepSpec.Handoff、所有权转移记录、finalize 取链尾输出、目标收过滤历史);group-chat 驱动(共享转录、轮转/主持人选人、预算停机) | 验收一(11/12)+ 验收二 |
| Q2-WP4 | task-board + 收口:claim/lease/complete 原语与依赖门、孤儿租约再武装;全 12 拓扑 conformance 汇总跑;级联(backend 嵌套 pin → Dev) | 验收一(12/12) |
conformance 统一形态:脚本化后端(scriptBackend/replayBackend/leaderScriptBackend 家族扩展),零模型零网络;每拓扑一个 `TestTopologyConformance_<name>`。
### 四、Q2 验收总表
| 总提案验收 | 机器证据 | WP |
|---|---|---|
| 每种拓扑有一个脚本化后端的 conformance | 12 个 TestTopologyConformance_*(sequential/parallel/loop/router/leader/handoff/group-chat/review/evaluator-optimizer/long-running/task-board/mailbox) | WP1-4 |
| review 等价于今天的「并行找问题、逐条验证、丢掉未验证」 | review conformance 断言与 backend review_test.go 同款:finder 真并发、去重后 verify 调用数=unique 数、只留 PASS、「已丢弃 N 条未验证」计数、severity 序 | WP3 |
| mailbox 消息不能把挂起的权限批准掉 | TestMailboxCannotApprovePermission(挂 permission 门→投「approve」消息→门仍挂起)+ TestWakeupDoesNotApprovePermission 原样通过 + Actor 拒绝路径测试 | WP2 |
### 五、Q2 边界与非目标
- 不改 leader 绕过图循环的执行形态(记为已知债,统一驱动属后续重构)。
- 平台队列桥接、backend review_findings 切换到 squad review 拓扑:后续项(Q3+ / RDM 阶段按需)。
- group-chat 的发言人策略只做轮转与主持人两种(脚本可判定);LLM 选人策略不进库。
- Termination Cond 组合子被 loop/long-running 唤醒后,既有标量路径不动。
## 第二部分:Q3 收敛与互通
### 一、现状核验
WorkflowDef 在 core(plugin.go:56-84):六类步骤(prompt/tool/hitl/artifact/card/script)+ StepCritic,**无条件分支字段**;golden 样本 workflow_def.json。执行器 `runtime/workflow.go`(步循环 125-200、critic 重试 202-244、prompt 步压 SpawnSubagent 312-334)+ `workflow_script.go`(脚本宿主 38-56、限额 19-24、DeniedTools 180)。数据层 `internal/workflow/`(registry/render/validate,P4 上限 11-16)。**「压成 SpawnSubagent」退役对象**:squadadapter stepBackend "agent-system"(adapter.go:150-212,DefaultBackend adapter.go:79,内置四角色全部 agent-system 380-392)。
P4 裁定原文(agent-harness.md:102-112):声明式 ≤20 步;模型生成 ≤8 步、禁 script、执行前必须确认;critic 每步 ≤3(缺省 1)、整条 ≤6、无法解析按不通过;脚本回调 ≤50、单行 ≤1MB、超时 600/1800s 含等人;`runtime.workflowScripts` 默认关;模型脚本必须确认、**插件脚本免确认**;脚本禁 run_python/run_shell/run_workflow/派发类;小队入口无 run_workflow。代码落点齐全(validate.go:11-40,80-83;workflow.go:64-76;workflow_script.go:26-28,38-56,103-115)。
demo 插件在 Dev 仓根 `plugins/example/`:demo.brief(意图 demo.brief,五步:hitl choice→prompt+critic「核对标记:P4」→artifact→card→hitl confirm)、demo.script(单 script 步 → demo.py:wf.tool/wf.ask/wf.artifact/wf.step)。host_test.go:214-256 直接装载它。
a2a:**全仓不存在**,从零建(规划位置 agent-squad/adapters/a2a 独立 go.mod;A2A 1.0 Agent Card/任务状态机对齐,completion doc:54,102,239)。默认执行后端:`runtime.entry` 默认 direct(settings.go:39,灰度注释);direct 已跑 agent-native 内核;squad 工具路径默认后端 "agent-system"(要切);RunEntry 已是 agent-native(entry.go:103)。A/B:eval/switch.go 的 DecideSwitch 骨架 + N1 wp5_ab_test.go 先例;缺「同批任务双跑记录差异」harness。委派模板:内核 SubagentFactory 已有 目标/输入/可写范围/非目标/完成判据/交付物(adapter.go:299-343),**缺「输出格式」与「工具面」**两节。
### 二、工作包
| WP | 内容 | 验收对应 |
|---|---|---|
| Q3-WP1 | 编译器:core.WorkflowDef → squad Blueprint/Steps(prompt→agent-native 角色步、hitl→RequiresApproval/intent 步、tool/artifact/card→宿主工具步、script→codeorch 宿主步、critic→Checker+MinScore+RepairBudget;P4 全部上限与 DeniedTools 迁入编译器;计划确认与模型脚本确认保留、插件脚本免确认、workflowScripts 开关保留) | demo.brief/demo.script 经编译图跑通 |
| Q3-WP2 | 退役与切换:删 internal/workflow 数据层执行依赖、runtime/workflow.go+workflow_script.go 退役(run_workflow 三分支改投编译图)、stepBackend "agent-system" 删除、DefaultBackend→agent-native、runmgr WorkflowRunner 分支移除 | P4 行为一致(步数上限/确认/脚本开关逐项测试) |
| Q3-WP3 | 委派模板补全:任务书增「输出格式」「工具面」两节(SubagentFactory 与 stepBackend 遗产路径统一);adapter_test 任务书断言扩展 | 委派模板含目标、输出格式、工具和边界 |
| Q3-WP4 | adapters/a2a(新模块):Agent Card 发布(描述本团队能力)+ 远端智能体 Executor 客户端(A2A 任务状态机对齐 ExecResult);双向 conformance(本地起假 A2A 服务端) | adapters/a2a 双向 |
| Q3-WP5 | A/B 对照与默认后端:任务级 direct vs squad(编译图) 双跑 harness(扩 eval/switch.go),同批任务(含 demo.brief 场景)记录差异(不要求字节级相同);DecideSwitch 达标则 runtime.entry 默认切 squad 的证据入卡 | A/B 对照记录差异 |
| Q3-WP6 | 级联闭链 + 任务卡验收证据 | — |
### 三、Q3 验收总表
| 总提案验收 | 机器证据 | WP |
|---|---|---|
| demo.brief 与 demo.script 经编译后的图跑通 | 装载 Dev 仓 plugins/example → 编译 → squad 引擎(脚本化后端)跑通两个工作流的 conformance | WP1 |
| 行为与 P4 裁定一致(步数上限、确认、脚本开关) | 逐项测试:20/8 步上限、3/6 重试、计划确认卡、模型脚本确认、插件脚本免确认、workflowScripts 默认关、DeniedTools、小队入口无 run_workflow | WP1-2 |
| A/B 对照记录差异,不要求字节级相同 | eval harness 输出差异报告入任务卡(DecideSwitch 判定 + 差异清单) | WP5 |
### 四、Q3 边界与非目标
- `runtime.entry` 默认值切换本身是**设置变更**:A/B 达标后由 WP5 证据支持、在卡上记录,若 DecideSwitch 不达标则保持 direct 并记录差异(验收只要求「对照记录差异」)。
- a2a 只做库层双向(Card 发布 + Executor 客户端 + 假服务端 conformance);产品暴露 A2A 端点属后续。
- 平台 task 队列翻译成 squad run(更深的产品合一)不在 Q3(completion doc 归 Q 系列后续)。
- internal/workflow 的**数据形态**(WorkflowDef 校验/渲染语义)迁入编译器后原包删除;golden 契约样本随迁。
## 五、风险与回退(两阶段共用)
- **Q2 loop 再武装**与修复重跑共用重置语义:以「预算独立计数」隔离(loop 迭代不占 RepairBudget),测试钉住互不侵占。
- **Q2 router skipped 传播**:skipped=依赖满足的既有语义使 join 步在分支未选时照常推进——conformance 钉住 join 行为,防止「全分支跳过导致空转完成」被误判成功(报告需列 skipped 分支)。
- **Q3 退役面大**:以「编译器先行、双轨并行一个增量、退役单独增量」推进;退役 PR 前 demo 插件双轨对照(旧 runner vs 编译图)记录差异。
- **Q3 默认后端切换**:行为变化门禁是 A/B harness,不达标不切(settings 默认值不动即回退)。
- mailbox/Actor 默认值兼容:空 Actor=human 保持全部既有调用方与测试语义不变(新增拒绝路径只影响显式非 human)。
+250
View File
@@ -0,0 +1,250 @@
# 研发记忆与体系文档智能体:大阶段目标与实施方案(RDM 阶段总案)
状态:**proposed(2026-10-07)**;owner:weichen;主任务:Dev 仓 `feature/rdm-phase-plan`。
愿景依据:《智能体系统/further-objective》01–13(产品愿景文档,未入库;方案 10 已复制到下游仓 `Agent-System-RDM` 的 `docs/` 作奠基文档,本文以「愿景 01/02/03/04/08/10/11/12/13」引用)。
上游:[2026-10-02-agent-stack-completion.md](2026-10-02-agent-stack-completion.md)(库分期)、[2026-10-07-agent-stack-n1q1i1-plans.md](2026-10-07-agent-stack-n1q1i1-plans.md)(N1/Q1/I1 实施方案)。
规范依据:Development-Guidelines(workflows/delivery.md、standards/collaboration.md、standards/verification.md);本文是项目级消费,不复制其正文。
本文把 further-objective 描述的最终系统立为本系统下一个大阶段的目标,设定大方向与架构不变量,给出里程碑对齐的实施方案。本文不实施代码;各阶段的实现各走各的任务卡。
---
## 1. 大方向与大目标
### 1.1 一句话目标
把通用智能体基座二次开发为「**面向医疗器械研发企业的研发记忆与体系文档智能体**」:把项目全周期的一切资料持续沉淀为可追溯的研发记忆,让体系文档随项目推进渐进式清晰,并以人在环路的确认机制保证每一步受控(愿景 02 §1)。产品形态为三栏 + 卡片流 + 弹出层(愿景 05/06),数据心智为两树一网:笔记树 + 文档树 + 追溯网(愿景 08)。
按新口径里程碑推进(愿景 10 §10.1,W1 = 2026-10-05~10-11):
| 里程碑 | 窗口 | 内容 |
|---|---|---|
| MS0' | W1(本周) | 需求定稿、双仓就位、决议闭环、v0.1.0 评估基线 tag |
| v0.2.0 发版 | W2 末,最迟 W3 末(10-25) | 基座含 EXT-1,SurfaceVersion 2.0.0-experimental |
| MS1 | W4(11-01) | 上传五步法 + 两速入库端到端 |
| MS2 | W7(11-22) | 文档基线 + 三分类比对 + 版本链 |
| MS3 | W11(12-20) | 两树一网 + 变更闭环 + 一键生成(结构事件日志先行) |
| MS4 | W16(2027-01-24) | 自举全程运行、可对外演示(依赖 EXT-3 渠道) |
### 1.2 三条架构不变量(大方向的约束)
**INV-1 双仓纪律(二次开发原则)。** 领域逻辑(两树一网、模板、流程骨架、法规双通道、上传管道)只住在下游仓 `Agent-System-RDM` 与声明式插件规格里;基座(本仓五仓组合)只经「**扩展点申请 → 基座实现并发版 → 下游升级**」演进(愿景 10 §1.1、§七.1)。下游只 import `pkg/extension` 与 core 类型、不碰 internal;改基座 internal 的补丁一律拒绝。
**INV-2 可退化不变量(退回通用智能体)。** RDM 的一切能力——命令处理器、意图规格、工作流、技能、页面、卡片、任务——以插件/声明式规格为唯一承载形态,挂在一个装载开关下。**禁用(或移除)RDM 插件时,系统行为恒等于基座发布物本身**:RDM 路由回落到普通回合、命令/页面/卡片不出现、既有通用场景全通。数据不删(下游自有库表,schemaVersion 自管迁移),重新启用即恢复可见。基座仓的任何 diff 不得出现 RDM 领域字样,评审与 CI 双重检查(见 §3.2)。
**INV-3 证据与验收纪律。** 沿用 AGENTS.md「证据与验证门禁」:声明 ≠ 能力,每个里程碑的验收都是命令 × 对象 SHA × 可复核输出;任务卡、PR、证据收据随分支走;CI(PR HEAD 上 `make test`+`make build`)是测试通过的权威源。
### 1.3 与库分期(基座演进线)的关系
库分期(N1/Q1/I1 → N2/N3/Q2/Q3/I2)是「小队骨架执行、意图分层识别(规则→语义→LLM 的快慢分层)、恢复可靠性」的地基,**服务 RDM 但不阻塞 MS1**。它们的第一批真实消费者:
- MS3 一键生成 ← Q1 图执行、Q3 编排收敛(愿景 03 F4、M10);
- 意图命令化与快慢分层(愿景 03 交互与意图层)← I1/I2;
- 长任务可恢复(愿景 SR-E5/F4 长任务异步)← N3、Q1。
排布原则:库分期按既定方案推进(N1 → Q1/I1 并行 → 后续),在 MS3 窗口前给出最迟合入点(§4.4)。
---
## 2. 现状基线(2026-10-07 实测)
> **历史快照注记(2026-10-08)**:本节为 2026-10-07 撰写日快照,其中三处已随后游
> 密集交付失效(下游功能为零、库分期进度、O1/O3/O7 阻塞)。原文保留不改写,
> 逐行复核与现行状态见 §2.3;阅读与排期以 §2.3 为准。
### 2.1 已就位
| 项 | 状态 | 证据/位置 |
|---|---|---|
| 基座平台层 | 会话/工件/卡片/HITL/任务/审计、混合检索(向量 RAG + RRF)、PG 多租户档、认证、限流、多实例地基 | modules/backend(dual-tier 阶段 0–3 已合入) |
| EXT-1 进程内命令处理器 + owner 作用域宿主句柄 | 已合入 main,**MS1 阻塞项解除** | Dev #207/#209;`pkg/extension/surface.txt` 含 `Handler`/`Host`/`Host.ArtifactContent`/`Host.Audit`/`Host.Complete`/`Host.KVGet` 等符号 |
| EXT-5 宿主文档解析 | 已合入 main(含宽列修复) | Dev #222/#224 |
| 界面形态 | 三栏 + 卡片流 + 弹出层、收件箱双现投影、交付物卡片与 docx 预览 | modules/frontend、modules/ui(与愿景 05/06 V2.2 原型一致) |
| 下游仓 | `Agent-System-RDM` 已建仓,种子可编译(29MB 二进制),pins 落位(backend cb26e4c / core 0b5c774 / frontend 50c7244 / ui 27d5adb),8 条 deps replace 就位 | 愿景 13 建仓实录 |
| v0.1.0 评估基线 tag | Dev / Documents / Backend / Core 等仓 tag 已打(backend 已 +4 提交) | 各仓 `git tag -l v0.1.0` |
| v0.2.0 前置 | EXT-1 已合入;surface.txt 符号齐;EXT-1 提案已对齐 tag 名与 SurfaceVersion 2.0.0-experimental 兼容承诺 | 愿景 12 核对清单逐项可勾 |
| 库分期 | R0/R1/R2/D1 已合入;N1 进行中(WP2/WP3 两增量 PR 已开:Agent-Native #17、Backend #69,CI 绿) | 2026-10-02 总提案 §5 |
| 本大阶段的输入 | N1/Q1/I1 实施方案已评审合入 | Documents #40 / Dev #226 |
### 2.2 缺口
| 缺口 | 性质 | 影响 |
|---|---|---|
| v0.2.0 未发版 | owner 双钥匙动作(tag/push) | 下游升级、MS1 依赖的基座面定型;窗口 W2 末–W3 末(10-25 前) |
| MS1 下游功能为零 | 下游开发未开始 | **当前真实关键路径**(W4=11-01,余约 3.5 周) |
| O1/O3/O7 组织阻塞 | 评审会产出(权威文档树、标签字典、人选名单) | MS0' 退出条件;O3 阻塞 MS1 阶段映射 |
| 库分期 N1 剩余、Q1/I1 未启动 | 基座演进 | MS3 一键生成与意图分层的前置 |
| EXT-3 渠道未申请 | 基座扩展点(申请截止 W10 前) | MS4 飞书群入口 |
### 2.3 现状复核(2026-10-08)
本节为独立复核回填,不改写上文 10-07 快照。固定对象:`Agent-System-RDM` main
`4feb2f0`(pins=四仓 v0.1.0 tag commit)。方法:`/tmp` 隔离克隆重放 + 归档任务卡与
PR API 快照;一次性容器跑 PG 档。全部收据为 **SELF**(RDM 仓无 CI,不存在 GATE),
收据与快照见 `docs/records/2026-10-08-rdm-status-*.json`。
**§2.1/§2.2 逐行复核**:
| 原(10-07) | 复核(10-08) | 证据 |
|---|---|---|
| EXT-1/EXT-5 已合入基座 main | 维持;但 **EXT-5 不在下游 pin**(pin=backend v0.1.0 `cb26e4c`,基座 main 已领先 83 提交) | `git submodule status` / `rev-list --count` |
| 下游仓"种子可编译" | **已过时**:10-05~10-06 合入 103 个 PR、归档 51 张任务卡,P0–P4 各线均有首批实现 | 记录快照 pr_summary / cards |
| v0.1.0 tag 已打 | 维持(五仓+RDM 六 tag 在位;RDM v0.1.0=`99bbf54`) | tag 核对 |
| v0.2.0 未发版 | **维持,且为当前关键路径**:六仓远端均无 v0.2 tag(窗口 10-25 前,owner 双钥匙) | `ls-remote --tags` |
| MS1 下游功能为零 | **失效(最严重失实)**:MS1 工作项大半已有首批——R1-2 骨架、R1-6 两速+SSE+工作台、R1-8 异步、R1-9 审计、D8 烟测、MS1 验收载具(`-ms1`)、R1-1 文档树/模板/提示词注册表大部、R1-3~R1-5/R1-7 的 F1 v1;P2(状态机/版本链/比对)、P3(追溯网/冲突/变更 UI/起草)、P4(周报/自举例程)各有超前首批 | 记录快照 cards 映射 |
| O1/O3/O7 组织阻塞 | **已闭环**:RDM `docs/requirements/00-V2定稿决议.md`(10-06)——O1 以 ISO 13485 为主口径、O3 以种子字典为 v1(14 阶段/69 docTypes)、O7 owner 本人+系统外机制;P0 已关账(RDM #91) | RDM #89/#91 |
| 库分期 N1 进行中、Q1/I1 未启动 | **已过时**:N1/Q1/I1/N2/N3/Q2/Q3/I2 全部合入 Dev main(转出项见 N1/Q1/I1 案 §7 回填) | 栈总案与阶段导航 |
| EXT-3 未申请 | 维持(截止 W10 前) | proposals 目录 |
**MS1 验收核对**(对 §4.2 七条;结论分级:满足=本轮重放通过 / 部分=能力在但有缺口 /
未满足=该路径不通 / 口径不成立=判据无效):
| # | 条款 | 结论 | 证据与缺口 |
|---|---|---|---|
| 1 | 纪要+竞品 BP 60 秒出结论与初步归类 | **部分** | 真实纪要 0.78s 出回执(重放);但判定=无关(疑似)零字典命中挂起,**无初步归类**;竞品 BP 无原件未测 |
| 2 | 切片带标签锚点,笔记树视图可查 | **部分** | 标签+锚点在勾连卡可见(Linkage/Anchors);独立笔记树视图未实现(web 无对应视图;领域 `NoteTree.Query` 存在但无 UI 消费) |
| 3 | 无关文件存疑挂起,确认前不入库 | **满足(重放)** | 无关 txt→held;卡内挂起重启存活、reject 零切片测试 |
| 4 | Excel/PPT 解析完整性;失败显式告知+原件可取回 | **阻塞** | 报价单 xlsx/构造 pptx→`rdm:unsupported`+留档;损坏 docx 显式告知+留档(负例路径满足);xlsx/pptx 解析依赖 EXT-5,**不在 v0.1.0 pin**——需 v0.2.0 发版+RDM 升钉+上传链切 Host 解析 |
| 5 | 阶段映射准确率 ≥80% | **口径不成立** | `-ms1` 报 100%(重放 PASS)但金标 `ms1Gold` 与自举打标 `docProfiles` 同表同源(代码注释自认),样本 5 文档全 BD 阶段;上传路径实测纪要零命中——准确率未经有效测度 |
| 6 | 页面/对话双入口同源 | **未满足(钉入组合)** | 命令入口 200;对话入口发 `/rdm.ping` 得 400"未知命令"(插件命令注册不写 slash 别名,v0.1.0 与基座 main 同);RDM 未声明 intents;另发现工作台 `sendChat` 调 `/api/chat`——该端点在 v0.1.0 pin、基座 main、RDM 三处均不存在(自由文本 404) |
| 7 | PG 多用户档身份贯通 | **满足(重放)** | 一次性 PG 容器重放 pg-smoke:alice/bob 审计与知识各 1、零串号;multi-smoke 跨实例扇出+Redis 限流 PASS |
**MS1 整体判定:部分满足,不可签收**。关键路径从"下游从零开发"变为:v0.2.0 发版
(双钥匙)→ RDM 升钉 → 上传链切 `Host.ParseDocument`(第 4 条);对话入口路由插件
命令(第 6 条,需基座侧动作);准确率金标独立化重测(第 5 条);笔记树视图补齐(第 2 条)。
**新缺口登记**(本轮只登记不修复;逐项带证据、影响、建议承接与归属):
| 缺口 | 证据 | 影响 | 建议承接 | 归属 |
|---|---|---|---|---|
| 插件命令无 slash 别名,对话入口不可达插件命令 | entrance2 收据(400/200 对照);`cmdbus.RegisterPluginCommand` 不写 `b.slash`(v0.1.0 与基座 main 相同) | MS1 第 6 条、R3-6 四入口同源 | 基座侧:扩展申请或并入既有 EXT 案(含 intents 命中插件命令的路由) | weichen |
| RDM 工作台自由文本端点错误(`/api/chat` 不存在) | entrance 收据 404×2;基座前端实际用 `/api/conversations/{id}/messages` | 工作台自由文本路径不可用 | RDM 侧小任务(改端点) | weichen |
| INV-2 可退化机制未实现(装载开关、禁用态 e2e、基座领域词守护均无) | 两侧 grep 零命中;成因:RDM 10 号 V1.2 定稿(10-05)早于本总案 INV-2(10-07) | §3.2 判定四条均 NOT_RUN | 下游任务(开关+禁用态 e2e)+ 基座守护另行立项 | weichen |
| 阶段映射准确率无有效测度(金标同源、样本全 BD) | `ms1.go` ms1Gold vs `bootstrap.go` docProfiles 对照 | MS1 第 5 条、MS2 质量基线 | 独立金标集+多阶段样本重测任务 | weichen |
| RDM 仓无 CI | 仓内无 `.gitea/workflows`;PR status API 无 statuses | INV-3 的 GATE 来源不存在,下游证据止于 SELF | RDM 仓接 act_runner(同基座模式) | weichen |
| 22 张归档卡「结果与验证」段为模板占位 | grep 模板串 22 命中;结论写在 PR 描述(抽样 6/6 含验证) | 台账完整性 | 低优先:随下一批 RDM 任务补齐或接受现状 | weichen |
本节维护规则:状态再变化时先更新本节(或其后续修订版),并同步索引导航;
复核不等于里程碑验收,MS2–MS4 的正式验收仍按 §4 各自条款执行。
---
## 3. 架构裁定
### 3.1 二次开发的承载形态(三级,主辅保留)
| 级 | 形态 | 用在哪 |
|---|---|---|
| A 进程内编译(主) | 下游仓 import `pkg/extension` + core,实现 EXT-1 `Handler` 命令处理器、`Host` 句柄消费(KV/audit/llm/knowledge search+write(embed)/tasks 台账/artifacts)、页面 SDK | RDM 命令(上传管道、入库、生成、变更)、知识写入、结构事件日志、页面 |
| B 声明式规格(辅) | intents / workflows / skills / 页面规格文件,插件目录装载 | RDM 意图(闲聊/澄清/取消等命令层消费)、流程骨架 YAML、技能 |
| C sidecar(保留) | 独立进程,经命令总线/工具被调 | 格式解析器(office/xlsx 深解析)、EXT-3 渠道执行体 |
**裁定**:能用 A 就不用 C;解析器默认走「sidecar 工具或 LLM 抽取」,EXT-4(进程内解析器注册)不提交(愿景 10 §1.5)。
### 3.2 可退化机制(INV-2 的工程形态)
**装载开关**:RDM 插件的一切装载点——命令 Handler 注册、意图 spec、工作流定义、技能目录、页面路由、卡片投影——收在一个开关下(建议设置键 `plugins.rdm.enabled`,默认开启;缺省/禁用 = 通用基态)。禁用语义是**装载期跳过**,不是运行时逐点判断:装载器在开关关闭时不注册任何 RDM 项,路由自然回落到基座既有 fallback(普通回合)。
**通用基态的判定**(机器可核对):
1. 禁插件启动后,通用场景 e2e 全绿(对话、工具、工件、卡片、HITL、工作流 demo 插件)——复用 backend 现有 e2e 套件在禁用态重跑;
2. RDM 命令返回未知命令、RDM 页面 404、收件箱无 RDM 投影卡;
3. 基座仓 diff 检查:任何 PR 的基座改动不含 RDM 领域标识(词表黑名单进 design-guard 类守护,或评审核对项);
4. 数据共存:禁用不触发任何删表/删数迁移;重新启用后 RDM 视图恢复原状(下游测试覆盖)。
**测试形态**:下游仓测试套件固化「禁用态 e2e」一项;基座 CI 天然成立(基座不依赖下游,永远可独立构建测试)。
### 3.3 扩展点申请流程(缺口 → EXT)
下游发现基座面缺口时的唯一合法路径(愿景 10 §七.1):
1. 下游在任务卡里写明缺口(要的符号、语义、阻塞什么里程碑);
2. 基座侧建 EXT 申请卡 → 评审(是否属于通用能力、SurfaceVersion 影响)→ 基座实现并随下一段发版(v0.2.0 之后按 v0.3.0/v0.4.0… 节奏,同样走 12 号清单核对);
3. 下游升级动作:pins bump + go.mod replace 切回 tag pin(合入前必须切回,愿景 13)。
已在案的扩展点:EXT-1(已落地)、EXT-3(渠道,W10 前申请,阻塞 MS4)、EXT-4(备选,默认不提交)。预计 MS1–MS3 期间可能出现的新需求(知识写入完整集、页面 SDK 增补、审计结构事件扩展)按本流程逐案评审,不预设全部进基座。
### 3.4 数据模型落地裁定
- 两树一网(笔记树/文档树/追溯网)在下游自建库表、schemaVersion 自管迁移(D-R1 选 A,愿景 10);基座 core 不加领域实体。
- **R3-1 结构事件日志最先做**(愿景 10 §五:「追溯网地基」,SR-G5 五硬规则:原文 append-only、软删除、边候选→生效→废止、统一结构事件日志、时间点可重建)。裁定:下游自管事件日志与重放,基座通用审计接口(`Host.Audit`)只写动作审计,不为结构追溯进基座。
- 标签字典是两树唯一接口语言(愿景 08 §四);字典实体为项目级资产、版本化,住下游;其字段集与取值枚举依赖组织项 O3,MS1 前先以草案字典起步(见 §5 风险 R-1)。
---
## 4. 阶段方案(里程碑对齐)
每阶段给出:下游工作项 / 基座支撑项 / 组织依赖项 / 验收(机器可核对)。编号 R 沿用愿景 10。
### 4.1 阶段 P0:MS0' 收尾与发版(W1–W3,当前窗口)
- 下游:R0 奠基——文档树模板注册表骨架(阶段→文档→章节)、UR/SR 条目化导入需求大表雏形、建仓自检(`go test .` + link 构建)随仓常驻;奠基文档(方案 10)已就位。
- 基座:v0.2.0 发版(owner 双钥匙,按愿景 12 清单:core 三处同 SHA、五仓 tag 指向一致、tag 消息固定文案);N1 合入链走完(Agent-Native #17 → Backend #69 → Dev gitlink PR)并完成 N1 剩余(WP1 AgentSpec、WP4 guardrail、WP5 下沉、WP6 装配与 A/B)。
- 组织项(MS0' 退出条件,非代码):01 升 V2.0 定稿;O1/O3/O7 决议闭环;D-R1/D-R2 决议在案;EXT-1 申请卡已受理(已合入可视为闭环);code review 机制首运行台账。
- 验收:v0.2.0 五仓 tag 就位且指向一致(命令:各仓 `git tag` + Dev gitlink 比对);N1 三段 PR 合入且 CI 绿;下游种子构建通过。
### 4.2 阶段 P1:上传五步法 + 两速入库(W4 = MS1,11-01)
上传五步:接入 → 相关性判定 → 结构化解析 → 阶段映射与标签 → 两速入库(愿景 03 F1、04 T1-x、10 §三)。
| 工作项 | 内容 | 承载形态 |
|---|---|---|
| R1-1 上传接入 | 复用基座工件/上传端点;渠道记录(SR-A3)留 P1 后 | A(下游命令) |
| R1-2 相关性判定 | 三态(相关/不相关/存疑),存疑挂起确认前不入库(SR-B1) | A |
| R1-3 结构化解析 | 拆解为切片:原文锚点 + 结构化字段;office 深解析走 sidecar 工具或 LLM 抽取(EXT-4 不提交) | C 辅 |
| R1-4 阶段映射与标签 | 按标签字典映射阶段/工作事项/主题簇,生成标签 JSON(M3 schema);字典草案先行,O3 闭环后替换 | A + 字典资产 |
| R1-5 两速入库 | **快通道**:60 秒首轮反馈——标签、锚点、一句话摘要即时可见;**慢通道**:向量与深度补齐异步走 EXT-1 `KnowledgeWrite(embed)` 句柄(意图分层「快规则/慢模型」之外产品的第二条快慢线) | A(慢速经 EXT-1 句柄) |
| R1-6 入库完整性 | 失败显式告知、原件可取回、禁静默降级(SR-A5);三类负例(报价单 Excel/图文 PPT/构造解析失败)回归 | A + 测试 |
- 基座支撑:v0.2.0 已发版(前置);`Host` 完整集(含 artifacts 写入)如 MS1 实测不足,走 §3.3 申请进 v0.3.0。
- 验收(对齐愿景 10 §三 7 条):上传五步法端到端跑通(三类真实文件);60 秒首轮反馈实测;存疑挂起确认前库中无记录;标签+锚点在界面可见;SR-A5 三负例回归;**SR-E6 双入口同源早期证据**(页面/对话两个入口同一命令处理器实测);PG 多用户档身份贯通烟测(D8)。
### 4.3 阶段 P2:基线 + 三分类 + 版本链(W7 = MS2,11-22)
- 下游:文档状态机(草稿→评审中→已基线→变更中→新版本);三分类比对引擎(新增/更新/冲突);版本链可溯;基线直改被拒;缺项提示只在评审/推进两触发点出现(SR-C5,上传节点禁止)。
- 基座:无新需求预期;卡片/HITL 复用。
- 验收(10 §四 R2-1~R2-5):状态机迁移合法集测试;三分类对同一文件两版比对正确分类;版本链从任一章节回指到切片锚点;基线直改返回结构化拒绝;上传节点界面无缺项提示。
### 4.4 阶段 P3:两树一网 + 变更闭环 + 一键生成(W11 = MS3,12-20)
| 工作项 | 内容 | 依赖 |
|---|---|---|
| R3-1 结构事件日志 | **最先做**:SR-G5 五硬规则全落地;时间点可重建(事件重放 + 周期快照) | 无(下游自管) |
| R3-2 追溯网 | 切片↔需求↔章节↔法规↔用例 有向边;模型候选边人工转正 | R3-1 |
| R3-3 需求大表 | UR/SR 版本化条目;变更风险提示 | R3-1 |
| R3-4 变更闭环 | 检测→影响分析→变更单七步→回写留痕;影响已基线内容的结构变更强制走变更流程 | R3-2 |
| R3-5 一键生成 | 编写意图确认→小队骨架执行→逐节标源(无素材明示空缺不编造);一拉一推(章节条件检索笔记树 / 切片标签映射文档树) | **基座 Q1/Q3、I1**(小队骨架与意图命令化);标签字典 |
- 基座支撑(**最迟合入窗口:W9 末**):Q1 图执行合入、I1 命令化合入(退化路径:R3-5 先用流程骨架 YAML + 现有小队 standard 模式实现,不强等 Q3 编排收敛;该降级在愿景 03 F4 允许范围内,需任务卡明示)。
- 验收(10 §五):结构事件日志对两树一网增删改全程留痕且可重建指定时点;变更七步闭环跑通一次真实变更;一键生成产出的每个章节带切片级来源标注,无素材章节明示空缺;追溯链报告可导出。
### 4.5 阶段 P4:自举与演示(W16 = MS4,2027-01-24)
- 下游/联合:自举 B1–B7(元项目常驻 → 纪要入库 → 本批文档入库 → UR/SR 全部进需求大表 → 一句话生成自身可行性报告 V1 → 用系统管本计划执行 → 每周复盘);EXT-3 渠道(飞书群收文件/推送,申请截止 W10 前,基座实现随当段发版);测试群反馈闭环率 ≥80%。
- 基座支撑:EXT-3(W10 前受理);N2/N3/Q2 按实际拖累点排期;I2 语义端口(意图慢通道)如被意图误触发率卡脖子则提前。
- 验收:自举项目全程在系统内运行(纪要入库→可行性报告→追溯链导出,无系统外补录);反馈闭环率统计达标;owner 认定可对外演示。
---
## 5. 风险与缓解
| # | 风险 | 缓解 |
|---|---|---|
| R-1 | MS1 时间紧(余约 3.5 周)且 O3 标签字典是组织阻塞 | 字典草案先行(下游资产、可迭代);O1/O3/O7 列入 MS0' 评审必须产出的一句话(愿景 11 阻塞项表),评审前下游不赌字典内容 |
| R-2 | 一键生成依赖基座 Q1/Q3 进度 | 设 W9 末最迟窗口 + 降级路径(YAML 骨架 + standard 模式,§4.4);库分期优先级因此把 Q1 排在 N2/N3 之前 |
| R-3 | 可退化不变量被侵蚀(领域逻辑渗入基座) | INV-2 的装载点集中 + 禁用态 e2e(下游常驻)+ 基座 diff 领域词黑名单检查(进评审核对项,必要时落 design-guard 类守护) |
| R-4 | 双仓 pin 漂移 / replace 忘切回 tag | 愿景 13 规则进下游 AGENTS.md;基座 R0 检查脚本已核对 backend deps 与 Dev 指针;下游 pins 自检进 CI |
| R-5 | EXT 申请节奏跟不上下游需求 | 缺口提前在任务卡登记(§3.3 第 1 步),发版节奏按里程碑倒排(v0.3.0 对准 MS2/MS3 之间) |
## 6. 不在本方案范围
- 医院端产品与行业输出的远期步(愿景 02 §7 路径第 ③④ 步)。
- 模型无关性的完整抽象(SR-N5,P2 远期);token 成本测算口径(待组织认可,愿景 11 #14)。
- 微信等飞书以外的渠道(前瞻)。
- 下游仓内部的详细任务分解(本方案是总案;下游按 §4 的阶段在 RDM 仓立各自任务卡,引用本文)。
## 7. 验收(本文)
- 大方向与三条不变量(INV-1/2/3)表述无歧义,可落成检查项。
- §4 五阶段与愿景 10 §10.1 里程碑逐条映射;每阶段验收均为机器可核对形式;组织项与代码项分列、不混淆。
- 可退化机制(§3.2)给出判定与测试形态,能直接派生下游测试任务。
- 与既有方案无冲突:库分期按 2026-10-07 N1/Q1/I1 方案继续;本文只在其上排布消费者与窗口。
+151
View File
@@ -0,0 +1,151 @@
# 项目方向与规划索引
状态:**已获合入授权(2026-10-08)**。编制依据:用户同意整理既有规划主记录、确认状态、里程碑和关联任务;同日授权收尾并合入。
本索引负责导航与差异提示,规划正文、批准范围和验收条件仍以链接的主记录及其批准版本为准。
合入授权不批准新方向、不调整里程碑范围、不启动新的业务任务。
## 先看哪一份
| 要回答的问题 | 主记录导航 | 规划中的阶段 | 原文负责人 |
|---|---|---|---|
| 通用系统的原始边界与架构是什么 | [系统骨架](2026-09-29-system-skeleton-design-and-plan.md),结合下表专题修订 | 骨架 P0–P5;D1–D16 | weichen |
| 基座与下游如何分工,如何申请扩展 | [基座路线图](2026-10-01-base-extension-roadmap.md),配套插件契约与兼容规则 | 公开扩展面、插件 v2、质量回路、工程基座 | weichen |
| 三个智能体库如何继续演进 | [Agent 栈总案](2026-10-02-agent-stack-completion.md),阶段细化见 N1/Q1/I1、N2、N3、Q2/Q3 | R0/R1/D1、N1–N3、Q1–Q3、I1–I2、阶段评测 | weichen |
| RDM 下游的大目标和消费者里程碑是什么 | [RDM 阶段总案](2026-10-07-rdm-phase-plan.md) | P0–P4,对应 MS0'、MS1–MS4及发布前置 | weichen |
以上是依据文内显式范围和引用形成的阅读入口,不是新增优先级或批准结论。N2 阶段案未单列 owner,
应由负责人补齐;不能仅凭任务创建人推断全部规划的负责人。
## 快照与状态口径
本次只读核验时间:**2026-10-07 13:27 UTC**。来源均为 **SELF** 的文件、Git 与 API 观察,
原始命令、对象和输出见 [核验收据](../records/2026-10-07-planning-index-source-receipt.json),
可检索字段见 [核验快照](../records/2026-10-07-planning-index-source.json)。
- Dev 基线:`eb0d4b5a499322a23155c8d89a024247f6e7830d`。
- 该基线固定的 Documents:`b8eaa1676f168ad64c437857e2607e2e213f6672`,包含下表前 18 份方案。
- 查询时 Documents main:`5542319a0474fd4e866b6daacb937b587c833ede`;额外包含 N2 阶段案。
前 18 份文件在两个 Documents 版本中的 blob 完全相同。此候选索引基于该 Documents main 编制。
因此本地 Dev 候选指针同时包含 N2 方案文件;批准并采纳这个组合会纳入该文件,仍不等于批准其业务实施。
远端 Dev 是否采纳及在途 #244 的衔接,按实际合入时重新核对。
- 查询的 55 个关联 PR 中,54 个已合入且合入提交属于各自固定 main;编制时 Dev #244 尚未合入。
所查 PR 的 reviews 数组均为空。这不能证明不存在会话批准,也不能补作人工批准依据。
- 合入前同步(2026-10-08):Documents `origin/main` =
`16795ed59820eee1d36efe6564e13a2f5a6387a6`,在上述查询版本之上新增 N3(Documents #43)
与 Q2/Q3(Documents #44)。Dev `origin/main` =
`7f1d87dbb976ebe02ceb632d5a657a416ffb50bc`。新增行与 N2/N3/Q2/Q3 阶段行只按
`git log --merges` 核对合入提交;没有重放各任务测试。合入不等于阶段验收重验。
- 下表“原文确认/状态”保留作者声明;“已合入”只描述本次核实的 Git/PR 状态。
这份来源快照不包含业务里程碑、用户流程、部署或下游状态的复验,这些验收为 **NOT_RUN**。
本地候选组合的 `make test` 用于检查文档指针组合,不代替各规划的业务验收。
使用更新版本时重新核对快照,不把这里的历史状态当实时任务台账。原文仍为 proposed/待审,
或批准来源不能关联到确定版本的,保留待核实;已经归档的任务也须检查剩余范围。
复核方法:读取 Gitea 的 `/api/v1/repos/weichen/{repo}/pulls/{number}` 及其 `/reviews`,
再在对应仓运行 `git merge-base --is-ancestor <merge_sha> <固定 main SHA>`;文档采用情况按
`git rev-parse <Documents SHA>:<文件路径>` 比较两个版本的 blob。API 状态与 Git 包含关系同时记录。
## 全部规划与关联交付
下表覆盖同步后 Documents main 中的 **21 份 Markdown 方案**(原查询版本 19 份,加上 N3 与 Q2/Q3),不含本索引自身。
Dev 链接均指向对应任务 PR,可从其任务卡继续追溯组件 PR;不表示完整业务验收通过。
| 主记录 | 角色、里程碑或范围 | 原文确认/状态(声明) | 关联合入记录与待核实项(SELF) |
|---|---|---|---|
| [系统骨架](2026-09-29-system-skeleton-design-and-plan.md) | 历史规划起点;P0–P5、D1–D16;后续有专题局部修订 | 待审 r4;决策勾选仍空 | [历史 P0–P5 实施记录](../records/2026-09-29-implementation.md)可定位阶段和提交;本轮未建立完整独立批准/验收链,不把记录勾选当当前验收 |
| [双档存储与多租户](2026-09-30-dual-tier-storage-and-multitenancy.md) | 明确局部修订骨架:多租户/RAG 前移,SQLite 默认、PG 可选;D17–D24 | accepted,页首称实施完成 | [四阶段实施记录](../records/2026-09-30-dual-tier-implementation.md)及[历史测试报告](../reports/2026-09-30-dual-tier-test-report.md);本轮未据此宣称当前多租户/RAG 已验收 |
| [启动配置面](2026-09-30-configuration-surface.md) | 配置管道、实例隔离;配置专题 | 已批准(随实现交付) | Dev [#12](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/12) 已合入 |
| [跨会话读取](2026-09-30-cross-session-reading.md) | 同项目 transcript 按需读取、权限和入口 | 已批准(随实现交付) | Dev [#67](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/67) 已合入 |
| [交互底座](2026-09-30-ui-inbox-command-workspace.md) | T0–T5:基础、卡片/命令、收件箱、命令总线、工作区、体验收尾 | 已批准总体方案与 T0 计划 | Dev #14/#15/#19/#21/#23/[#25](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/25) 已合入;各 PR 见快照 |
| [UI 重构与认证](2026-09-30-ui-redesign-and-auth.md) | 交互底座后的 R1–R4 与补充修订 | accepted(方向及 R2 范围);页首管理员发放制覆盖旧注册方案 | Dev #30/#37/#43/#53/#61/[#71](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/71) 已合入;R3 与旧正文差异见下表 |
| [卡流与过程分离](2026-09-30-cardflow-and-process-split.md) | CF0–CF2;D39–D43 | 已批准(原文记录用户五项裁定) | Dev [#79](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/79)、[#90](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/90) 已合入 |
| [流式卡片、工件统一与项目收件箱](2026-09-30-card-stream-artifact-unify-project-inbox.md) | CF-S → CF-A → CF3;D44–D52;承接卡流案 | 已批准(声明) | Dev [#100](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/100)、[#103](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/103)、[#105](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/105) 已合入;保留后台 producer 等边界 |
| [文件预览与保留能力](2026-09-30-file-preview-and-reserved-capabilities.md) | 工件管理后续;预览基座、Office、URL、fs | 已裁定(§5);实施任务已命名 | Dev [#77](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/77)、[#94](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/94) 已合入;PPTX 与右栏口径待对齐 |
| [基座路线图](2026-10-01-base-extension-roadmap.md) | 基座/下游边界总记录;显式引用 harness 与栈总案 | 实施中 | Dev [#132](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/132) 已合入;不能据此推断 tag、npm 或下游验收完成 |
| [插件契约 v2](2026-10-01-plugin-contract-v2.md) | 路线图配套;声明、进程内、sidecar、前端 ESM 与生命周期 | 实施中 | 与路线图同任务、Dev #132;四种形态的当前运行状态未重验 |
| [扩展兼容规则](2026-10-01-extension-compat-policy.md) | 路线图配套;兼容窗口、快照、版本发布与申请流程 | 实施中 | Dev #132;EXT-5 文档补充接口方法快照;发布动作另有双钥匙边界 |
| [Agent harness](2026-10-01-agent-harness.md) | P0–P4 前序总案;明确后续栈总案不使 P0–P4 作废 | proposed | Dev #134/#136/#138/#140/#142/[#144](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/144) 已合入;参见阶段导航 |
| [Agent 栈总案](2026-10-02-agent-stack-completion.md) | 当前库分期范围入口;承接 harness | proposed | 文档 Dev [#151](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/151);R0/R1/R2/D1 及后续交付见阶段导航 |
| [EXT-1](2026-10-05-ext-1-inproc-command-handler.md) | 扩展申请;owner 作用域 Host 与进程内命令最小集 | 实施中 | Dev [#207](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/207) 已合入;[#209](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/209) 是任务卡恢复/复核轮,不是第二次公开面实现 |
| [EXT-5](2026-10-06-ext-5-host-parse-document.md) | 继 EXT-1 开放宿主文档解析;不依赖未提交的 EXT-4 | 实施中 | Dev [#222](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/222)、修复 [#224](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/224) 已合入;下游接入和发布不等于完成 |
| [N1/Q1/I1 实施案](2026-10-07-agent-stack-n1q1i1-plans.md) | 栈总案 §5 的三个阶段细化;明确不包含 N2/Q2/I2 | proposed | 文档 Documents [#40](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/40)、Dev [#226](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/226) 已合入;实施范围差异见下表 |
| [RDM 阶段总案](2026-10-07-rdm-phase-plan.md) | 下游大目标、双仓及可退化约束;P0–P4 / MS0'–MS4 | proposed;§2.3 现状复核已回填(2026-10-08) | 文档 Documents [#41](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/41)、Dev [#229](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/229) 已合入;不代表 RDM 各阶段获准实施 |
| [N2 实施案](2026-10-07-agent-stack-n2-plan.md) | 栈总案 N2 的六 WP:上下文、协议、工具、skills、子代理、装配 | 未单列确认状态及 owner;正文称 N2 开工 | Documents [#42](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/42) 已合入;Dev [#244](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/244) 已合入(merge `7e3ba10`),闭卡 [#247](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/247)。卡内自述六 WP 落地;本索引未重放 |
| [N3 实施案](2026-10-07-agent-stack-n3-plan.md) | 栈总案 N3:持久与可观测 | 页首未单列确认状态及 owner;正文称 N3 开工 | Documents [#43](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/43) 已合入;Dev [#248](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/248) 已合入(merge `2836a87`),闭卡 [#249](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/249)。卡内自述六 WP 落地;本索引未重放 |
| [Q2/Q3 实施案](2026-10-07-agent-stack-q2q3-plans.md) | 栈总案 Q2 拓扑与 Q3 收敛互通 | 页首未单列确认状态及 owner | Documents [#44](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/44) 已合入;Dev [#250](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/250) 采纳方案,[#251](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/251)(merge `452c00a`)与 [#253](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/253)(merge `c8ce4eb`)已合入。卡内自述 Q2/Q3 落地;本索引未重放 |
原查询的 19 份原文中,14 份显式标注 owner 为 weichen。双档存储、启动配置面、跨会话读取、文件预览和
N2 实施案这五份未单列 owner,其中预览案仅写“作者:weichen + Agent”。同步新增的 N3 与 Q2/Q3 案页首也未单列 owner。
这些负责关系待确认,不能由作者、任务创建人或 PR 账号代填。确认状态只是上述版本原文的摘录,独立批准凭据需要另行关联。
UI 的 [演示入口](ui-redesign-demos/index.html) 与四份样稿归属于 UI 重构方案,不是另外五个已批准规划。
## Agent 栈的阶段与关联任务
显式关系:基座路线图 → harness(前序,不作废)→ 栈总案 → N1/Q1/I1、N2、N3、Q2/Q3 阶段案。
RDM 总案把库分期作为支撑与依赖,不覆盖库分期的原始范围。
阶段 N2 指“上下文、协议与工具”,不是审计报告中同号的“并行工具事件竞争”缺陷。
| 阶段 | 主记录与关联任务 | 核验结果与继续工作的边界 |
|---|---|---|
| harness P0–P4 | harness 对应 `feature/agent-harness-p0` 至 `p4`,含 p3b | 上表六个 Dev PR 已合入;旧卡“后续尚未实施”只属于当时快照 |
| R0/R1、R2、D1 | 栈总案;`feature/agent-stack-r0-r1`、`r2`、`d1` | Dev [#152](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/152)、[#154](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/154)、[#156](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/156) 已合入;不得把同号审计缺陷误作阶段名 |
| N1 | N1/Q1/I1 案 §2;`feature/agent-stack-n1` | Dev [#232](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/232) 已合入;状态与范围差异已于 2026-10-08 回填至[主记录 §7.1](2026-10-07-agent-stack-n1q1i1-plans.md)(WP6b/6c 等转出项带归属,均未被后续阶段承接) |
| Q1 | 同案 §3;`feature/agent-stack-q1` | Dev [#237](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/237)、[#240](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/240) 已合入;platform task 与 squad run 的统一边界已厘清并回填至[主记录 §7.2](2026-10-07-agent-stack-n1q1i1-plans.md)(Store 层合一已做,队列翻译转出且 Q2/Q3 未承接) |
| I1 | 同案 §4;`feature/agent-stack-i1` | Dev [#234](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/234)、[#235](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/235) 已合入;blueprint entry、SetSlot/Cancel/Handoff 等后续边界已回填至[主记录 §7.3](2026-10-07-agent-stack-n1q1i1-plans.md) |
| I2 | 栈总案 §5/I2;`feature/agent-stack-i2` | Dev [#242](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/242) 已合入;主记录已加状态回填([栈总案 I2 节](2026-10-02-agent-stack-completion.md)),I2 卡断链已在 Dev 侧修正;开启态完整用户验收未重放 |
| N2 | N2 阶段案;Dev [#244](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/244),闭卡 [#247](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/247) | 2026-10-08 同步时已在 Dev main。#244 标题是接入方案并开启任务;完成声明在已归档任务卡,本索引未重放其测试 |
| N3 | [N3 实施案](2026-10-07-agent-stack-n3-plan.md);Dev [#248](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/248),闭卡 [#249](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/249) | 方案与任务卡已合入。完成声明在已归档任务卡,本索引未重放 |
| Q2 | [Q2/Q3 实施案](2026-10-07-agent-stack-q2q3-plans.md) 第一部分;Dev [#250](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/250)、[#251](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/251) | #251 已合入。完成声明在已归档任务卡,本索引未重放 |
| Q3 | 同案第二部分;Dev [#253](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/253) | #253 已合入。完成声明在已归档任务卡,本索引未重放 |
原始任务卡在 Dev 仓 `.task/archive/`。任务主记录和既有分工优先复用,
索引整理不重新领取或另建相同业务任务。
## RDM 里程碑:规划目标与核验边界
以下名称、窗口与依赖来自 RDM 总案 §1、§4,**只保留计划,不表示已承诺或已验收**。
| 阶段 | 原规划目标 | 核验边界 |
|---|---|---|
| P0 / MS0' | 奠基、组织决议、基线与 v0.2.0 前置 | 复核(2026-10-08,[总案 §2.3](2026-10-07-rdm-phase-plan.md)):v0.1.0 六 tag 在位、O1/O3/O7 已决议(RDM 00-V2定稿决议)、P0 已在下游关账(RDM #91);**v0.2.0 仍未发版(owner 双钥匙,窗口 10-25 前)** |
| P1 / MS1 | W4 上传五步与两速入库(原窗口 2026-11-01) | 复核(2026-10-08):下游首批已落地(F1 v1、两速、D8 等);七条验收 = 2 满足(重放)/2 部分/1 阻塞(EXT-5 不在 v0.1.0 pin)/1 口径不成立/1 未满足(对话入口),**不可签收**;详见总案 §2.3 MS1 核对表 |
| P2 / MS2 | W7 基线、三分类与版本链(原窗口 2026-11-22) | 复核(2026-10-08):状态机/版本链/三分类门控/需求大表等首批已在下游合入;MS2 正式验收 NOT_RUN(含 O2 提案待拍板) |
| P3 / MS3 | W11 两树一网、变更闭环、一键生成(原窗口 2026-12-20) | 复核(2026-10-08):追溯网/冲突/变更 UI/起草等首批已在下游合入;库分期前置(Q1/Q3/I1)已全部合入,其转出项见 N1/Q1/I1 案 §7;MS3 正式验收 NOT_RUN |
| P4 / MS4 | W16 自举与演示(原窗口 2027-01-24) | 复核(2026-10-08):自举语料/周报/立项例程等首批已在下游合入;EXT-3 仍未申请(截止 W10 前);MS4 正式验收 NOT_RUN |
~~总案引用未入本仓的 further-objective 01–13,以及下游仓的奠基材料。它们是明确的来源缺口。~~
**来源缺口已关闭(2026-10-08 复核)**:further-objective 01–10 已权威迁入 RDM 仓
`docs/requirements/`、11–13 迁入 `docs/materials/`(RDM #42);抽查 08/10 号与原件逐字
一致,01 号为 V2.0 定稿升版(属正常演进)。Dev 仓 `.tmp/` 私有目录仍被 exclude,未入 Dev 仓;
引用愿景编号时以 RDM 仓内权威正文为准。
## 待澄清与待同步项
这些条目登记文档之间的差异,不代替产品裁定,也不静默重写原方案。
原文已有明确后续裁定的,只需同步旧叙述;缺少可定位的范围变更依据时,才提交负责人确认。
| 项 | 可复核位置 | 需要确认或补齐的内容 |
|---|---|---|
| 批准版本 | 各方案页首;核验快照的 reviews | 把原文 proposed/待审/accepted 与实际批准范围、版本和来源关联;PR 合入不能自动补齐实施授权 |
| 负责人缺项 | 双档、配置、跨会话、预览及 N2 案页首 | 五份未单列 owner,预览只有作者;由项目负责人确认维护与决策职责后回填主记录 |
| 骨架局部修订 | 骨架 §2.2/§7.2 与双档专题“方向修订”;骨架结尾 D1–D15 与新增 D16 | 保留双档专题明确修订关系,补齐决策范围与批准依据,避免继续照旧“多租户/RAG 远期”执行 |
| UI/auth 与预览 | UI/auth 页首及 §5.1;预览 §3/§4/§5;交互底座 D25 | 页首管理员发放制已否决旧注册方向,但旧正文仍在;PPTX 全保真裁定与文本大纲叙述、右栏预览与纯收件箱边界需对齐 |
| 卡流实施口径 | 卡流里程碑的旧 D34–D37 与 D39–D43 表;CF-A/CF3 任务卡剩余项 | 校正编号与阶段范围,保留 CF-A 前端零改动和 CF3 后台 producer 等实施边界 |
| N1/Q1 完成口径 | **已处理(2026-10-08)**:[N1/Q1/I1 案 §7 回填](2026-10-07-agent-stack-n1q1i1-plans.md) | 各项“完成/转出/待做”已带依据、归属与适用版本;回填为 SELF 层记录,未重放各任务测试 |
| I1/I2 归属 | **已处理(2026-10-08)**:I2 卡断链已修正(Dev 侧归档卡);I2 状态回填至[栈总案 I2 节](2026-10-02-agent-stack-completion.md);未接入消费者归属见 §7.3 | SetSlot/Cancel/Handoff 消费无阶段载体,需负责人排期 |
| N2/N3/Q2/Q3 合入与验收 | Documents #42–#44;Dev #244/#247/#248/#249/#250/#251/#253 | 这些 PR 已在 2026-10-08 的 Dev main 上。本索引只登记 Git 合入,不把闭卡文案升级为重新验收 |
| Q2/Q3 归档卡截断 | Dev `.task/archive/feature-agent-stack-q2.md` 与 `-q3.md` 的「影响与剩余项」行 | 两卡该行在归档中截断(106/97 字符,止于半句);完整表述需对照 PR #251/#253 描述补齐或登记缺损 |
| RDM 历史快照 | **已处理(2026-10-08)**:[RDM 总案 §2.3 现状复核](2026-10-07-rdm-phase-plan.md) | 逐行复核+MS1 七条核对+六项新缺口登记;收据 SELF(RDM 无 CI),见 records/2026-10-08-rdm-status-* |
| RDM 双主记录关系 | RDM 仓 `docs/requirements/10-实施推进方案`(V1.2 定稿)与本仓 RDM 总案 | 裁定(2026-10-08,负责人确认):前者为执行总案(下游任务在其仓内立卡引用),后者为基座侧消费记录(里程碑对齐、扩展点、库分期依赖);下游执行细节冲突时以前者为准,里程碑与基座依赖以本仓总案为准;本仓总案不回写下游正文 |
| RDM 仓无 CI | RDM 仓无 `.gitea/workflows`;PR status API 无 statuses | INV-3 的 GATE 来源不存在,下游完成声明止于 SELF;建议 RDM 接 act_runner 后,重大验收(MS1 签收等)以 CI 为权威源 |
## 下一步建议与维护
原首选任务(确认并修订 N1/Q1/I1/I2 阶段主记录的状态与范围差异)已于 2026-10-08 执行完毕:
回填见 [N1/Q1/I1 案 §7](2026-10-07-agent-stack-n1q1i1-plans.md) 与栈总案 I2 节,I2 卡断链已修正。
转出项清单显示 WP6b/6c、SetSlot/Cancel/Handoff 消费、platform task 队列合一、黑板可回放增量
均无阶段载体,需负责人排期;「批准版本关联」与「负责人缺项」两栏仍待负责人确认。
后续维护:主案或任务变化时先更新其唯一主记录,再更新这里的导航和核验快照。
更换 Docs/Dev 基线后重新核对 PR、版本与在途任务;新的索引状态不自动产生实施授权。
File diff suppressed because one or more lines are too long
@@ -0,0 +1,963 @@
{
"source": "SELF",
"checked_at": "2026-10-07T13:27:59.195848+00:00",
"dev_base": "eb0d4b5a499322a23155c8d89a024247f6e7830d",
"docs_pin": "b8eaa1676f168ad64c437857e2607e2e213f6672",
"docs_main": "5542319a0474fd4e866b6daacb937b587c833ede",
"limits": "API/Git state only; no runtime testing or assertion of human implementation approval",
"proposals": [
{
"path": "docs/proposals/2026-09-29-system-skeleton-design-and-plan.md",
"source_blob": "2ba08d7017e7f45c6bc1493a46c050765613f7ac",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-09-30-card-stream-artifact-unify-project-inbox.md",
"source_blob": "0066c25a1f737fc6fe213cec677803d4d1163cbf",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-09-30-cardflow-and-process-split.md",
"source_blob": "fb737b396ec35d7d848b71f8c30c39779b64366b",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-09-30-configuration-surface.md",
"source_blob": "abd37122514d0aeded245a23167b78e12c7b0833",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-09-30-cross-session-reading.md",
"source_blob": "b96c0dae76b347841f46380d06d53806869e338a",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-09-30-dual-tier-storage-and-multitenancy.md",
"source_blob": "1880c2ac14e91f6db24d9b104f1f7bb2547fe166",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-09-30-file-preview-and-reserved-capabilities.md",
"source_blob": "f48af6d25937d2e5aacc946d0023a53e3c09bde4",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-09-30-ui-inbox-command-workspace.md",
"source_blob": "e78e19732856cbfc9d0105302aae2ff2c453c2d4",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-09-30-ui-redesign-and-auth.md",
"source_blob": "155cbf0993b40f4ea616aef95aaee7ff71d7db6b",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-10-01-agent-harness.md",
"source_blob": "b3b304c9f31fca632ffa47326c48556ee0ee7cca",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-10-01-base-extension-roadmap.md",
"source_blob": "b2b99878dd1fc95f86f28f0b007d012c5171d597",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-10-01-extension-compat-policy.md",
"source_blob": "1daba9f4f7441bdde8d648cd08f663ffa36cc7e9",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-10-01-plugin-contract-v2.md",
"source_blob": "08395fbf53a306b76d692e1ded8ee0d1f41716af",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-10-02-agent-stack-completion.md",
"source_blob": "a6e7cb732ae4c7b403b81e5597620b58644438fc",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-10-05-ext-1-inproc-command-handler.md",
"source_blob": "988e5516b4b3f7919071f667d543b55dcbdb08fe",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-10-06-ext-5-host-parse-document.md",
"source_blob": "2a54cfd98874e4f94d2b74967e0541fa27f4601d",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-10-07-agent-stack-n1q1i1-plans.md",
"source_blob": "ee44529a8c283693875f4bb1c11dde7b9939e60c",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
},
{
"path": "docs/proposals/2026-10-07-agent-stack-n2-plan.md",
"source_blob": "647b04848a6a77a68b1754f200ae61804d1a0740",
"present_in_dev_pin": false,
"same_blob_as_dev_pin": false
},
{
"path": "docs/proposals/2026-10-07-rdm-phase-plan.md",
"source_blob": "d2a491849ef8d04ea04bfeb885ba6a15a3bdc1f5",
"present_in_dev_pin": true,
"same_blob_as_dev_pin": true
}
],
"pull_requests": [
{
"repo": "Agent-System-Dev",
"number": 12,
"title": "Pin backend with the configuration pipe and documents with its design",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/12",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T04:27:51Z",
"head_ref": "refs/pull/12/head",
"head_sha": "6f72c0d4dd99e5162339b57489446ef9b0b0534f",
"base_ref": "main",
"merge_sha": "a58f85e0d0ade6e8b4da3afe9985985a38bae47a",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 14,
"title": "Wire Agent-System-UI and Agent-Command into the Dev combo (T0)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/14",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T06:11:54Z",
"head_ref": "refs/pull/14/head",
"head_sha": "cc9d8ec66d2597f47b6c7bafc7a607957c2de188",
"base_ref": "main",
"merge_sha": "69e9471dafd275f98928ff005732b94c4b18b638",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 15,
"title": "T1: pin contracts combo (core cards/commands, agent-command v0) and guard task-finish",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/15",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T06:34:06Z",
"head_ref": "refs/pull/15/head",
"head_sha": "3ca7f374e63748e41476fbf0244b06ef0711d6dc",
"base_ref": "main",
"merge_sha": "69fd335deac237f5291298cb06a50bf03d11add7",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 19,
"title": "T2: pin the inbox combo (cardsvc backend, ui components, frontend wiring)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/19",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T07:36:09Z",
"head_ref": "refs/pull/19/head",
"head_sha": "d8dd604b8ab823f742c6e7b0f4ae43e23e4fda12",
"base_ref": "main",
"merge_sha": "10405f9479c83a7eccb9ab6133229d37013a9da5",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 21,
"title": "T3: pin the command-bus combo (cmdbus, InlineConfirmCard, symmetric entries)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/21",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T07:56:27Z",
"head_ref": "refs/pull/21/head",
"head_sha": "b9d4df056116128e450f163cb3de568c032f8d91",
"base_ref": "main",
"merge_sha": "7393d6b95850982043b5d31aa2db6953a5bcd031",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 23,
"title": "T4: pin the workspaces combo (OverlayHost, pure-inbox rail, Cmd shortcuts)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/23",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T08:09:48Z",
"head_ref": "refs/pull/23/head",
"head_sha": "4318a0bad8cb1025a3323d2942486812f7aeff5a",
"base_ref": "main",
"merge_sha": "b6822096834853942439a4069a78b519b354731c",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 25,
"title": "T5: pin the polish combo (zero-page walkthrough, tidy, guide) - proposal complete",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/25",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T08:18:34Z",
"head_ref": "refs/pull/25/head",
"head_sha": "61dc542e56fa64f78c5da3cdc69da2890db122f3",
"base_ref": "main",
"merge_sha": "3be968af731eecc7b9cd4699c54671b7a9c9cbd9",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 30,
"title": "界面重构与多用户认证设计提案(documents gitlink + 任务卡)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/30",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T10:02:29Z",
"head_ref": "refs/pull/30/head",
"head_sha": "f9d2aaa2739f9678ee4df7040c7ca80afcfca180",
"base_ref": "main",
"merge_sha": "32bb3457d174e6c837ef9b411138d2b57f5839f6",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 37,
"title": "Task-centric sidebar R1 (option A): gitlinks + task card",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/37",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T10:46:46Z",
"head_ref": "refs/pull/37/head",
"head_sha": "6cfdb89f21945a0c9f5dae9451bde5c9f099d05b",
"base_ref": "main",
"merge_sha": "075c187be28c15b3b66c14adf3edcbeeafb5c05f",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 43,
"title": "Admin-issued accounts R2: gitlinks + task card",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/43",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T11:17:31Z",
"head_ref": "refs/pull/43/head",
"head_sha": "66eae890170c2373681384ddb1b8ae84454a4e87",
"base_ref": "main",
"merge_sha": "2f319ca0f5b86e12796042e72f65d3d939b97182",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 53,
"title": "R4 visual refresh: gitlinks + task card",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/53",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T12:44:52Z",
"head_ref": "refs/pull/53/head",
"head_sha": "73b2802b69eb23be4dd16db41f316f0ab8ac99ca",
"base_ref": "main",
"merge_sha": "b0699598191a51b912aae4e69e39d7d48a38188e",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 61,
"title": "UI capability platform: gitlinks + .gitignore + task card",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/61",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T14:23:41Z",
"head_ref": "refs/pull/61/head",
"head_sha": "0bf2f9beccb806f7201a5b069aebd259fab49320",
"base_ref": "main",
"merge_sha": "58f191189bf807c86bad3399fa295088ce26a5fa",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 67,
"title": "Deliver layered cross-session reading and pin the five module PRs",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/67",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T15:27:41Z",
"head_ref": "refs/pull/67/head",
"head_sha": "835e3ce187412298060a9fd0e7f60f158ed05796",
"base_ref": "main",
"merge_sha": "816b40e8f74d27218c2ed321dc88007fd298bed3",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 71,
"title": "Deliver part-order fidelity, artifact downloads, file management, and the settings shell fix",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/71",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T15:44:05Z",
"head_ref": "refs/pull/71/head",
"head_sha": "7e9cac8a40a479d1f4a4790db38fef370aa28724",
"base_ref": "main",
"merge_sha": "bb1bf06aec6d3f848ce6a1ca291c6ef6dc4da4ab",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 77,
"title": "Pin the file-preview proposal and restore the regressed module gitlinks",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/77",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T16:06:43Z",
"head_ref": "refs/pull/77/head",
"head_sha": "937c4ed9011dbc86dac85eaaa691335b9a2393e3",
"base_ref": "main",
"merge_sha": "a3f3cb0a841c7d918982b24590bb58bcf804a2ad",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 79,
"title": "Agent-System-Dev: review fixes for chat-process-split-r1 (symlink, live interleaving, artifact process)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/79",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T16:17:03Z",
"head_ref": "refs/pull/79/head",
"head_sha": "f3056cb9d6bdbb0061848661afb8b61a7d8dc06f",
"base_ref": "main",
"merge_sha": "eb1877b3f707fc5bc6e59cd531e6d9d69424129b",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 90,
"title": "Pin cardflow-r1 module combination (CF1: submit_card, card anchor, process split)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/90",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T17:14:50Z",
"head_ref": "feature/cardflow-r1",
"head_sha": "9451887c059fac7fe987544ac455b51f39911201",
"base_ref": "main",
"merge_sha": "75d5a1721e928eb832f54b5d4aaf1def304021e6",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 94,
"title": "Deliver file previews, dual-dock placement, and reserved delete/fs capabilities",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/94",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T17:21:30Z",
"head_ref": "feature/file-preview-caps",
"head_sha": "f958bfb326c7dae646fb1dd6dabc5faf2d63221d",
"base_ref": "main",
"merge_sha": "2c8e1b8d5762685256e2e9bb27eb29b4008d738e",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 100,
"title": "Land card streaming (CF-S: card_begin/card_append/card_commit)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/100",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T18:23:29Z",
"head_ref": "feature/card-stream-r1",
"head_sha": "e240f909113ccf96fd2241da6aeb3804fa6cb414",
"base_ref": "main",
"merge_sha": "a8faa967cdc0fe0d20a3cb20ed17f74518b6cff7",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 103,
"title": "Land artifact unification (CF-A: backfill symmetry + facade cards)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/103",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T18:44:17Z",
"head_ref": "feature/artifact-unify-r1",
"head_sha": "a4c0d1ad1b53f4c8831bcd8abfb824c112947802",
"base_ref": "main",
"merge_sha": "675e6f8483e11d67a49f3c68b8b98a44cb42b7e1",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 105,
"title": "Land cross-session project inbox (CF3: D48-D51)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/105",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T19:20:29Z",
"head_ref": "feature/project-inbox-r1",
"head_sha": "25f65559ae45751fea811f06955641345d56c1d9",
"base_ref": "main",
"merge_sha": "0b82976c66aaaaf0515fd31eaee9abfa5cde193c",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 132,
"title": "Pin the extension roadmap and downstream spike",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/132",
"state": "closed",
"merged": true,
"merged_at": "2026-10-01T10:47:14Z",
"head_ref": "feature/base-extension-roadmap",
"head_sha": "94b7de3a9f0debb5a5afb8e09974cc72a8a08e54",
"base_ref": "main",
"merge_sha": "db9c4690478b4fa4973efa1111e8764c73011ebb",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 134,
"title": "Pin the harness proposal and native tool-call replay",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/134",
"state": "closed",
"merged": true,
"merged_at": "2026-10-01T12:43:41Z",
"head_ref": "feature/agent-harness-p0",
"head_sha": "5e257192018c2d536ba4f16406e8ce9750c13952",
"base_ref": "main",
"merge_sha": "46b9e53f75f5383ea1ac961b8e6fa587f88ce64a",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 136,
"title": "Pin the harness turn loop across the three native checkouts",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/136",
"state": "closed",
"merged": true,
"merged_at": "2026-10-01T13:42:01Z",
"head_ref": "feature/agent-harness-p1",
"head_sha": "c5ab4c35e56bd762f37a22649fc94a4e2480bc5b",
"base_ref": "main",
"merge_sha": "def110d784dfeb0139062cb511a0b7de6e59ae81",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 138,
"title": "Pin backend to the final-turn result checks",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/138",
"state": "closed",
"merged": true,
"merged_at": "2026-10-01T14:00:59Z",
"head_ref": "feature/agent-harness-p2",
"head_sha": "7244f8c7305f075cc96c647021797677b4b804e8",
"base_ref": "main",
"merge_sha": "1939d50a7fcb61bdb4bc98cba84173e7e5fc9a11",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 140,
"title": "Pin backend to the depth-one subagent loop",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/140",
"state": "closed",
"merged": true,
"merged_at": "2026-10-01T14:51:02Z",
"head_ref": "feature/agent-harness-p3",
"head_sha": "8c43d4b16ce0d5aa700bfebb77b8a022de532b3d",
"base_ref": "main",
"merge_sha": "5096a052dcaef7ee08a3251ec50a47bf7f066618",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 142,
"title": "Pin P3b background subagents, review, and profile overrides",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/142",
"state": "closed",
"merged": true,
"merged_at": "2026-10-01T15:51:57Z",
"head_ref": "feature/agent-harness-p3b",
"head_sha": "79a6a73052920ba3bd2b4909d8287cf7e908a2e2",
"base_ref": "main",
"merge_sha": "ec4614322eaded96ee13f576992f016b47648200",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 144,
"title": "Add intent-to-workflow execution",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/144",
"state": "closed",
"merged": true,
"merged_at": "2026-10-02T01:04:03Z",
"head_ref": "feature/agent-harness-p4",
"head_sha": "cd984219da215db5978e7916c0439df74ce7b5aa",
"base_ref": "main",
"merge_sha": "3ba104c721013f63be249e2f810376d3d8b26ee3",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 151,
"title": "Pin documents to the agent stack completion proposal",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/151",
"state": "closed",
"merged": true,
"merged_at": "2026-10-03T14:15:52Z",
"head_ref": "refs/pull/151/head",
"head_sha": "83b2b0912e6e2e891f16590ca011fa374cb79478",
"base_ref": "main",
"merge_sha": "2a24d8418a7c0da0428481fd03c315a346eb597c",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 152,
"title": "Check nested library pins and test the three agent libraries",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/152",
"state": "closed",
"merged": true,
"merged_at": "2026-10-03T12:47:36Z",
"head_ref": "refs/pull/152/head",
"head_sha": "2e43703838a8fcb84cd00d669f28038b8a8d3efd",
"base_ref": "main",
"merge_sha": "7dd107bae40a203d684b0c9a3fd81ca316fd8c90",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 154,
"title": "Pin the R2 library and backend heads",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/154",
"state": "closed",
"merged": true,
"merged_at": "2026-10-03T13:22:55Z",
"head_ref": "refs/pull/154/head",
"head_sha": "a5377ec2347e08c84d428d980c652355fa7785be",
"base_ref": "main",
"merge_sha": "0a047db5c9c852539c6a839cf85589729f246019",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 156,
"title": "Pin the D1 library and backend heads",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/156",
"state": "closed",
"merged": true,
"merged_at": "2026-10-03T14:02:34Z",
"head_ref": "refs/pull/156/head",
"head_sha": "3cd83db5ca01de2227e8ab668355a431708193f9",
"base_ref": "main",
"merge_sha": "19b93ed09c0b80de78eed45763b482616b54ed06",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 167,
"title": "Add an architecture edge ratchet and waiting-state tokens",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/167",
"state": "closed",
"merged": true,
"merged_at": "2026-10-03T16:04:36Z",
"head_ref": "feature/architecture-baseline",
"head_sha": "4afccef8bd222355657da52ea1a9e07debfc3e8f",
"base_ref": "main",
"merge_sha": "e294729a44e11b15ab7ba2c70b04eafa235d5f95",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 207,
"title": "Add EXT-1 inproc command handler and owner-scoped host handle (minimal set)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/207",
"state": "closed",
"merged": true,
"merged_at": "2026-10-05T11:48:46Z",
"head_ref": "feature/ext-1-inproc-handler",
"head_sha": "4801a90319254bd8bbef5e22abf47acb10972014",
"base_ref": "main",
"merge_sha": "63a62a79ac52cc5d0b5d798dc586195ea842bd51",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 209,
"title": "Restore and complete the EXT-1 task card after branch recreation (verification round)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/209",
"state": "closed",
"merged": true,
"merged_at": "2026-10-05T12:07:12Z",
"head_ref": "feature/ext-1-inproc-handler",
"head_sha": "4801a90319254bd8bbef5e22abf47acb10972014",
"base_ref": "main",
"merge_sha": "15ec9bfbc57bbc1f9930ac4c3ef91edc8460ea4a",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 222,
"title": "Expose builtin document parsing through the host handle (EXT-5)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/222",
"state": "closed",
"merged": true,
"merged_at": "2026-10-06T15:14:31Z",
"head_ref": "refs/pull/222/head",
"head_sha": "f5c83534fe2cc3886842e66c2648362c5fa2af7c",
"base_ref": "main",
"merge_sha": "c06da5735904e63db4cbcdb75b3b10b48aeffc32",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 224,
"title": "Pin the wide-columns xlsx fix",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/224",
"state": "closed",
"merged": true,
"merged_at": "2026-10-06T15:39:48Z",
"head_ref": "refs/pull/224/head",
"head_sha": "12cda45fe8cd910253dacd75434efcf203f2ba0f",
"base_ref": "main",
"merge_sha": "c4985e96ce1c49da88f652e9a2d8ac2bec4a8b01",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 226,
"title": "Propose N1/Q1/I1 implementation plans (docs only)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/226",
"state": "closed",
"merged": true,
"merged_at": "2026-10-07T02:51:40Z",
"head_ref": "refs/pull/226/head",
"head_sha": "ddfd6a2b67209a1b9b2ba7810cb10919c0bb9743",
"base_ref": "main",
"merge_sha": "2147d5cb6566c301eaea3c65448bdda873093aea",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 229,
"title": "Propose the RDM phase plan (docs only)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/229",
"state": "closed",
"merged": true,
"merged_at": "2026-10-07T04:34:51Z",
"head_ref": "refs/pull/229/head",
"head_sha": "0384abc9aff3b30f23a4b95c6552e60071f5436d",
"base_ref": "main",
"merge_sha": "9c9483ac54ff5355c86824ac94097e65e59dcb5d",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 232,
"title": "Pin the merged WP5 gate-sinking combination",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/232",
"state": "closed",
"merged": true,
"merged_at": "2026-10-07T06:50:22Z",
"head_ref": "refs/pull/232/head",
"head_sha": "1a4053810acde922b68cca802ae2c7dba4e26ad7",
"base_ref": "main",
"merge_sha": "ae40cee917ca449fa8e75e6f2a665d94a18e3567",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 234,
"title": "Pin the merged I1 command-model and router combination",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/234",
"state": "closed",
"merged": true,
"merged_at": "2026-10-07T08:04:20Z",
"head_ref": "refs/pull/234/head",
"head_sha": "e793587677b73f9e0a8b7b200fb89cf002b71a5a",
"base_ref": "main",
"merge_sha": "1f7217f5bb2657418845d6bec6ae28c56920ddc8",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 235,
"title": "Pin the merged I1 eval-v2 combination",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/235",
"state": "closed",
"merged": true,
"merged_at": "2026-10-07T08:44:41Z",
"head_ref": "refs/pull/235/head",
"head_sha": "9c1cdbb10fe6237b80f40cf5184f2e3ae3378643",
"base_ref": "main",
"merge_sha": "eafe1e1fbf6874b58f851878c815c2c24e6f8db3",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 237,
"title": "Pin the merged superstep engine (Q1 WP1/WP2)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/237",
"state": "closed",
"merged": true,
"merged_at": "2026-10-07T09:12:58Z",
"head_ref": "refs/pull/237/head",
"head_sha": "8a1c84193922530c1489572ef6a1e136594bb1ef",
"base_ref": "main",
"merge_sha": "3bf2441b05489dfb55b3146aa4e0c53068d34b82",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 240,
"title": "Pin the merged SQLite convergence (Q1 WP5)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/240",
"state": "closed",
"merged": true,
"merged_at": "2026-10-07T10:38:59Z",
"head_ref": "refs/pull/240/head",
"head_sha": "1a02139026f412c90799bb01fe023bec173a2888",
"base_ref": "main",
"merge_sha": "ba36d47c2fbfdd0ba759fe251f87c403a5f7ffc7",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 242,
"title": "Take the backend intent slow lane and the I2 port pins (I2 WP3)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/242",
"state": "closed",
"merged": true,
"merged_at": "2026-10-07T11:58:02Z",
"head_ref": "refs/pull/242/head",
"head_sha": "733f3c74745ae46ae71a82b092867c7e4b45adf6",
"base_ref": "main",
"merge_sha": "d308ed66196b67970de19ad657410daffcca3740",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Dev",
"number": 244,
"title": "Take the N2 implementation plan and open the N2 task",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/244",
"state": "open",
"merged": false,
"merged_at": null,
"head_ref": "feature/agent-stack-n2",
"head_sha": "eae6992ae81335df5eb016223e2522fab952ae7f",
"base_ref": "main",
"merge_sha": null,
"merge_in_fixed_main": null,
"reviews": []
},
{
"repo": "Agent-System-Documents",
"number": 14,
"title": "界面重构与多用户认证设计提案 + HTML demo(方案 A/B/C + 认证)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/14",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T10:02:04Z",
"head_ref": "refs/pull/14/head",
"head_sha": "e601b253bc0d6a3fc762c7495d235b68f3910eb6",
"base_ref": "main",
"merge_sha": "ab14f62534fc8831db694fa580a7d163a3cc19ff",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Documents",
"number": 27,
"title": "Propose card stream, artifact unification, and project inbox (D44-D52)",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/27",
"state": "closed",
"merged": true,
"merged_at": "2026-09-30T17:45:16Z",
"head_ref": "feature/cardflow-future-plan",
"head_sha": "4a698869521eaa60b2fba9bdb3196226691bf987",
"base_ref": "main",
"merge_sha": "437af31118814463cc44d379f7269afd7add62b5",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Documents",
"number": 31,
"title": "Document the base extension roadmap and plugin contract v2",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/31",
"state": "closed",
"merged": true,
"merged_at": "2026-10-01T10:47:11Z",
"head_ref": "feature/base-extension-roadmap",
"head_sha": "a0da588f9035e132bcfd1dcc0ac1dacb62924776",
"base_ref": "main",
"merge_sha": "f3a3a5deb48e5b1c6ceb1b666d71ed912606c49d",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Documents",
"number": 32,
"title": "Propose the agent harness and link it from the roadmap",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/32",
"state": "closed",
"merged": true,
"merged_at": "2026-10-01T12:43:26Z",
"head_ref": "feature/agent-harness-p0",
"head_sha": "a3f0b80759fa01094cb9ee26b2a17dba831317e2",
"base_ref": "main",
"merge_sha": "357e3fdb246a8a8d562e63e01d5170673bf4dcc6",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Documents",
"number": 34,
"title": "Propose the agent stack audit and completion design",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/34",
"state": "closed",
"merged": true,
"merged_at": "2026-10-03T14:12:17Z",
"head_ref": "refs/pull/34/head",
"head_sha": "233dfb54ea1cd8e8085769832eef18fb3eaa04b7",
"base_ref": "main",
"merge_sha": "76044b5895e8abe5bd1e3bf45ccfe3ea7edcdc42",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Documents",
"number": 39,
"title": "Restore the EXT-1 proposal and request EXT-5 host document parse",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/39",
"state": "closed",
"merged": true,
"merged_at": "2026-10-06T15:14:15Z",
"head_ref": "refs/pull/39/head",
"head_sha": "5825cd35f2cde87a737d2dacdd2e4a393063e3bc",
"base_ref": "main",
"merge_sha": "e53c6bf177ee9bfa2ae85e1baa35378e122577e3",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Documents",
"number": 40,
"title": "Propose N1/Q1/I1 implementation plans for the agent stack",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/40",
"state": "closed",
"merged": true,
"merged_at": "2026-10-07T02:51:31Z",
"head_ref": "feature/agent-stack-n1q1i1-plans",
"head_sha": "54ead4197f844b9547a9275dbf9ba8ff639cb5e9",
"base_ref": "main",
"merge_sha": "dd9c1ba558b9154a66e1d9bcab1d52dd09ad5a8e",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Documents",
"number": 41,
"title": "Propose the RDM phase plan: direction, invariants, and stage gates",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/41",
"state": "closed",
"merged": true,
"merged_at": "2026-10-07T04:34:51Z",
"head_ref": "feature/rdm-phase-plan",
"head_sha": "b8eaa1676f168ad64c437857e2607e2e213f6672",
"base_ref": "main",
"merge_sha": "0551d003000107a511f26642e68a947680956fc6",
"merge_in_fixed_main": true,
"reviews": []
},
{
"repo": "Agent-System-Documents",
"number": 42,
"title": "Propose the N2 implementation plan: context, protocol, and tools",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/42",
"state": "closed",
"merged": true,
"merged_at": "2026-10-07T12:38:28Z",
"head_ref": "refs/pull/42/head",
"head_sha": "96fd6599d1f2b60f44830ddae1b21185713269d9",
"base_ref": "main",
"merge_sha": "5542319a0474fd4e866b6daacb937b587c833ede",
"merge_in_fixed_main": true,
"reviews": []
}
],
"open_pull_requests": {
"Agent-System-Dev": [
{
"number": 244,
"head_ref": "feature/agent-stack-n2",
"head_sha": "eae6992ae81335df5eb016223e2522fab952ae7f",
"title": "Take the N2 implementation plan and open the N2 task",
"url": "https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/244"
}
],
"Agent-System-Documents": []
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,83 @@
{
"generated_at": "2026-10-08T09:17:18+00:00",
"object": "Agent-System-RDM @ 4feb2f0 (pins=v0.1.0 四仓)",
"replays": {
"make test": {
"exit": 0,
"receipt": "test.json",
"receipt_sha256_16": "beadcc1ee93646d5"
},
"-ms1 ./docs/requirements": {
"exit": 0,
"verdict": "PASS",
"detail": "fa-chain 1130 切片(含重启存活);stage-accuracy 100%(5/5,金标与 docProfiles 同源,样本全 BD);two-speed 快速 0ms/慢速 done",
"receipt": "ms1.json",
"receipt_sha256_16": "be64043ec470b100"
},
"make ms0-acceptance (PG_CONTAINER=rdm-review-pg 一次性容器)": {
"exit": 0,
"verdict": "PASS=9 SKIP=0 FAIL=0",
"receipt": "ms0-acceptance.json",
"receipt_sha256_16": "b6a2c946d4fe9e50"
}
},
"upload_probes": {
"minutes.docx(真实纪要原件,私有:收据仅存本地不入库)": {
"exit": 0,
"wall_s": 0.78,
"parse": "rdm:docx parsed=true",
"verdict": "held 无关(疑似)",
"labels": "stage= workItem= topics=[]",
"note": "零字典命中;快速回执时限达标但无初步归类",
"local_receipt_sha256_16": "a29912f84b0c51fe"
},
"quote.xlsx(旧仓报价单模板)": {
"exit": 0,
"verdict": "unparsed rdm:unsupported",
"note": "原件留档可取回——EXT-5 不在 v0.1.0 pin"
},
"plan.pptx(python-pptx 构造图文稿)": {
"exit": 0,
"verdict": "unparsed rdm:unsupported",
"note": "同上"
},
"irrelevant.txt": {
"exit": 0,
"verdict": "held 无关(疑似)",
"note": "零命中挂起,确认前不入库(MS1 第3条行为)"
},
"broken.docx": {
"exit": 0,
"verdict": "unparsed rdm:docx parsed=false",
"note": "显式告知 zip 无效+原件留档(SR-A5 负例)"
}
},
"entrance_probes": {
"POST /api/commands/rdm.ping": {
"http": 200,
"state": "committed",
"note": "命令入口通"
},
"POST /api/conversations/{id}/messages text=/help": {
"http": 200,
"note": "对话入口 slash 路由对内置命令通"
},
"POST /api/conversations/{id}/messages text=/rdm.ping": {
"http": 400,
"body": "未知命令 /rdm.ping(/help 查看)",
"note": "插件命令无 slash 别名——对话入口不可达 RDM 命令"
},
"POST /api/chat (RDM 工作台 sendChat 的目标端点)": {
"http": 404,
"note": "端点在 v0.1.0 pin、基座 main、RDM 三处均不存在;工作台自由文本路径 404"
},
"receipts": [
"entrance.json",
"entrance2.json"
]
},
"notes": [
"全部收据为 SELF(本机隔离克隆重放;RDM 仓无 CI,不存在 GATE)",
"残留进程(非本任务所起,未处置):PID 2784320 (18799, 主检出 ./data) 与 PID 3096018 (18810, /tmp/rdm-init.* 旧实例)"
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long