@joekytc/dsh-swarm 0.3.8 → 0.3.10

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.
Files changed (39) hide show
  1. package/lib/config.d.ts +1 -1
  2. package/lib/dispatcher/agent-runner.js +37 -2
  3. package/lib/dispatcher/dispatcher.d.ts +8 -0
  4. package/lib/dispatcher/dispatcher.js +21 -0
  5. package/lib/dispatcher/merge-gate.d.ts +1 -0
  6. package/lib/dispatcher/merge-gate.js +28 -1
  7. package/lib/dispatcher/session-events.d.ts +9 -1
  8. package/lib/dispatcher/session-events.js +14 -2
  9. package/lib/dispatcher/v-orchestrator.js +13 -6
  10. package/lib/domain/delivery-contract.d.ts +2 -1
  11. package/lib/domain/delivery-contract.js +16 -3
  12. package/lib/domain/ocr-review.d.ts +5 -1
  13. package/lib/domain/ocr-review.js +10 -2
  14. package/lib/domain/planning-checklist.d.ts +33 -0
  15. package/lib/domain/planning-checklist.js +197 -0
  16. package/lib/domain/prefetch-manifest.js +15 -4
  17. package/lib/roles/preset-installer.d.ts +14 -0
  18. package/lib/roles/preset-installer.js +17 -0
  19. package/lib/roles/toolsets.d.ts +1 -1
  20. package/lib/roles/toolsets.js +7 -5
  21. package/lib/routes/planning-driver.d.ts +2 -1
  22. package/lib/routes/planning-driver.js +13 -10
  23. package/lib/services/ocr-cli.d.ts +5 -0
  24. package/lib/services/ocr-cli.js +10 -1
  25. package/lib/tools/kanban-tools.js +10 -2
  26. package/lib/tools/main-session-tools.d.ts +2 -1
  27. package/lib/tools/main-session-tools.js +101 -20
  28. package/lib/tools/ocr-review-tools.d.ts +3 -1
  29. package/lib/tools/ocr-review-tools.js +23 -5
  30. package/lib/tools/planning-tools.d.ts +3 -0
  31. package/lib/tools/planning-tools.js +248 -3
  32. package/lib/tools/spec-card-tools.js +8 -2
  33. package/lib/tools/wiki-tools.js +1 -1
  34. package/lib/wiki/page-path.d.ts +2 -1
  35. package/lib/wiki/page-path.js +6 -4
  36. package/package.json +2 -2
  37. package/personas/kanban-dt/agent.cordis.yml +4 -1
  38. package/personas/persona-dt.md +2 -1
  39. package/skills/grill-me/SKILL.md +7 -0
@@ -1,5 +1,5 @@
1
1
  /** 命名空间提示(报错/工具 description 文案单一来源,禁止散落硬编码)。 */
2
- export declare const KB_PAGE_NAMESPACES_HINT = "projects/<repoSlug>/checklists/\u3001projects/<repoSlug>/learnings/\u3001projects/<repoSlug>/ch_*/learnings/\u3001projects/<repoSlug>/ch_*/t_*.md\u3001projects/<repoSlug>/ch_*/review/\u3001projects/<repoSlug>/reviews/<topic>-<ymd>/";
2
+ export declare const KB_PAGE_NAMESPACES_HINT = "projects/<repoSlug>/checklists/\u3001projects/<repoSlug>/source-docs/\u3001projects/<repoSlug>/learnings/\u3001projects/<repoSlug>/ch_*/learnings/\u3001projects/<repoSlug>/ch_*/t_*.md\u3001projects/<repoSlug>/ch_*/review/\u3001projects/<repoSlug>/reviews/<topic>-<ymd>/";
3
3
  /** 从需求名(回退 problem)派生 URL 安全 slug:ASCII 化、空格/特殊字符→-、限长 40;全非 ASCII(如中文)兜底 'req'。 */
4
4
  export declare function buildChecklistSlug(name: string): string;
5
5
  export declare function isAllowedWikiPagePath(pagePath: string): boolean;
@@ -8,6 +8,7 @@ export declare function isLearningsPath(pagePath: string): boolean;
8
8
  /** 工具边界硬校验:不符白名单直接抛 kb-rejected(wiki_write 用)。 */
9
9
  export declare function assertAllowedWikiPagePath(pagePath: string): void;
10
10
  export declare const LOCAL_CHECKLIST_PREFIX = "wiki/queries/checklists/";
11
+ export declare const LOCAL_SOURCE_DOCS_PREFIX = "wiki/queries/source-docs/";
11
12
  export declare const LOCAL_LEARNING_BASE = "wiki/synthesis/learnings/";
12
13
  /** 本地模式交付白名单:KB 库根下 wiki/** 相对路径(拒绝对象路径、.. 穿越、空串)。 */
13
14
  export declare function isLocalKbPagePath(pagePath: string): boolean;
