@luckychen1993/pm-mcp 0.6.0 → 0.6.1

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.md CHANGED
@@ -8,7 +8,12 @@
8
8
 
9
9
  > 核心理念:**把恶化从「无声发生」变成「显式记账」,把上下文从「模型记忆」搬到「仓库文件」。**
10
10
 
11
- 当前源码与 npm 最新发布为 **0.6.0**。公共安装示例使用 `@latest`;`setup --local` 可绑定已构建的本地入口。
11
+ 当前源码与 npm 最新发布为 **0.6.1**。公共安装示例使用 `@latest`;`setup --local` 可绑定已构建的本地入口。
12
+
13
+ ## 0.6.1:git 依赖测试健壮性与失败报告诊断
14
+
15
+ - **git 依赖测试健壮性**:测试 fixture 里全部裸 `spawnSync("git")` 改用共享 `resolveGitCommand()` fallback——质量矩阵/gate 的测试子进程继承发起方 PATH(MCP 服务端进程常无 git)时不再误报失败。
16
+ - **失败可诊断**:`quality-gate` 失败时打印 "failing tests" 摘录;质量报告持久化 `output_excerpt`(密钥最小化,只取失败用例名与位置,不带断言正文)。
12
17
 
13
18
  ## 0.6.0:Qoder 接入发布、git 对账兜底与完成门禁指路
14
19
 
@@ -3,6 +3,12 @@ import path from "node:path";
3
3
  import { atomicWrite, withLedgerLock } from "./store.js";
4
4
  import { refreshDerived } from "./dashboard.js";
5
5
  import { qualityResultSummary, weakestEvidence } from "./quality-evidence.js";
6
+ /** 失败报告附带的密钥最小化摘录:只取失败用例名与位置,不带断言正文(fixture 假密钥不得进账本)。 */
7
+ function failingExcerpt(stdout, stderr) {
8
+ const output = `${stdout}\n${stderr}`.replace(/\u001b\[[0-9;]*m/g, "");
9
+ const lines = output.split("\n").filter((l) => /^\s*✖\s/.test(l) || /^test at /.test(l));
10
+ return lines.slice(0, 80).join("\n").slice(0, 4000);
11
+ }
6
12
  /** Persist a secret-minimised quality summary; raw stdout/stderr never enter the ledger. */
7
13
  export function saveQualityRun(root, result, provenance) {
8
14
  const runAt = new Date();
@@ -33,6 +39,7 @@ export function saveQualityRun(root, result, provenance) {
33
39
  duration_ms: item.durationMs,
34
40
  output_truncated: item.truncated,
35
41
  output_summary: summaries[index],
42
+ ...(item.status !== "passed" ? { output_excerpt: failingExcerpt(item.stdout ?? "", item.stderr ?? "") } : {}),
36
43
  error: item.error ?? "",
37
44
  })),
38
45
  }, null, 2) + "\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luckychen1993/pm-mcp",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "AI 编码项目的单一事实来源 + 健康台账 MCP 服务(事实来源 / 路线图 / 防幻觉 / 七本账 / 断点续做 / token 经济)",
5
5
  "keywords": [
6
6
  "mcp",