Land OKF aliases, view SSE, workbook nav, and explicit parent ctor.

Complete the core agent roadmap: soft KB hits via Task aliases, EventBus-backed view streaming, D4 writeback/workbook navigation, and I3 explicit-super without implicit auto-super.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-10 11:58:26 +08:00
1 parent d1ddb74235
commit 2a9fceb51c
26 files changed
+918 -54

No files matched your search

+1 -1
View File
@@ -329,7 +329,7 @@ lib/subtask:spawn fn=<名> → wait
| D1 | 重写 `ext/ai/agent.mq.md` / `智能体.mq.md`:`单步` + 源码/位置注入 + **子任务调工具** + **结构化返回值**;运行时经 **ABI v2 agent 插件**(禁 ext 直调 host) | **done** |
| D2 | `多步`:按 [ext-agent-plan.md](ext-agent-plan.md)(观察→精确补丁;禁止整文件重写);**D2a–D2f 主路径已落地** | **done** |
| D3 | 金样例:离线单步 / 写回;**live 单步**(`tests/ext/agent-run-live.mq.md`);多步骨架(可不打网) | **live done** |
| D4 | `view` / `debug` 对工作簿与写回块的导航体验 | TODO |
| D4 | `view` / `debug` 对工作簿与写回块的导航体验 | done(workbook 链到 `/file?path=`;写回槽 `ok`/`error`/`trace` 徽章 + `#wb-{line}`;plan 结果卡) |
| O2 | OKF 任务知识包:`plan` reuse/promote([okf.md §7](okf.md)) | **done** |
### 非目标
+1 -1
View File
@@ -83,7 +83,7 @@
| 语法 | `# Child = > Parent`(右侧必须是 `>` + 简单类型名;无路径) |
| `_type` | 构造后仍为**最具体子类名** |
| 方法查找 | 先子类 `##`,未命中再沿基类链;同名则子类覆盖 |
| 构造 | v1 **不**隐式调用父构造;需要时在子类正文显式 `` `self` = > Parent … `` |
| 构造 | **不**隐式调用父构造(无 auto-super)。需要父字段时在子类正文首行显式 `` `self` = > Parent … ``,再改字段并 `**`self`**`;返回 map 的 `_type` 仍为子类名 |
| 多继承 | 不支持 |
| 诊断 | 未知基类、循环继承、非法 RHS(如 `# Foo = 1`) |
+8 -2
View File
@@ -342,7 +342,13 @@ Prefer spawning `resource` over re-planning.
- `concepts/skills/<slug>.md`
- `resources/<slug>.mq.md`
匹配:先按 slug 试探并核对 frontmatter `sig`,再扫目录按 `sig:`,最后回退旧 hex 文件名。v1 **精确命中**;不做 embedding。相近措辞自动复用属未来规划,见 [okf-near-match.md](../roadmap/okf-near-match.md)。
匹配顺序:
1. **精确**:slug 试探 + frontmatter `sig` → 扫目录 `sig:` → 旧 hex 文件名。
2. **别名(Accepted)**:精确 miss 后,扫 Task FM `aliases:`(YAML 列表或 `[a, b]`);`normalize_goal(query)` 与某条 alias **精确相等**则命中同一 Skill/resource。lookup 返回 `match: exact|alias`;`plan` 对 alias 写 `cache=soft-hit`。
3. **不做**默认 embedding / 编辑距离主路径。父裁决 soft_match 仍见 [okf-near-match.md](../roadmap/okf-near-match.md)。
`agent_kb_promote` 可选 `aliases=`(字符串或列表)写入 Task;再晋升时合并既有 aliases。
### 7.4 与 `## plan` 的契约
@@ -426,7 +432,7 @@ agent-kb 运行时实现归属 **agent 插件**(`agent_goal_sig` / `agent_kb_l
| **O2** | 本文锁定的任务知识包:`Marqdo Task` / `Agent Skill`;`plan` reuse/promote | **done**(host kb_* + plan 快路径) |
| **O3** | catalog 增强:`verified`/`sources` 可选;模块页可点击依赖;扫入 `agent-kb` 概念供人浏览 | **done** |
| **O4** | `log.md` 策展、可选 `kb query`、Attested-style「再现跑通」收据(非 BigQuery) | 远期 |
| **O5** | 相近任务可选软命中(规范句 / aliases / 父裁决;非默认向量库) | 规划见 [okf-near-match.md](../roadmap/okf-near-match.md) |
| **O5** | 相近任务软命中:Task `aliases` 第二趟已落地;规范句 / 父裁决 / 向量仍见 [okf-near-match.md](../roadmap/okf-near-match.md) | **aliases done** |
O2 设计落盘后,智能体侧实现文档可薄化为指向本文 §7,避免两套真理。
+4 -1
View File
@@ -102,8 +102,11 @@ marqdo view output tests/structure/hello.mq.md -o /tmp/hello-doc
| `GET` | `/` | 默认打开第一个 `.mq.md`(无文件时为空提示) |
| `GET` | `/file?path=…` | 单文件页 |
| `GET` | `/api/tree` | JSON 树(可选) |
| `GET` | `/api/events?path=…` | SSE(`text/event-stream`):订阅进程内 EventBus(`reasoning` / `delta` / `round` / `decision` / `done` / `error`) |
| `POST` | `/api/run` | JSON `{path, stdin?}`:后台 `run_file`;事件进 bus;结束补 `done`/`error`(不替代页内整页 stdout) |
| `POST` | `/api/foreign-run` | 外联代码块试跑 |
根目录锁死;拒绝 `..` 逃逸。
根目录锁死;拒绝 `..` 逃逸。默认页加载仍整页执行;Stream 面板为增强路径(`EventSource` + Run)。
---