@@ -2,6 +2,7 @@
2
2
  // KB 页面路径统一规则(单一来源):一级段 = repoSlug(buildRepoSlug(workspaceDir) 派生),
3
3
  // 知识库内按目标仓库分组定位。旧全局命名空间(projects/checklists|learnings|ch_* 直挂根)已断代,不兼容。
4
4
  // 需求清单 projects/<repoSlug>/checklists/<slug>-<ts>.md (planning_checklist_save,代码强制)
5
+ // PRD 原文切片 projects/<repoSlug>/source-docs/<slug>-part-NN.md (planning_prd_collect,代码强制)
5
6
  // 实施计划/结果 projects/<repoSlug>/ch_<id>/t_<id>.md (W2/W3 wiki_write,工具边界强制)
6
7
  // DT 评审页 projects/<repoSlug>/ch_<id>/review/<name>.md (DT wiki_write + 写护栏强制)
7
8
  // 独立评审报告 projects/<repoSlug>/reviews/<topic>-<ymd>/ (独立 DT 模式 wiki_write,形态由 domain/ocr-review 判定)
@@ -9,9 +10,9 @@
9
10
  import { WikiError } from './wiki-vault-client.js';
10
11
  import { isStandaloneReviewNamespacePath } from '../domain/ocr-review.js';
11
12
  /** 命名空间提示(报错/工具 description 文案单一来源,禁止散落硬编码)。 */
12
- export const KB_PAGE_NAMESPACES_HINT = 'projects/<repoSlug>/checklists/、projects/<repoSlug>/learnings/、projects/<repoSlug>/ch_*/learnings/、projects/<repoSlug>/ch_*/t_*.md、projects/<repoSlug>/ch_*/review/、projects/<repoSlug>/reviews/<topic>-<ymd>/';
13
- /** 白名单:projects/<repoSlug>/ 下五类命名空间(repoSlug=[a-z0-9-]+,杜绝 LLM 自造路径)。 */
14
- const KB_PAGE_PATH_RE = /^projects\/[a-z0-9-]+\/(?:checklists\/|learnings\/|ch_[0-9a-z_]+\/(?:t_[0-9a-z_]+\.md|review\/|learnings\/))/;
13
+ export const KB_PAGE_NAMESPACES_HINT = 'projects/<repoSlug>/checklists/、projects/<repoSlug>/source-docs/、projects/<repoSlug>/learnings/、projects/<repoSlug>/ch_*/learnings/、projects/<repoSlug>/ch_*/t_*.md、projects/<repoSlug>/ch_*/review/、projects/<repoSlug>/reviews/<topic>-<ymd>/';
14
+ /** 白名单:projects/<repoSlug>/ 下六类命名空间(repoSlug=[a-z0-9-]+,杜绝 LLM 自造路径)。 */
15
+ const KB_PAGE_PATH_RE = /^projects\/[a-z0-9-]+\/(?:checklists\/|learnings\/|source-docs\/|ch_[0-9a-z_]+\/(?:t_[0-9a-z_]+\.md|review\/|learnings\/))/;
15
16
  /** 从需求名(回退 problem)派生 URL 安全 slug:ASCII 化、空格/特殊字符→-、限长 40;全非 ASCII(如中文)兜底 'req'。 */
16
17
  export function buildChecklistSlug(name) {
17
18
  const slug = name
@@ -33,11 +34,12 @@ export function isLearningsPath(pagePath) {
33
34
  /** 工具边界硬校验:不符白名单直接抛 kb-rejected(wiki_write 用)。 */
34
35
  export function assertAllowedWikiPagePath(pagePath) {
35
36
  if (!isAllowedWikiPagePath(pagePath)) {
36
- throw new WikiError('kb-rejected', undefined, `page path outside allowed namespaces (${KB_PAGE_NAMESPACES_HINT}): ${pagePath}`);
37
+ throw new WikiError('kb-rejected', undefined, `kb-rejected: page path outside allowed namespaces (${KB_PAGE_NAMESPACES_HINT}): ${pagePath}`);
37
38
  }
38
39
  }
39
40
  // ── 本地 KB(llm-wiki)路径规则(双模式)──────────────────────────────
40
41
  export const LOCAL_CHECKLIST_PREFIX = 'wiki/queries/checklists/';
42
+ export const LOCAL_SOURCE_DOCS_PREFIX = 'wiki/queries/source-docs/';
41
43
  export const LOCAL_LEARNING_BASE = 'wiki/synthesis/learnings/';
42
44
  /** 本地模式交付白名单:KB 库根下 wiki/** 相对路径(拒绝对象路径、.. 穿越、空串)。 */
43
45
  export function isLocalKbPagePath(pagePath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joekytc/dsh-swarm",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "A governed swarm of six specialist DSH agents (orchestrator, planner, knowledge-base bridge, developer and two reviewers) that turns a requirement into a strict phase pipeline with machine-verified delivery evidence, review-gated merges, a full audit-log event stream and a live kanban tab; design inspired by the Hermes Agent kanban",
5
5
  "license": "MIT",
6
6
  "author": "joekytc",
@@ -90,4 +90,4 @@
90
90
  "typescript": "^5.8.0",
91
91
  "vitest": "^3.0.0"
92
92
  }
93
- }
93
+ }
@@ -36,7 +36,10 @@
36
36
  feature branch from the parent handoff metadata.branch; you may pass background with a
