codex-supervisor-mcp 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +3 -1
- package/README.md +3 -1
- package/package.json +1 -1
- package/skills/codex-supervisor/SKILL.md +2 -2
- package/src/acceptance-cli.js +29 -2
package/README.en.md
CHANGED
|
@@ -193,7 +193,7 @@ Thirty-nine.
|
|
|
193
193
|
|
|
194
194
|
Two fields are required by the MCP schema: `ownedPaths` and `goal.objective`. A writer must also pass the workflow preflight gate described above; the schema keeps `preflight_id` optional for old clients, which is a compatibility escape hatch, not the normal path. `ownedPaths` overlap is reserved at dispatch, the runtime guard checks direct file writes, and landing checks the complete diff.
|
|
195
195
|
|
|
196
|
-
`acceptance` runs in Bash with `errexit` and `pipefail`: an unhandled failure stops the check, including a failing test in `npm test | tail`. Workers run `node "$CODEX_SUPERVISOR_ACCEPTANCE_CLI"` for the exact supervisor contract instead of retyping checks in an interactive zsh. Handle expected failures explicitly with `if` or `||`; a timeout always fails, even when the command exits 0 after termination. Windows requires Git for Windows Bash and reports an error when it is missing. Displayed output is clipped without changing the exit code.
|
|
196
|
+
`acceptance` runs in Bash with `errexit` and `pipefail`: an unhandled failure stops the check, including a failing test in `npm test | tail`. Workers run `node "$CODEX_SUPERVISOR_ACCEPTANCE_CLI"` for the exact supervisor contract instead of retyping checks in an interactive zsh. The self-check opens the supervisor database read-only, so it needs no write access to the state directory. Handle expected failures explicitly with `if` or `||`; a timeout always fails, even when the command exits 0 after termination. Windows requires Git for Windows Bash and reports an error when it is missing. Displayed output is clipped without changing the exit code.
|
|
197
197
|
|
|
198
198
|
In a repository with `package.json`, acceptance that uses local JavaScript tooling such as `npm`, `pnpm`, `vitest`, `vue-tsc`, `eslint` or `nuxi` is rejected with `workspace_setup_required` unless `workspaceSetup` was provided. Dependency preparation is now a runtime gate, not a reminder for the model.
|
|
199
199
|
|
|
@@ -211,6 +211,8 @@ The standard frontend worktree setup is:
|
|
|
211
211
|
|
|
212
212
|
Pass the same setup to `preflight_codex_worker` and the target `create_codex_worker`; otherwise the runtime contracts do not match.
|
|
213
213
|
|
|
214
|
+
`workspaceSetup.links.source` resolves against the dispatch `cwd` and may also be absolute; `path` is always a relative destination inside the worktree. The source must already exist.
|
|
215
|
+
|
|
214
216
|
When dispatch omits `goal.tokenBudget`, the worker must omit `token_budget` entirely. The runtime guard rejects `0`, `1`, `null` and any invented value. If a budget is supplied explicitly, the worker must use that exact positive integer.
|
|
215
217
|
|
|
216
218
|
Acceptance commands receive `CODEX_SUPERVISOR_TASK_ID`, `CODEX_SUPERVISOR_BASE_COMMIT` and `CODEX_SUPERVISOR_RUN`: the current task, run base and run number, refreshed after rebase/resume.
|
package/README.md
CHANGED
|
@@ -203,7 +203,7 @@ land_codex_worker 核过了,带 commitMessage 代提交并落进集成
|
|
|
203
203
|
|
|
204
204
|
MCP schema 必填两个:`ownedPaths` 和 `goal.objective`。写 worker 还必须通过上面的 preflight 工作流门禁;`preflight_id` 暂时保留为 optional 只为兼容旧客户端,不是正常流程可以跳过。`ownedPaths` 的写冲突在派单时预留,运行时 guard 会查直接写入,land 会再查完整 diff。
|
|
205
205
|
|
|
206
|
-
`acceptance` 在 Bash 中启用 `errexit` 和 `pipefail`:未处理的失败会停止检查,`npm test | tail` 中的测试失败也会保留。worker 自查必须运行 `node "$CODEX_SUPERVISOR_ACCEPTANCE_CLI"
|
|
206
|
+
`acceptance` 在 Bash 中启用 `errexit` 和 `pipefail`:未处理的失败会停止检查,`npm test | tail` 中的测试失败也会保留。worker 自查必须运行 `node "$CODEX_SUPERVISOR_ACCEPTANCE_CLI"`,它只读 supervisor 状态库中的验收契约,不需要写数据目录;不要手抄到 zsh,变量拆词等交互壳差异不会污染证据。写 worker 不能只用 `test -s`、`test -f` 或 `[ -e ]` 这类文件存在性命令交付;要加真实 test、endpoint probe 或结构化执行证据。识别到的 test runner 输出 `no tests to run` / `[no test files]` 时,即使退出码是 0 也判失败。预期失败用 `if` 或 `||` 显式处理;超时始终判失败,即使命令收到终止信号后退出 0。Windows 需要 Git for Windows 的 Bash;找不到会报错。显示的输出会裁剪,退出码不会因此改变。
|
|
207
207
|
|
|
208
208
|
`package.json` 仓库里,如果 `acceptance` 使用 `npm`、`pnpm`、`vitest`、`vue-tsc`、`eslint`、`nuxi` 等本地 JavaScript 工具,而派单没有 `workspaceSetup`,会直接拒绝为 `workspace_setup_required`。这条是 runtime 硬门禁,不再靠模型记得手工链接依赖。
|
|
209
209
|
|
|
@@ -221,6 +221,8 @@ MCP schema 必填两个:`ownedPaths` 和 `goal.objective`。写 worker 还必
|
|
|
221
221
|
|
|
222
222
|
同一份配置要同时传给 `preflight_codex_worker` 和目标 `create_codex_worker`,否则 runtime contract 不匹配。
|
|
223
223
|
|
|
224
|
+
`workspaceSetup.links.source` 按派单的 `cwd` 解析,也可以直接写绝对路径;`path` 始终是 worktree 内的相对目标。源目录必须先存在。
|
|
225
|
+
|
|
224
226
|
普通 worker 启动时会关闭它继承到的 `codex-supervisor` MCP,不能再派 worker、resume、cancel 或改编排状态;主线程是唯一编排者。其他业务 MCP 不受影响;旁问 fork 仍关闭全部 MCP,因为它只允许只读回答。
|
|
225
227
|
|
|
226
228
|
`session_id` 只负责批次、默认门禁和审批,不再把同批 worker 的标题、汇报或 session objective 自动塞进新 worker。worker 只收到内部编译的 context capsule:L0 只标明 branch 与 acceptance 来源(不塞命令正文)、自身身份/任务、显式依赖的最小交付摘要和路径/SHA 命中的 verified facts;raw event、完整 diff、历史报告、candidate facts 都只可按需读取。repo fact 只有两个 checkout 的 canonical `origin`、repo-relative watched path 和 base SHA 同时匹配时才跨 checkout 可见;无可识别 origin 就保持 work-scoped。事实的 base SHA 不再覆盖、watched path 发生 Git diff、context 输入内容 hash 或非 Git in-place manifest 漂移时会自动追加 `expired` 版本并从 capsule 排除。主线程只看 `get_context_snapshot_meta`,需要证据时再显式 `get_fact` / `get_worker_result` / `get_worker_diff`。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codex-supervisor-mcp",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"mcpName": "io.github.zriyox/codex-supervisor-mcp",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "MCP server that dispatches and supervises parallel Codex CLI workers, one isolated Git worktree each, with a persisted work state machine.",
|
|
@@ -47,11 +47,11 @@ description: 用 Codex CLI 并行做可独立验收的功能包,每路一个 G
|
|
|
47
47
|
| `task` | 写清目标、背景、要改的交付面、边界和验收。不要写“优化一下”。最终报告格式由 supervisor 追加,不在这里重复 |
|
|
48
48
|
| `cwd` | Git 项目根,或非 Git 输入目录;实际执行目录由 `workspaceKind` 决定 |
|
|
49
49
|
| `workspaceKind` | Git 代码默认 `git_worktree`;非 Git 只读用 `read_only_in_place`;联网研究用 `scratch`;明确授权修改非 Git 目录才用 `in_place_write` |
|
|
50
|
-
| `workspaceSetup` | Git worktree 启动前准备依赖。支持 `links`、`submodules`、`commands
|
|
50
|
+
| `workspaceSetup` | Git worktree 启动前准备依赖。支持 `links`、`submodules`、`commands`。`links.source` 按 `cwd` 解析,也可写绝对路径;链接 `node_modules` 时会给 `.vite`、`.vite-temp`、`.cache` 可写缓存根 |
|
|
51
51
|
| `ownedPaths` | 必填。完整写入范围;不同 worker 的写入范围不能重叠。读取不排他。`[]` 只用于不 land 的只读或研究 worker |
|
|
52
52
|
| `sandbox` | 默认 `workspace-write`。这个沙箱不能 commit,这是正常边界;不要为了提交改用 `danger-full-access` |
|
|
53
53
|
| `preflight_id` | 写 worker 必填。preflight 的 base、`workspaceKind`、`sandbox`、`workspaceSetup`、`ownedPaths`、命令、context、contracts、network、可写根有任何变化都要重跑 |
|
|
54
|
-
| `acceptance` | worker 退出后由 supervisor 在 worktree 里执行。worker 自查统一运行 `node "$CODEX_SUPERVISOR_ACCEPTANCE_CLI"`,不要手抄到 zsh
|
|
54
|
+
| `acceptance` | worker 退出后由 supervisor 在 worktree 里执行。worker 自查统一运行 `node "$CODEX_SUPERVISOR_ACCEPTANCE_CLI"`,不要手抄到 zsh;CLI 只读状态库,不需要也不能写 supervisor 数据。每个检查必须真实证明功能 |
|
|
55
55
|
| `allowedCommands` | 声明会执行、会写入或有副作用的验证命令。read 命令有安全白名单;命令末尾 `*` 表示只匹配单条命令的前缀 |
|
|
56
56
|
| `forbid` | 明确禁止的命令片段。forbid 优先于 allowedCommands 和 acceptance |
|
|
57
57
|
| `goal.objective` | 必填。worker 会创建 Codex 原生 goal |
|
package/src/acceptance-cli.js
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { DatabaseSync } from "node:sqlite";
|
|
2
3
|
import { DEFAULT_ACCEPTANCE_TIMEOUT_MS, runAcceptance } from "./acceptance.js";
|
|
3
|
-
import {
|
|
4
|
+
import { dbPath } from "./paths.js";
|
|
5
|
+
|
|
6
|
+
function readTask(taskId) {
|
|
7
|
+
let db;
|
|
8
|
+
try {
|
|
9
|
+
// A worker runs this command inside its sandbox. Reading the contract must
|
|
10
|
+
// not initialize the schema, switch the journal mode or create state dirs.
|
|
11
|
+
db = new DatabaseSync(dbPath, { readOnly: true });
|
|
12
|
+
db.exec("PRAGMA busy_timeout=15000;");
|
|
13
|
+
const row = db.prepare(`
|
|
14
|
+
SELECT acceptance, acceptance_timeout_ms, worktree_path, cwd, base_commit, run_count
|
|
15
|
+
FROM tasks WHERE id = ?
|
|
16
|
+
`).get(taskId);
|
|
17
|
+
if (!row) return null;
|
|
18
|
+
let acceptance = null;
|
|
19
|
+
try { acceptance = row.acceptance ? JSON.parse(row.acceptance) : null; } catch {}
|
|
20
|
+
return { ...row, acceptance };
|
|
21
|
+
} finally {
|
|
22
|
+
db?.close();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
4
25
|
|
|
5
26
|
const taskId = process.env.CODEX_SUPERVISOR_TASK_ID;
|
|
6
27
|
if (!taskId) {
|
|
@@ -8,7 +29,13 @@ if (!taskId) {
|
|
|
8
29
|
process.exit(2);
|
|
9
30
|
}
|
|
10
31
|
|
|
11
|
-
|
|
32
|
+
let task;
|
|
33
|
+
try {
|
|
34
|
+
task = readTask(taskId);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error(`cannot read supervisor task ${taskId}: ${error.message}`);
|
|
37
|
+
process.exit(2);
|
|
38
|
+
}
|
|
12
39
|
if (!task) {
|
|
13
40
|
console.error(`unknown supervisor task: ${taskId}`);
|
|
14
41
|
process.exit(2);
|