@hupan56/wlkj 2.3.1 → 2.3.3

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": "@hupan56/wlkj",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "AI Product R&D Workflow - PRD/Prototype/Search/Task/Report",
5
5
  "bin": {
6
6
  "wlkj": "bin/cli.js"
@@ -140,6 +140,7 @@ def validate_req_ids(prd_paths: List[str], repo_root: Union[str, Path]) -> None:
140
140
  seen = {}
141
141
  errors = []
142
142
  # 全库已有 REQ-ID (用于跨人撞号检测)
143
+ # existing: {(year,n): [filepath, ...]}
143
144
  existing = scan_existing_req_ids(repo_root)
144
145
 
145
146
  for p in prd_paths:
@@ -158,13 +159,17 @@ def validate_req_ids(prd_paths: List[str], repo_root: Union[str, Path]) -> None:
158
159
  )
159
160
  else:
160
161
  seen[key] = p
161
- # 跨人/全库撞号检测: 该号已存在于仓库, 且不是同一个文件 (允许修改自己的)
162
- if key in existing and os.path.basename(existing[key]) != basename:
163
- errors.append(
164
- "撞号: %s 与仓库已有的 %s 都是 REQ-%d-%03d "
165
- "(两人离线各建了同号 PRD? 请改其中一个的编号)"
166
- % (basename, os.path.basename(existing[key]), year, n)
167
- )
162
+ # 跨人/全库撞号检测: 该号已存在于仓库的其他文件
163
+ # existing[key] 是列表; 只要里面有"文件名跟当前不同的"就算撞号
164
+ if key in existing:
165
+ for other_path in existing[key]:
166
+ if os.path.basename(other_path) != basename:
167
+ errors.append(
168
+ "撞号: %s 与仓库已有的 %s 都是 REQ-%d-%03d "
169
+ "(两人离线各建了同号 PRD? 请改其中一个的编号)"
170
+ % (basename, os.path.basename(other_path), year, n)
171
+ )
172
+ break # 一个冲突够了
168
173
  # 超界检测 (NNN 不能超过计数器, 防止跳号)
169
174
  max_n = current_counter(str(year), repo_root)
170
175
  if max_n > 0 and n > max_n:
@@ -253,7 +258,7 @@ def scan_existing_req_ids(repo_root: Optional[Union[str, Path]] = None) -> dict:
253
258
  if d.is_dir():
254
259
  scan_dirs.append(d)
255
260
 
256
- existing = {}
261
+ existing = {} # (year, n) -> [filepath, ...] (一个号可能被多个文件用)
257
262
  for d in scan_dirs:
258
263
  if not d.is_dir():
259
264
  continue
@@ -263,7 +268,7 @@ def scan_existing_req_ids(repo_root: Optional[Union[str, Path]] = None) -> dict:
263
268
  continue
264
269
  parsed = parse_req_id(f.name)
265
270
  if parsed:
266
- existing[parsed] = str(f)
271
+ existing.setdefault(parsed, []).append(str(f))
267
272
  except OSError:
268
273
  continue
269
274
  return existing
@@ -80,6 +80,26 @@ python .qoder/scripts/team_sync.py push
80
80
  ```
81
81
  让团队/上级看到。
82
82
 
83
+ ## 推送通知(可选,二选一)
84
+
85
+ 生成报告后,如果用户要求"发到飞书/钉钉/群里",按环境选:
86
+
87
+ ### 方式 A: QoderWork 连接器(QoderWork 桌面端,交互式)
88
+ 如果你在 **QoderWork** 里运行(有连接器):
89
+ 1. 检查用户是否装了飞书/钉钉连接器(Settings → Connectors & MCP)
90
+ 2. 用连接器把报告发到指定群/个人
91
+ 3. 这是最自然的方式(富文本卡片、@提及、审批流转都支持)
92
+ > 提示用户: "要我发到飞书吗?先在 QoderWork Settings → Connectors 装飞书连接器"
93
+
94
+ ### 方式 B: webhook(任何环境,脚本化)
95
+ 如果没有连接器,用引擎自带的 webhook 推送:
96
+ ```bash
97
+ python .qoder/scripts/report.py daily --push-feishu
98
+ python .qoder/scripts/report.py weekly --push-feishu
99
+ ```
100
+ 这会通过 config.yaml 里配的飞书 bot webhook 发卡片通知。
101
+ 两种方式不冲突,连接器更富交互,webhook 更可靠无依赖。
102
+
83
103
  ## 输出规则
84
104
 
85
105
  - 报告是中文,简洁(日报 ≤20 行,周报 ≤40 行)