Archived
文档:编排层 Mastra 化四阶段状态对账 —— 解耦已达成,编译器待 spike 结论
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
@@ -27,6 +27,28 @@ ADR-011 的「绑定先于策略」随岗位一起退场 —— 工作组快照
|
||||
按岗位点名的绑定语义不复存在。still 欠:起单时选组、按人指派、认领池 —— 运营中心的
|
||||
分派界面落地后,这里的默认轮值让位。
|
||||
|
||||
## 编排层 Mastra 化 · 阶段状态(2026-07-28)
|
||||
|
||||
四阶段路线(用户拍板:端口化 + 双实现;回边先 spike;Agent 放开工具循环):
|
||||
|
||||
| 阶段 | 内容 | 状态 |
|
||||
|---|---|---|
|
||||
| 0 | loop 三修(提交放行发验收卡 / 事件只记不跑 / 轨迹喂回叙事面) | ✅ 已落 |
|
||||
| 1 | 抽 `FlowRuntime` 端口:执行面成可替换切面,usecase 成薄壳 | ✅ 已落(八例 E2E 为等价性护栏) |
|
||||
| 2 | reopen 回边 spike:`.dowhile` 子图 vs 外部胶合新 run | 进行中(`spike/mastra-reopen/`) |
|
||||
| 3 | Mastra 编译器 = `FlowRuntime` 第二实现 | 待 spike 结论 |
|
||||
| 4 | Agent 开环:Mastra `Agent` + 工具总线 | ✅ 已落(`JCAI_AGENT_OPEN_LOOP=1` 开启,缺省仍单拍) |
|
||||
|
||||
**解耦本身已达成**(不依赖阶段 3):编排层对活动只有两个触点(`TaskGateway.start`
|
||||
起活动 / 终态回报),执行面可整体替换而活动侧无感 —— 证据是
|
||||
`new-package-flow.it.test.ts`:从零建一条新流(建包 → 链接已装载的活动 →
|
||||
双判据激活 → 起单 → 走完),全程没碰活动一行代码。
|
||||
|
||||
阶段 3 的已知语义冲突(编译器必须绕,详见 process/CONTRACT.md):
|
||||
回边 reopen 无原语、`.parallel()` 任一失败即整体失败(与「局部失败不连坐」相反)、
|
||||
三态聚合投影(`abnormal` 防假成功,Mastra run 无此态)、`node_instance`
|
||||
投影表必须照写(治理台按行查)。
|
||||
|
||||
## 鉴权(ADR-010 落地后的已知欠账)
|
||||
|
||||
- **登录失败无次数限制**:可无限次试口令。单组织 ≤50 人、内网部署下暂缓;
|
||||
|
||||
@@ -120,12 +120,15 @@ while (cur?.status === 'suspended' && guard++ < 8) {
|
||||
console.log('最终 status =', cur?.status, 'result =', JSON.stringify(cur?.result));
|
||||
|
||||
const fin = await rawSnap(run.runId);
|
||||
console.log('\n终态快照 context 的键:', JSON.stringify(Object.keys(fin?.context ?? {})));
|
||||
console.log('终态 context["round-body.A4"].suspendPayload =', JSON.stringify(fin?.context?.['round-body.A4']?.suspendPayload));
|
||||
console.log('终态 context["round-body.A4"].output =', JSON.stringify(fin?.context?.['round-body.A4']?.output));
|
||||
console.log('终态 context["round-body.A4"] 是数组吗? ', Array.isArray(fin?.context?.['round-body.A4']));
|
||||
console.log('终态 stepExecutionPath =', JSON.stringify(fin?.stepExecutionPath));
|
||||
console.log('\n第 1 轮的 A4(taskId=T-A4-001, price=100)还在快照里吗?→',
|
||||
JSON.stringify(fin?.context?.['round-body.A4']).includes('T-A4-001') ? '在' : '不在(被覆盖)');
|
||||
const finInner = (await (storeA as any).stores.workflows.loadWorkflowSnapshot({
|
||||
workflowName: 'round-body',
|
||||
runId: run.runId,
|
||||
})) as Record<string, any> | null;
|
||||
console.log('\n终态外层快照 context 的键:', JSON.stringify(Object.keys(fin?.context ?? {})));
|
||||
console.log('终态外层 context["round-body"].metadata =', JSON.stringify(fin?.context?.['round-body']?.metadata));
|
||||
console.log('终态内层(round-body)context 的键:', JSON.stringify(Object.keys(finInner?.context ?? {})));
|
||||
console.log('终态内层 A4.suspendPayload =', JSON.stringify(finInner?.context?.['A4']?.suspendPayload));
|
||||
console.log('终态内层 A4.output =', JSON.stringify(finInner?.context?.['A4']?.output));
|
||||
console.log('终态内层 A4 是数组吗? ', Array.isArray(finInner?.context?.['A4']));
|
||||
console.log('\n台账(我们自己记的)里第 1 轮还在吗?');
|
||||
_internals.getLedger().dump('probe');
|
||||
|
||||
Reference in New Issue
Block a user