add-coder 0.3.32 → 0.3.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-coder",
3
- "version": "0.3.32",
3
+ "version": "0.3.33",
4
4
  "private": false,
5
5
  "description": "[codein2027](https://github.com/xiaomingming92/codein2027) - A complete scaffolding for building the ADD programming paradigm, the implementation layer for AI code governance. Core principle: Audit as Infrastructure. Breaks the black-box programming process and cross-session amnesia, evolving programming paradigms into an auditable, traceable, and convergent new era. npx-ready.\n\n[codein2027](https://github.com/xiaomingming92/codein2027) 快速构建 ADD 编程范式的完整脚手架——AI 代码治理的落地方案。以「审计即基础设施」为核心,彻底打破编程过程黑盒与跨轮失忆,让编程范式进化为可审计、可追溯、可收敛的新时代。npx 即用,人人可体验。",
6
6
  "repository": {
@@ -53,8 +53,8 @@
53
53
  "@prisma/client": "^7.0.0",
54
54
  "dotenv": "*",
55
55
  "find-up": "^8.0.0",
56
- "prisma": "^7.0.0",
57
56
  "pg": "^8.16.0",
57
+ "prisma": "^7.0.0",
58
58
  "tsx": ">=4",
59
59
  "vector-cosine-similarity": "^1.8.0"
60
60
  },
@@ -102,8 +102,9 @@
102
102
  },
103
103
  "scripts": {
104
104
  "build": "tsup",
105
- "predev": "npm run db:ensure",
105
+ "predev": "npm run db:ensure && tsx scripts/hook-bake.ts --publish",
106
106
  "dev": "tsup --watch",
107
+ "prebuild": "tsx scripts/hook-bake.ts --publish",
107
108
  "db:ensure": "bash scripts/db-ensure.sh",
108
109
  "sync": "tsx scripts/sync-magic.ts",
109
110
  "sync:bash": "bash scripts/benchmark/sync-magic.sh",
@@ -1,5 +1,5 @@
1
1
  {
2
- "_version": "0.3.32",
2
+ "_version": "0.3.33",
3
3
  "adapters/claude/hooks/doc-format-guard.mjs": "02fb1ed6",
4
4
  "adapters/claude/hooks/doc-format-guard.ts": "2abf8013",
5
5
  "adapters/claude/hooks/lib/claude-env.ts": "170b40ca",
@@ -248,6 +248,7 @@
248
248
  "core/scripts/mcp-server/shared/anchor.ts": "ab15ff22",
249
249
  "core/scripts/mcp-server/shared/db-types.ts": "bd97e8b6",
250
250
  "core/scripts/mcp-server/shared/dps-scoring.strategy.ts": "92ecf32b",
251
+ "core/scripts/mcp-server/shared/dps-spec-ref.ts": "c2257e3a",
251
252
  "core/scripts/mcp-server/shared/env.ts": "f79ab09c",
252
253
  "core/scripts/mcp-server/shared/fs.ts": "be216ce3",
253
254
  "core/scripts/mcp-server/shared/hitl-interaction.strategy.ts": "dcfe946f",
@@ -283,9 +284,9 @@
283
284
  "core/scripts/mcp-server/tools/gateway/check_add_route_completeness.ts": "b58e76ee",
284
285
  "core/scripts/mcp-server/tools/gateway/check_add_route_status.ts": "4caf552c",
285
286
  "core/scripts/mcp-server/tools/gateway/check_doc_similarity.ts": "2cba51c5",
286
- "core/scripts/mcp-server/tools/gateway/check_dps.ts": "92020f8e",
287
+ "core/scripts/mcp-server/tools/gateway/check_dps.ts": "eb0fd12d",
287
288
  "core/scripts/mcp-server/tools/gateway/check_rahs.ts": "7091a262",
288
- "core/scripts/mcp-server/tools/gateway/check_spec_sync.ts": "560a88ad",
289
+ "core/scripts/mcp-server/tools/gateway/check_spec_sync.ts": "75c0d1e3",
289
290
  "core/scripts/mcp-server/tools/gateway/helpers.ts": "f8794a92",
290
291
  "core/scripts/mcp-server/tools/gateway/index.ts": "cffe9783",
291
292
  "core/scripts/mcp-server/tools/gateway.backup": "65eae393",
@@ -0,0 +1,17 @@
1
+ /**
2
+ * DPS spec 引用解析:从 Plan 头提取 Spec 路径(五端 magic 目录白名单)。
3
+ * 供 check_dps 与单测共用;纯函数,无 IO / 无 env 依赖。
4
+ */
5
+ const SPEC_REF_RE =
6
+ /Spec[:|\s`]+\.?(qoder|claude|add|vscode|codex|trae)\/specs\/([^/`\s]+)/;
7
+
8
+ export interface SpecRef {
9
+ magicDir: string;
10
+ specDir: string;
11
+ }
12
+
13
+ export function extractSpecRef(planContent: string): SpecRef | null {
14
+ const m = planContent.match(SPEC_REF_RE);
15
+ if (!m) return null;
16
+ return { magicDir: m[1], specDir: m[2] };
17
+ }
@@ -29,6 +29,7 @@ import {
29
29
  getEmbeddings,
30
30
  } from "./helpers.js";
31
31
  import { getRuntimeContext } from "../../shared/env.js";
32
+ import { extractSpecRef } from "../../shared/dps-spec-ref.js";
32
33
 
33
34
  export function registerCheckDps(server: ToolRegistrar) {
34
35
  const runtimeContext = getRuntimeContext();
@@ -79,10 +80,8 @@ export function registerCheckDps(server: ToolRegistrar) {
79
80
  let sn = basename(pm).replace(/-plan-v\d+\.md$/, ""),
80
81
  sc = "";
81
82
  if (pc) {
82
- const sr = pc.match(
83
- /Spec[:|\s`]+\.?(qoder|claude|add|vscode)\/specs\/([^/`\s]+)/,
84
- );
85
- if (sr) sn = sr[2];
83
+ const specRef = extractSpecRef(pc);
84
+ if (specRef) sn = specRef.specDir;
86
85
  }
87
86
  const sp = join(specsDir, sn, "spec.md");
88
87
  sc = (await readFileSafe(sp)) || "";
@@ -76,8 +76,8 @@ export function registerCheckSpecSync(server: ToolRegistrar) {
76
76
  } else {
77
77
  lines.push(`add-route: ${arFile}`);
78
78
  const arContent = (await readFileSafe(join(plansDir, arFile))) || "";
79
- // 提取 add-route 附录文件清单
80
- const appendixFiles = (arContent.match(/`[^`]+\.(ts|js|sh|md|tsx|json|yml|yaml)`/g) || [])
79
+ // 提取 add-route 附录文件清单(toml 纳入:sync-magic-rules.toml 等控制面文件,2026-08-18 修复)
80
+ const appendixFiles = (arContent.match(/`[^`]+\.(ts|js|sh|md|tsx|json|yml|yaml|toml)`/g) || [])
81
81
  .map((f: string) => f.replace(/`/g, ""));
82
82
  lines.push(`附录文件: ${appendixFiles.length} 个`);
83
83