pm-mcp
v0.9.0AI 编码项目的单一事实来源 + 健康台账 MCP 服务(事实来源 / 路线图 / 防幻觉 / 七本账 / 断点续做 / token 经济)
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
init_project
初始化当前项目的 .pm/ 状态目录(单一事实来源),并自动写入 AGENTS.md 工作规矩(流程 + 判断两段;已存在则增量合并,不覆盖你的内容)。每个新项目只调用一次;已初始化请用 update_project。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
name * | string | 项目名 |
agents_md | boolean | 默认 true:自动写入/合并 AGENTS.md 工作规矩(流程 + 判断两段;false 关闭) |
description | string | 一句话描述 |
exposure | string | 暴露面,影响安全告警力度 |
goals | array | 项目目标列表 |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
license | string | 项目许可证(SPDX 名,如 MIT) |
modules | array | 初始模块登记 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
stack | array | 技术栈,如 ["TypeScript","React"] |
get_status
一站式「我在哪」:项目阶段 + 里程碑进度 + 进行中任务(含断点下一步)+ 健康摘要 + 最近变更。会话开工第一件事。since 可只看某日期以来的任务/会话变化。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
since | string | ISO 日期,如 2026-09-01:只看该日期以来的任务/会话变化 |
get_usage_log
使用日志:pm-mcp 被用了哪些工具、成败、耗时,以及输出 token 估算与「折叠省下的 token」——回答“用它到底省不省 token”。只记工具名与计量,不记参数内容。日志滚动保留约 2MB。
| Parameter | Type | Description |
|---|---|---|
last | integer | 返回最近 N 条明细(默认 20;汇总始终覆盖全部保留日志) |
ok | boolean | true 只看成,false 只看败 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
since | string | ISO 日期/时间,只看该时间之后的明细 |
tool | string | 只看某工具,如 get_status |
get_runtime_log
运行日志:server 就绪、watcher 状态、工具报错等服务级事件(info/warn/error),判断 pm-mcp 运行是否健康、哪里在反复出错。
| Parameter | Type | Description |
|---|---|---|
event | string | 只看某事件,如 tool.error / server.ready |
last | integer | 返回最近 N 条明细(默认 20) |
level | string | 只看某级别 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
since | string | ISO 日期/时间,只看该时间之后的明细 |
update_project
更新项目元信息/预算(描述、技术栈、目标、阶段、模块登记、许可证、暴露面、复杂度与输出预算)。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
completion_evidence | object | 默认要求tests_observed;兼容无计数运行器时显式选择execution_only并记录原因 |
description | string | |
exposure | string | |
goals | array | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
license | string | |
max_file_loc | integer | 单文件行数预算 |
modules | array | 模块登记(用于未登记目录检测) |
output_budget_lines | integer | 读类工具输出行数预算 |
phase | string | 当前阶段,如 MVP 开发中 |
refactor_quota_pct | number | 里程碑重构类任务最低占比% |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
scan_ignore | array | 本项目产物/缓存的相对排除 glob,例如 release/**;传 [] 清除;不应排除真实源码 |
session_blast_radius | integer | 单会话波及文件阈值 |
stack | array |
regenerate_dashboard
手动重新生成 PROJECT.md 仪表盘与 changelog.md(正常情况下每次写操作已自动刷新)。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
add_milestone
添加里程碑(M1/M2…,按顺序自动编号)。路线图的骨架;任务挂到里程碑上。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
title * | string | |
goal | string | 这个里程碑要达成什么 |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
update_milestone
更新里程碑(状态流转 planned/active/done/paused、标题、目标、顺序)。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
id * | string | 里程碑 id,如 M1 |
goal | string | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
order | integer | |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
status | string | |
title | string |
get_roadmap
查看路线图。depth=1 每个里程碑一行摘要(功能再多也不乱);depth=2 额外展开活跃里程碑的任务明细与断点。
| Parameter | Type | Description |
|---|---|---|
depth | integer | 默认 1 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
add_task
添加任务。长任务务必给 steps(显式步骤清单,断点续做的载体);走了捷径 type=debt 登记(债务账);修 bug type=fix。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
title * | string | |
acceptance | string | 验收标准 |
detail | string | |
files | array | 关联文件(相对路径) |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
milestone | string | 所属里程碑 id,如 M1 |
priority | string | |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
steps | array | 步骤清单(长任务必填) |
tags | array | |
type | string | 默认 feature |
list_tasks
分页列出任务(默认不含 done/cancelled,每页25)。按原过滤条件传 next_cursor 可取下一页;数据变化会使游标失效。文字摘要与结构化分页结果同时返回,不漏掉折叠的中间任务。
| Parameter | Type | Description |
|---|---|---|
cursor | string | 上页返回的 next_cursor;保留相同过滤条件 |
include_done | boolean | 默认 false |
milestone | string | |
page_size | integer | 默认25,受项目输出预算限制 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
status | string | |
tag | string | |
type | string |
update_task
一次更新任务、checkpoint 与会话。checkpoint 默认记会话;完成时用 record_session:true 一并记录,不再另调 log_session;files 给实际关联文件。feature/fix 转 done 必须有最新成功且源码匹配的测试报告,verification_run 可指明报告。文字 verification 不能代替执行证据。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
id * | string | |
acceptance | string | |
author | string | |
checkpoint | object | |
detail | string | |
files | array | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
milestone | string | null | |
priority | ||
record_session | boolean | checkpoint 默认 true;完成任务时设 true 合并会话。省略保留旧式单独记录方式 |
result_note | string | 完成笔记(转 done 必填) |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
status | string | |
step_done | integer | 勾选完成第 N 步 |
steps | array | 整体替换步骤清单 |
tags | array | |
title | string | |
verification | string | 怎么验证的:命令/测试名 |
verification_run | string | .pm/quality-runs 内最新的质量报告;省略时自动选最新 |
checkpoint
断点存档:长任务做到一半(或上下文快满)时随手保存「当前进度 + 下一步动作」。新会话 get_status 会直接给出恢复点,不用靠回忆。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
next_step * | string | 下一个具体动作(新会话从这里续做) |
note * | string | 当前进展到哪了 |
task_id * | string | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
register_feature
登记功能(回答「这个项目有哪些功能」)。entry_files=入口文件(漂移对账锚点),test_files=测试文件(测试背书)。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
name * | string | |
description | string | |
entry_files | array | 入口/实现文件相对路径 |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
module | string | 所属模块 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
status | string | 默认 implemented |
test_files | array | 对应测试文件 |
list_features
列出功能清单(可按模块/状态过滤)。
| Parameter | Type | Description |
|---|---|---|
module | string | |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
status | string |
record_decision
记录架构决策(ADR):为什么这么选、决定了什么、有什么后果。认知债务的解药——半年后还能回答「当时为什么」。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
context * | string | 背景与约束(为什么需要做选择) |
decision * | string | 决定与理由 |
title * | string | |
consequences | string | 后果/代价/被放弃的方案 |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
list_decisions
列出全部架构决策(ADR)。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
log_session
收工仪式:记录本次会话(做了什么、改了哪些文件、下一步)。files 是变更足迹(churn 账与波及面告警的数据源),务必如实列出。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
summary * | string | 本次做了什么(一两句) |
author | string | 署名:zcode / codex / human:名字 |
files | array | 本次改动/新增/删除的文件(相对路径) |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
next_steps | array | 留给下次的下一步 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
log_debug
记录调试过程:症状 / 根因 / 修法 / 怎么验证的。调试知识账——下次同样的错不用从零猜,search_knowledge 可查。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
fix * | string | 修法 |
root_cause * | string | 根因(诊断出的真正原因,不是表面现象) |
symptom * | string | 症状:什么现象、报什么错 |
files | array | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
task_id | string | 关联任务 id |
verified_how | string | 怎么确认修好了 |
search_code
在真实代码里检索(防幻觉事中防线):谈某个功能/文件之前先搜实码。返回 file:line 片段而非整文件(token 经济)。默认按字面量匹配;regex=true 时按 JavaScript 正则(仅在你确需时开启)。
| Parameter | Type | Description |
|---|---|---|
query * | string | 关键词(默认字面量匹配) |
glob | string | 限定文件范围,如 src/**/*.ts |
max_results | integer | 默认 30 |
regex | boolean | 默认 false;true 时 query 按正则解释 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
search_knowledge
检索六类项目知识源(ADR/任务/功能/会话/调试记录/文件索引)——回答「之前为什么这么做」「上次这个错怎么解的」,用历史结论代替重新推理。代码内容请用 search_code。
| Parameter | Type | Description |
|---|---|---|
query * | string | |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
annotate_file
给文件登记一行用途(文件用途索引):之后任何会话靠索引定位,不用打开文件。引用外部代码时可登记 source/license(provenance)。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
path * | string | 相对路径 |
purpose * | string | 一句话用途 |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
license | string | 该文件引用代码的许可证 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
source | string | 代码来源(URL/仓库),如引用自外部 |
snapshot_codebase
给代码结构拍快照(文件数/行数/目录分布/测试数/skip 标记/依赖清单)。之后 audit_structure 会与上次快照 diff。建议每个会话或每个里程碑结束时拍一次。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
audit_structure
八项结构对账(定期做):①增长与新增依赖 ②漂移对账(功能↔文件,防幻觉)③债务与重构配额 ④churn 热点 ⑤复杂度预算 ⑥索引覆盖率 ⑦足迹/产出 ⑧测试健康(禁用/蒸发/空测试/背书占比)。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
find_duplicates
重复代码检测:注释剥离/字符串占位/空白归一化的行指纹滑动窗口聚类,跨文件重复块按长度降序列出。
| Parameter | Type | Description |
|---|---|---|
limit | integer | 最多列出的重复组数,默认 20 |
min_lines | integer | 最小重复行数(有效代码行),默认 6 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
audit_osv
OSV.dev 已知漏洞查询(联网!默认关):把 manifest 声明的依赖(仅包名/版本/生态)批量发给 api.osv.dev 比对;必须显式 confirm=true 才发起网络请求。
| Parameter | Type | Description |
|---|---|---|
confirm * | boolean | 显式确认联网:本工具会把依赖名与版本发送到 api.osv.dev |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
timeout_ms | integer | 每批请求超时毫秒数,默认 30000 |
search_code_public
公开代码反查(联网!默认关):把一段本仓源码行作为精确短语发给 GitHub Code Search,列出包含相同代码的公开仓库;片段在参数里对用户全程可见,必须显式 confirm=true。
| Parameter | Type | Description |
|---|---|---|
confirm * | boolean | 显式确认联网:本工具会把一段真实代码行发送到 GitHub |
file | string | 从该文件取一行作为片段(相对项目根;缺省取最长行) |
line | integer | 指定取第几行(1-based) |
max_results | integer | 列出的命中数上限,默认 10 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
snippet | string | 要反查的单行代码片段(与 file 二选一) |
timeout_ms | integer | 请求超时毫秒数,默认 30000 |
audit_security
安全体检(只扫描本地、不联网,结果写入安全台账):密钥泄露 / 危险模式(eval、SQL 拼接、禁用证书校验等)/ 依赖风险。修复后重扫自动关闭;接受风险必须留理由。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
list_findings
查看安全台账(可按状态过滤)。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
status | string |
resolve_finding
处置安全发现:修复后标 fixed;带理由接受风险标 accepted(必须填 note——接受是显式选择,要留痕)。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
id * | string | 如 SEC-001 |
status * | string | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
note | string | accepted 时必填:接受理由 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
audit_license
许可证审计(法律账):依赖许可证清单与 copyleft 冲突、源码中的 GPL 家族许可证头、LICENSE 文件检查、来源登记清单。离线启发式,不替代法务。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
list_projects
列出本机所有被 pm-mcp 管理的项目(全局注册表)。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
init_governance
为旧项目初始化 .pm/governance.json;新项目 init_project 已自动创建。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
get_governance
查看结构化模块、owner、公开接口、仓库依赖与强制策略。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
upsert_module
新增或完整替换一个治理模块;root/owner/language/依赖边均经 schema 对账。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
id * | string | |
kind * | string | |
languages * | ||
name * | string | |
owners * | array | |
roots * | array | |
allowed_dependencies | ||
denied_dependencies | ||
depends_on | ||
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
public_interfaces | ||
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
upsert_interface
新增或替换跨模块公开接口及契约文件、provider/consumers、版本。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
consumers * | array | |
contract_files * | ||
id * | string | |
kind * | string | |
provider * | ||
version * | string | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
upsert_repository
登记当前组合视图中的仓库、版本及跨仓 semver 约束。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
dependencies * | array | |
id * | string | |
name * | string | |
version * | string | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
set_governance_policies
更新治理强制策略;未传字段保持原值。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
enforce_declared_dependencies | boolean | |
enforce_ownership | boolean | |
enforce_public_interfaces | boolean | |
fail_on_semantic_fallback | boolean | |
fail_on_unresolved | boolean | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
minimum_coverage_pct | number | |
minimum_semantic_assurance | string | |
required_quality_kinds | array | |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
discover_languages
递归发现 Node/Python/Go/Rust/JVM/.NET 单元及其受控质量命令,不执行命令。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
audit_governance
审计跨文件/模块/语言语义覆盖、owner、公开接口、依赖边界、循环、unresolved 与质量矩阵覆盖。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
list_governance_issues
分页读取完整治理审计问题,不受 audit_governance 文本预算折叠影响;只读且按 offset/limit 返回。
| Parameter | Type | Description |
|---|---|---|
code | string | 按问题 code 过滤 |
limit | integer | 每页数量,默认 50 |
offset | integer | 起始偏移,默认 0 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
severity | string | 按级别过滤 |
dependency_graph
查询跨文件/模块依赖图:全局摘要(关系/环/入出边枢纽)、模块与文件级循环、聚焦文件的依赖邻域(BFS 方向与深度可调、未解析引用)。
| Parameter | Type | Description |
|---|---|---|
depth | integer | 邻域深度 1-6,默认 2 |
direction | string | 邻域方向,默认 both |
focus | string | 聚焦文件(相对项目根路径) |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
list_semantic_evidence
列出已登记的语言原生 AST、编译器或运行时语义证据;损坏文档会使整次读取失败。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
replace_semantic_evidence_for_file
按源码文件原子替换语义证据:删除该文件旧 evidence,仅保留当前 hash-bound evidence。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
document * | object | |
id * | string | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
save_semantic_evidence
保存一份绑定源码 SHA-256 的语言原生 AST/编译器/运行时证据;过期摘要在治理审计中严格失败。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
document * | object | |
id * | string | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
impact_analysis
从变更文件沿 file/module 反向依赖闭包计算受影响文件与模块。
| Parameter | Type | Description |
|---|---|---|
files * | array | |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
plan_quality_matrix
生成跨语言真实质量命令计划;只规划,不启动进程。
| Parameter | Type | Description |
|---|---|---|
kinds | array | |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
unit | string |
run_quality_matrix
显式执行跨语言质量矩阵。只运行受支持适配器生成的 argv,shell=false;缺工具/超时/非零均失败。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
confirm_execute * | boolean | 必须显式为 true;该操作会运行目标项目构建/测试命令 |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
kinds | array | |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
stop_on_failure | boolean | |
unit | string |
get_portfolio
聚合当前项目或全局注册项目的阶段、里程碑、债务、安全、语言、跨仓依赖/版本/cycle;加载失败不能假绿。
| Parameter | Type | Description |
|---|---|---|
current_only | boolean | |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
list_acceptance_baselines
列出版本化验收基线、审批状态、当前 fingerprint 和规模。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
get_acceptance_baseline
读取一个验收基线;默认返回摘要,full=true 返回严格 JSON。
| Parameter | Type | Description |
|---|---|---|
baseline_id * | string | |
baseline_version * | string | |
full | boolean | |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
save_acceptance_baseline_draft
从项目内 .pm/acceptance 下的严格 JSON 保存 draft 基线;批准后的同版本不可覆盖。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
baseline_file * | string | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
approve_acceptance_baseline
按当前 SHA-256 fingerprint 原子批准基线;fingerprint 变化即拒绝,批准后修改必须升版。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
approval_rationale * | string | |
approved_by * | string | |
baseline_id * | string | |
baseline_version * | string | |
expected_fingerprint_sha256 * | string | |
approved_at | string | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
evaluate_acceptance
读取项目内 .pm/acceptance evaluation JSON,逐项复算证据 SHA-256,再生成不可手填、不可覆盖的正式报告。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
baseline_id * | string | |
baseline_version * | string | |
evaluation_file * | string | |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
set_goal
设定项目的最终目标与机器可判定的验收标准——这是「自动迭代直到完成」的终点判据。不会覆盖 update_project 的 goals 列表。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
acceptance * | string | 机器可判定的验收标准,具体到能执行或能核验,如「npm run quality 全绿 + 验收基线 xxx@1.1.0 通过」。为空会被拒绝:没有判据就没有终点。 |
objective * | string | 最终目标:一句话说明项目要达成什么 |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
note | string | 补充说明(范围、不做的事) |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
set_orchestrator
手动开关自动编排并调整并发与预算。enabled 变更必须给 reason(留痕)。并发与预算可随时单独调整,下一轮生效。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | true 开启自动编排,false 暂停 |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
max_concurrency | integer | 同时执行的任务数上限,1-8 |
max_hours | 本轮项目最长多少小时(0.1-168);传 null = 不限 | |
max_rounds | 本轮项目最多跑多少轮(1-500);传 null = 不限 | |
max_total_tokens | 累计 token 上限;传 null = 不限。达到即 budget-exhausted | |
reason | string | 开关理由,changed enabled 时必填,写入台账日志 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
complete_goal
在按 acceptance 完成核验后,显式标记目标已完成。完成后编排进入终止态,调度不得再开新轮;设定新目标会清除完成标记。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
note | string | 完成说明:按什么证据判定验收通过(写入台账日志) |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
record_round
记录一轮自动执行的开始与结束,驱动停滞检测、连续失败退出与轮数预算。由外部定时任务/workflow 调用。每轮必须先 begin 再 end,且同一 run_id 只能结算一次。begin 会记录源码/质量报告基线;end 声称有证据时会核验源码是否真变、质量报告是否为结构有效的新文件——空转冒充产出会被降级为无证据。 多 Agent 执行同一业务时传相同 idempotency_key;同键同参数只执行一次,同键不同参数拒绝。
| Parameter | Type | Description |
|---|---|---|
action * | string | begin 开轮,end 收尾 |
run_id * | string | 本轮标识:workflow 运行 id / cli 会话 id 或时间戳(自愈时据此回查真实状态) |
failure | string | end 时填:本轮失败的简短原因(如额度耗尽)。连续失败达到阈值会退出循环。 |
idempotency_key | string | 跨 Agent 业务幂等键,建议格式 task-id:operation,如 T-123:add-task |
produced_evidence | boolean | end 时填:本轮是否产出新的可核验证据(测试报告/源码变更)。连续无证据会判定停滞并自动停止。 |
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |
run_kind | string | begin 时填:本轮由哪种执行器承载,缺省 manual |
tokens_unknown | boolean | end 时必填其一:确实无法测量 token 时显式传 true。与 tokens_used 二选一,省略两者会被拒绝 |
tokens_used | integer | end 时必填其一:本轮实际消耗 token,累计进台账用于 max_total_tokens 判定 |
get_orchestrator
查看自动编排状态:最终目标、开关、并发、预算余量、当前轮次、停滞与失败计数、最近台账日志。定时任务开轮前第一件事。
| Parameter | Type | Description |
|---|---|---|
root | string | 项目根绝对路径。仅当服务端报告无法确定调用方工作区(root_source 含「未猜测」)时才需要传。 |