test(agent): A0 gold for multi-CONTINUE patches and solidify
Offline coverage: two precise workbook patches then agent_workbook_solidify freezes the step worker into a quoted return. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
d0b184939f
commit
d7be903297
3 files changed
+82
-2
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| 状态 | **进行中 · A0 开工**(整文件补丁护栏 + soft 收紧 + solidify 单测) |
|
||||
| 状态 | **进行中 · A0 大部完成**(护栏 + soft + solidify 单测/金样;多轮 CONTINUE 离线金样) |
|
||||
| 日期 | 2026-08-28 |
|
||||
| 调研 | [agent-frameworks-and-marqdo.md](../research/agent-frameworks-and-marqdo.md) |
|
||||
| 设计 | [ext-agent.md](../design/ext-agent.md) · [ext-agent-plan.md](../design/ext-agent-plan.md) · [ext-agent-parent.md](../design/ext-agent-parent.md) · [okf.md](../design/okf.md) |
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
| 波次 | 主题 | 验收线索 |
|
||||
|------|------|----------|
|
||||
| **A0** | 工作簿补丁 / 固化可靠性 | **in progress** — `apply_patch_blocks` 禁整文件 FIND;`soft` 仅吞「FIND not found」;decompose CONTINUE 检查 `n`;`workbook_solidify` 单测 |
|
||||
| **A0** | 工作簿补丁 / 固化可靠性 | **mostly done** — 整文件 FIND 护栏;`soft` 仅 miss;decompose `n` 检查;`workbook_solidify` 单测;金样 `agent-workbook-patch-a0`(双 CONTINUE + solidify) |
|
||||
| **A1** | OKF 复用飞轮(lookup / near / soft_match UX) | 二次同类 `plan` 走快路径;策展可读 |
|
||||
| **A2** | 过程可见(stream + view 过程卡) | 对齐 [agent-streaming.md](agent-streaming.md);真相仍可写回 |
|
||||
| **A3** | 上下文预算(源码/Skill 渐进披露) | 长 runbook 不爆窗,仍保持「源码即提示」 |
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
---
|
||||
title: agent workbook multi-CONTINUE patch + solidify (A0 offline)
|
||||
description: Two precise CONTINUE patches then agent_workbook_solidify freezes step workbook.
|
||||
import agent:ext/ai/agent.mq.md
|
||||
import json:lib/json.mq.md
|
||||
import fs:lib/fs.mq.md
|
||||
import plugin:lib/plugin.mq.md
|
||||
import sys:lib/sys.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
*p = > plugin.native_path name="agent"*
|
||||
1. `p`
|
||||
> plugin.load path=`p`
|
||||
2. *
|
||||
> print text=no-agent-plugin
|
||||
> sys.exit code=1
|
||||
|
||||
*paths = > json.parse text={"wb":".marqdo/agent-runs/a0-continue-wb.mq.md"}*
|
||||
*wb = > json.get value=`paths` key="wb"*
|
||||
|
||||
*seed = > json.parse text={"t":"---\ntitle: a0 workbook\n---\n\n# Goal\n\nMARK_A keep\n\n# main\n\n\u002a\u0060r\u0060 = > \u0060worker\u0060.step task=demo \u002a\n\u002a\u002a\u0060r\u0060\u002a\u002a\n"}*
|
||||
*body = > json.get value=`seed` key="t"*
|
||||
> fs.write_text path=`wb` text=`body`
|
||||
|
||||
*p1 = > json.parse text={"t":"DECISION: CONTINUE\nPATCH:\n<<<\nFIND\nMARK_A keep\n===\nREPLACE\nMARK_B keep\n>>>\n"}*
|
||||
*r1 = > json.get value=`p1` key="t"*
|
||||
*n1 = > fs.apply_patch_blocks path=`wb` text=`r1`*
|
||||
> print text=`n1`
|
||||
|
||||
*p2 = > json.parse text={"t":"DECISION: CONTINUE\nPATCH:\n<<<\nFIND\nMARK_B keep\n===\nREPLACE\nMARK_C done\n>>>\n"}*
|
||||
*r2 = > json.get value=`p2` key="t"*
|
||||
*n2 = > fs.apply_patch_blocks path=`wb` text=`r2`*
|
||||
> print text=`n2`
|
||||
|
||||
*mid = > fs.read_text path=`wb`*
|
||||
*has_c = > split value=`mid` sep="MARK_C done"*
|
||||
*nc = > len value=`has_c`*
|
||||
1. `nc` > 1
|
||||
> print text=continue-ok
|
||||
2. *
|
||||
> print text=continue-fail
|
||||
|
||||
*obs = > json.parse text={"value":"frozen-answer"}*
|
||||
*sol = > agent_workbook_solidify path=`wb` observation=`obs`*
|
||||
*ok = > json.get value=`sol` key="solidified"*
|
||||
1. `ok`
|
||||
> print text=solidify-ok
|
||||
2. *
|
||||
> print text=solidify-fail
|
||||
|
||||
*final = > fs.read_text path=`wb`*
|
||||
*still = > split value=`final` sep=".step"*
|
||||
*ns = > len value=`still`*
|
||||
1. `ns` == 1
|
||||
> print text=step-gone
|
||||
2. *
|
||||
> print text=step-still
|
||||
|
||||
*has_ans = > split value=`final` sep="frozen-answer"*
|
||||
*na = > len value=`has_ans`*
|
||||
1. `na` > 1
|
||||
> print text=answer-ok
|
||||
2. *
|
||||
> print text=answer-missing
|
||||
@@ -2716,6 +2716,20 @@ fn ext_agent_plan_decision() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ext_agent_workbook_patch_a0() {
|
||||
let status = Command::new("cargo")
|
||||
.args(["build", "-p", "marqdo_plugin_agent"])
|
||||
.current_dir(env!("CARGO_MANIFEST_DIR"))
|
||||
.status()
|
||||
.expect("build agent plugin");
|
||||
assert!(status.success(), "failed to build marqdo_plugin_agent");
|
||||
assert_out(
|
||||
"tests/ext/agent-workbook-patch-a0.mq.md",
|
||||
"1\n1\ncontinue-ok\nsolidify-ok\nstep-gone\nanswer-ok",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ext_agent_plan_observe() {
|
||||
assert_out(
|
||||
|
||||
Reference in new issue
Block a user