37
37
  one-line business context distilled from the spec card / task description); silently
38
38
  fall back to the delegate flow when status is not completed or the tool returns
39
- managed-not-configured guidance. When ocr is not installed the tool returns install guidance (installable
39
+ managed-not-configured guidance. ocr_review targets the session working directory ({{cwd}}) when you
40
+ omit repo — pass repo=<absolute path> explicitly whenever the review target is not that directory
41
+ (e.g. D's worktree from the parent handoff metadata.worktree_dir, or another repo / temp clone).
42
+ When ocr is not installed the tool returns install guidance (installable
40
43
  from the GUI config panel); in chain scenarios kanban_block('review-tool-unavailable')
41
44
  and note the GUI install option in the reason. Standalone review mode (no bound chain
42
45
  task): review user-specified local dirs, branch ranges (--from/--to), single commits,
@@ -18,7 +18,8 @@
18
18
 
19
19
  ## open-code-review(ocr)评审引擎(双模)
20
20
  - 评审引擎由配置面板 reviewEngine.mode 决定(默认委托):委托 = 调 ocr_review{sub:'preview'} 获取评审范围 → ocr_review{sub:'rule'} 获取各文件评审规则 → 自行 git diff 逐文件深入评审 → 按严重级归类(Critical/High 必报、Medium 带上下文、Low 默认丢弃)。
21
- - 托管 = 调 ocr_review{sub:'managed', from:<TARGET_BRANCH>, to:<branch>}(branch 取 D 交接 metadata.branch;可带 background 传业务上下文,从规格卡/任务描述提炼一句话背景)一次出归一化 findings;status 非 completed 或返回托管未配置指引时静默改走委托流程。
21
+ - 托管 = 调 ocr_review{sub:'managed', from:<TARGET_BRANCH>, to:<branch>}(branch 取 D 交接 metadata.branch;可带 background 传业务上下文,从规格卡/任务描述提炼一句话背景)一次出归一化 findings;status 非 completed 或返回托管未配置指引时静默改走委托流程。托管返回「未配置 LLM」指引但配置面板已选好提供方/模型时,提示用户点「应用到 ocr」。
22
+ - repo 参数(三子命令通用):省略 = 当前会话工作目录(链上 DT 会话即链工作区);评审目标不在该目录内(D 的 worktree / 其他仓库 / 临时 clone)时必须显式传 repo=<目标仓库绝对路径>(D 工作区取父交接 metadata.worktree_dir 或规格卡 file-prefetch 附件 ref)。
22
23
  - ocr 未安装时工具自动返回中文安装指引(可在 GUI 配置面板安装);链上场景按规则 kanban_block('review-tool-unavailable') 并在 reason 注明 GUI 可安装。
23
24
 
24
25
  ## 独立评审模式
@@ -42,6 +42,13 @@ Each round the user answers reshapes the tree: settled decisions push the fronti
42
42
 
43
43
  Finding _facts_ is your job, never the user's. When a frontier question needs a fact from the environment (filesystem, tools, etc.), dispatch a sub-agent to find it; don't ask the user for anything you could look up yourself. Don't block on it: a running exploration is an unsettled prerequisite, so only the questions downstream of it wait for the sub-agent to report; ask the rest of the frontier now. The _decisions_ are the user's: put each to them and wait.
44
44
 
45
+ ## Clarification record standard (hard rule)
46
+
47
+ - Every recorded Q&A must carry its full decision body: field names, API paths, enum values, component names, placement rules. Never record shorthand like "按推荐" / "同上" / "see above" — a fresh context must be able to work from the record alone.
48
+ - Requirement sources (TAPD/Jira links) are recorded up front; if none exists, record "no source + reason" explicitly.
49
+ - When the user provides PRD/requirement-doc links, collect them before grilling; if collection is blocked, stop and surface the categorized fix (login / missing skill / dead link) — never guess content, never skip.
50
+ - Every decision is traceable to at least one of: clarification Q&A number, repo source path, or a location in the requirement/API doc. Where a confirmed decision contradicts the original doc value, mark it 【已调整】/【已确认】; never record unconfirmed values without an explicit 「待确认」 mark. With no source record, a decision reads as agent-defaulted.
51
+
45
52
  ## Closing deliverable
46
53
 
47
54
  The session is done when the frontier is empty: every branch of the design tree visited, nothing left silently assumed, and the user confirms you have reached a shared understanding. Do not act on the plan until the user confirms. Once they confirm, produce the closing deliverable: