Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ boot 自动 ack 本 agent 的 `swarm.hello`。安装或拉代码后须重启 MCP
已暂停时 `next_action=await_supervisor_resume`。有待固化 run 时 `next_action` 仍是
`swarm_solidify`(`hint` 写明先固化;软缺口留在 `warning`,不盖掉这句),并带
`readonly_smoke`:只读冒烟用 `swarm_doctor` / `swarm_status`,不结算、不放宽门、不写
Parent。此时 `boot_once` 为空。忽略 `next_action` 再调 `swarm_tick` 时默认不启新周期。
Parent。软缺口(`soft_continue=true`)下 `swarm_doctor` 同样给出
`next_action=swarm_solidify` 与 preserve 三元组,不写 `gate_soft_continue`、不写
`session_not_failed`;硬阻断的 doctor 仍是 `ok=false`,不另给这个动作。此时 `boot_once` 为空。忽略 `next_action` 再调 `swarm_tick` 时默认不启新周期。
第一次 `ok=true`、`severity=soft`、`cycle_started=false`、`progress=false`、
`redirect_count=1`,`next_action` 仍是 `swarm_solidify`,不改 `last_run`。
同一条 run 再 tick 返回 `ok=false`、`loop_fuse=pending_redirect_loop`、
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

### Fixed
- **MCP 宿主可用性:未完成 run 的软缺口 doctor 指向固化**:`readonly_smoke` 点名的 `swarm_doctor` 在 `soft_continue=true` 且有未完成 run 时带 `next_action=swarm_solidify`、`pending_solidify` 与 preserve 三元组。`hint` 先写现在固化,软缺口仍是建议。不写 `gate_soft_continue`,不写 `session_not_failed`,不结算这条 run,不写 Parent baseline,不执行 `--fix`。没有未完成 run,或 doctor 本身是硬阻断(`ok=false`)时,不另给这个动作。
- **MCP 宿主可用性:未完成 run 的第一次 tick 重定向也写 `retryable=false`**:同一条未完成 run 的两次默认 `swarm_tick` 都带 `retryable=false`。缺席不再被读成「可以再 tick」。第一次仍是 `ok=true`、没有 `error`、`gate_soft_continue` 仍缺席(缺席不是 false,不把严格 false 当成整段会话失败)。保险丝仍是 `ok=false` 与 `loop_fuse=pending_redirect_loop`。不写 Parent baseline,不放宽固化门。
- **2000 字现场切片留住未跟踪新文件(DEBUG #57 续)**:失败 episode 与成功事件不再对 `capture_diff_snapshot` 的结果做 `[:2000]`。两臂都传入 `max_chars=2000`,截断在 helper 内完成。已跟踪 diff 会占满预算时,先裁跟踪前缀,固定留 480 字(不超过预算的四分之一)给未跟踪新文件块;没有合格未跟踪文件时,这截尾部还给跟踪 diff。返回长度不超过预算。`.venv` / `node_modules` / `__pycache__` / `.git` / 受保护文件 / `memory/`、`.evolver/` 等运行态目录 / 含 NUL 的二进制仍不进入补充。不改固化门,不写 Parent baseline,不开 val 密封。
- **失败现场 diff 包含未跟踪新文件(DEBUG #57)**:`capture_diff_snapshot` 在 `git diff HEAD` 之后追加未跟踪新文件的 unified diff。失败侧 `_failure_diff` 与成功侧共用这一 helper。依赖树、缓存、运行态目录、受保护路径和含 NUL 的二进制不进入这份补充。不改固化门,不写 Parent baseline,不开 val 密封。
Expand Down
8 changes: 8 additions & 0 deletions DEBUG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1224,3 +1224,11 @@
- **根因**:保险丝写了 `retryable=false`,第一次重定向没写。缺席不是 false。`gate_soft_continue` 不能借来当停 tick 的 false,那个名字在不读旁注的宿主那里就是会话失败。
- **修复**:未完成 run 的两次默认 tick(有软缺口与无软缺口)都写 `retryable=false`。第一次仍是 `ok=true`、没有 `error`、没有 `loop_fuse`,`gate_soft_continue` 在软缺口上仍然缺席。`session_not_failed=true` 与 preserve 三元组不动。保险丝仍是 `ok=false`。不写 Parent baseline,不放宽固化门。目录缓存(DEBUG #61)未做假修复。
- **经验**:**停 tick 的严格 false 要写在本来就表示「要不要再试」的字段上。** `gate_soft_continue=false` 和第一次就翻 `ok=false` 都会被另一类宿主读成整段失败。`retryable` 缺席必须当成「未说可以再 tick」,写上 false 才盖住把缺席默认成继续的那一型。只认 `gate_soft_continue` 的宿主这次仍覆盖不到。

### 70. 只读冒烟走到 `swarm_doctor` 后丢掉「去固化」(MCP 易用性,已修)

- **症状**:#69 之后,未完成 run 的 `readonly_smoke.tools` 仍是 `swarm_doctor` 与 `swarm_status`。status 带 `next_action=swarm_solidify`。doctor 在真实 git 仓库、冻结包未装时是 `ok=true`、`soft_continue=true`、`loop_ready=false`,没有 `next_action`,也没有 `pending_solidify`。hint 写软缺口不阻断循环。按冒烟去调 doctor、再服从 `next_action` 的宿主找不到动作;把缺席的动作加上 `soft_continue=true` 读成「循环没被挡住」的宿主会再 tick。doctor 自己不写 Parent baseline,但 `fixes` 里仍有 `evolver doctor --fix`(人执行时可能去量基线)。
- **根因**:doctor 只摘要开箱检查,不读未完成 run。冒烟清单把两个工具写成等价的只读入口,返回却不等价。
- **修复**:仅当未完成 run 且 `soft_continue=true`、没有硬 `blockers` 时,doctor 补上 `pending_solidify`、`next_action=swarm_solidify`、`readonly_smoke` 与 preserve 三元组。hint 先写现在调用 `swarm_solidify`,不要 tick,不要在固化前执行 `fixes`,本调用不结算、不写 Parent、不放宽固化门。不写 `gate_soft_continue`(严格 false 会重开 DEBUG #67)。不写 `session_not_failed`(那是 tick 重定向的旗标,不是 doctor 的健康位)。硬阻断(例如不是 git 仓库,`ok=false`)不另给 `next_action`。没有未完成 run 时 doctor 形状不变。不执行 `--fix`。目录缓存(DEBUG #61)未做假修复;工具描述与返回体同一口径,旧会话目录仍可能看不到新句子。
- **经验**:**冒烟清单里的两个工具必须给出同一个下一步。** 只读不等于可以丢掉 `next_action`。`soft_continue=true` 表示缺口不是硬停,不是再 tick 的许可。
- **仍在**:只读 `soft_continue`、忽略 `next_action` 的宿主仍可能再 tick。把 `soft_continue` 写成 false 会和 `gate_soft_continue=false` 一样,被不读旁注的宿主当成整段停,所以没有写。`fixes` 仍列出 `evolver doctor --fix`;本工具不执行它。hint 写明固化前不要执行。只认 `gate_soft_continue` 的 tick 重定向(DEBUG #69 余项 1)、把保险丝 `ok=false` 当成整段失败的宿主(余项 2)、以及目录缓存(DEBUG #61)这次都不动。
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Live `tools/list` already publishes `swarm_tick` parameters `prompt_mode` (`full

If a previous run is unfinished, `swarm_boot` keeps `next_action=swarm_solidify`, sets top-level `pending_solidify`, and adds `readonly_smoke` (`tools`: `swarm_doctor` and `swarm_status`, `settles_run`: false). `hint` says to solidify first. A soft gap (`no_baseline` / `pack_absent` / `unmeasured`) still attaches `warning` and `next_steps`, and it does not replace that hint or weaken the gate. A read-only smoke can call `swarm_doctor` or `swarm_status`; neither settles the run nor invents a Parent baseline. A `swarm_tick` in that state does not start a cycle. The first call stays soft (`ok` true, `severity` soft, `cycle_started` false, `progress` false, `redirect_count` 1, `retryable` false, `next_action` still `swarm_solidify`, `last_run` unchanged). An omitted `retryable` is not a license to tick again. The same call again on that run returns `ok` false, `loop_fuse=pending_redirect_loop`, `redirect_reason=pending_redirect_loop`, `severity` soft, `retryable` false, and no `error` field. It still does not start a cycle. `loop_fuse` and that `redirect_reason` are the tick-loop fuse. The code is not an `error` and not a `next_action`. `next_action` stays `swarm_solidify`. `dispatch_reason` stays `pending_solidify`. The first redirect keeps `redirect_reason=pending_solidify` and does not set `loop_fuse`. Connect-time instructions name `loop_fuse=pending_redirect_loop` the same way. The fuse is not a gate failure and not an abandon signal; a soft gap stays on `warning` and `next_steps`. Both returns set `preserve_pending` true, `abandon_run` false, and `action_required` to `swarm_solidify` (boot and status do too while solidify is still next). Do not drop the unfinished run. When a soft gap is present, `gate_soft_continue` is omitted on the first redirect and on the fuse (`tick_again` is false). Omitted is not false: the first redirect keeps `ok` true and sets no `error`, so a host that treats only a strict false as session death stays in the session and does not tick again. Both tick returns set `session_not_failed` true. Read that field before other flags: true means the session is not failed, and `loop_fuse` does not abandon the run when the preserve flags say to call `swarm_solidify`. `next_steps` starts with `swarm_solidify`. Boot and status keep `gate_soft_continue` true while a run is still unfinished, and they do not set `session_not_failed`. Pass `supersede_pending=true` to replace that run. Pause and the compaction checkpoint still refuse the cycle.

A cold `swarm_status` (this process has not called `swarm_boot`) returns `next_action=swarm_boot` and a short hint. After boot, status keeps `agent_name`, `source_revision`, and any soft `gap` / warnings. `tool_asset_search`, `tool_mailbox_poll`, `tool_cycle_timeline`, and `swarm_approvals` always return `{ok, items, hint}` — an empty match is not a blank body. `swarm_approvals` also keeps `pending` (the same rows as `items`) and `recent`. Read-only `swarm_doctor` mirrors `evolver doctor` without `--fix` (`ok`, soft warnings, command hints in `fixes`). `no_baseline` / `pack_absent` / `unmeasured` stay soft-continue.
A cold `swarm_status` (this process has not called `swarm_boot`) returns `next_action=swarm_boot` and a short hint. After boot, status keeps `agent_name`, `source_revision`, and any soft `gap` / warnings. `tool_asset_search`, `tool_mailbox_poll`, `tool_cycle_timeline`, and `swarm_approvals` always return `{ok, items, hint}` — an empty match is not a blank body. `swarm_approvals` also keeps `pending` (the same rows as `items`) and `recent`. Read-only `swarm_doctor` mirrors `evolver doctor` without `--fix` (`ok`, soft warnings, command hints in `fixes`). `no_baseline` / `pack_absent` / `unmeasured` stay soft-continue. When a run is unfinished and that report is soft-continue, doctor also sets `next_action=swarm_solidify`, `pending_solidify`, and the preserve triad (`preserve_pending`, `abandon_run=false`, `action_required=swarm_solidify`). It still does not settle the run or write a Parent baseline. `gate_soft_continue` and `session_not_failed` stay absent. A hard blocker keeps `ok` false and does not add that action.

`swarm_boot(project=...)` binds a directory only when that path exists. `bound_paths.repo_root` is the code root (the git root walked from that directory, or the directory itself). `bound_paths.workspace_root` is the mutation directory. When they differ, or when `project` is a free-text label rather than a directory, the same object carries `warning` and `next_steps`. That is a soft warning: `ok` stays true and the loop still continues. A label is not turned into a new workspace.

Expand Down
2 changes: 1 addition & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ uv run evolver migrate-state

若上一轮 run 还没固化,`swarm_boot` 的 `next_action` 仍是 `swarm_solidify`,顶层带 `pending_solidify`,并多一个 `readonly_smoke`(`tools` 为 `swarm_doctor` 与 `swarm_status`,`settles_run` 为 false)。`hint` 写明先固化。软缺口(`no_baseline` / `pack_absent` / `unmeasured`)仍附 `warning` 与 `next_steps`,但不盖掉这句 hint,也不放宽固化门。只读冒烟可以调 `swarm_doctor` 或 `swarm_status`:它们不结算这条 run,也不伪造 Parent baseline。

本进程尚未 `swarm_boot` 时,`swarm_status` 返回 `next_action=swarm_boot` 和一句 hint。boot 之后 status 仍带 `agent_name`、`source_revision`,以及软缺口的 `gap` / warnings。`tool_asset_search`、`tool_mailbox_poll`、`tool_cycle_timeline`、`swarm_approvals` 一律返回 `{ok, items, hint}`,没有命中也不是空正文。`swarm_approvals` 另外保留 `pending`(与 `items` 同一队列)和 `recent`。只读 `swarm_doctor` 等同 `evolver doctor` 且不执行 `--fix`(`ok`、软警告、`fixes` 里的命令提示)。`no_baseline` / `pack_absent` / `unmeasured` 仍是 soft-continue。
本进程尚未 `swarm_boot` 时,`swarm_status` 返回 `next_action=swarm_boot` 和一句 hint。boot 之后 status 仍带 `agent_name`、`source_revision`,以及软缺口的 `gap` / warnings。`tool_asset_search`、`tool_mailbox_poll`、`tool_cycle_timeline`、`swarm_approvals` 一律返回 `{ok, items, hint}`,没有命中也不是空正文。`swarm_approvals` 另外保留 `pending`(与 `items` 同一队列)和 `recent`。只读 `swarm_doctor` 等同 `evolver doctor` 且不执行 `--fix`(`ok`、软警告、`fixes` 里的命令提示)。`no_baseline` / `pack_absent` / `unmeasured` 仍是 soft-continue。有未完成 run 且这份报告是 soft-continue 时,doctor 也给出 `next_action=swarm_solidify`、`pending_solidify` 和 preserve 三元组(`preserve_pending`、`abandon_run=false`、`action_required=swarm_solidify`)。它仍不结算这条 run,也不写 Parent baseline。`gate_soft_continue` 与 `session_not_failed` 缺席。硬阻断保持 `ok=false`,不另给这个动作。

`swarm_boot(project=...)` 只在路径是已存在目录时绑定。`bound_paths.repo_root` 是代码根(从该目录向上找到的 git 根,否则就是该目录本身)。`bound_paths.workspace_root` 是变异所用目录。两者不一致,或 `project` 只是一段自由文本而不是目录时,同一对象带 `warning` 和 `next_steps`。这是软警告:`ok` 仍为 true,循环继续。自由文本不会被当成新的工作区。

Expand Down
Loading
Loading