@hupan56/wlkj 2.4.1 → 2.4.2

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.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "AI Product R&D Workflow - PRD/Prototype/Search/Task/Report",
5
5
  "bin": {
6
6
  "wlkj": "bin/cli.js"
@@ -59,6 +59,12 @@ the chosen platform, the user requirement, and the current developer name.
59
59
  For simple requirements you may run the mode workflow inline instead of
60
60
  dispatching — the steps are the same.
61
61
 
62
+ ### 模式不确定时的兜底(必须遵守)
63
+ - 若用户意图跟 ≥2 个模式都沾边(如既像"分析"又像"规划")→ **先问用户**:
64
+ "这个需求我理解为 [X 模式],对吗?还是你想要 [Y/Z]?"
65
+ - 默认走 Reference 仅当用户明确给出需求描述且无探讨/创新/规划信号时。
66
+ - **宁可多问一句,不要错模式**(错模式的 PRD 是废纸,EVA 门禁只管格式不管方向)。
67
+
62
68
  ## Storage
63
69
 
64
70
  Draft -> workspace/members/{developer}/drafts/REQ-{ID}-{desc}.md
@@ -112,6 +112,18 @@ if __name__ == '__main__':
112
112
  try:
113
113
  main()
114
114
  except Exception as e:
115
+ # 落盘到日志 (stdout 一次性, 追溯用)
116
+ try:
117
+ from pathlib import Path
118
+ from datetime import datetime
119
+ log_path = Path(__file__).resolve().parents[1] / '.runtime' / 'hook-errors.log'
120
+ log_path.parent.mkdir(parents=True, exist_ok=True)
121
+ with open(log_path, 'a', encoding='utf-8') as f:
122
+ f.write('[{}] inject-workflow-state: {}\n'.format(
123
+ datetime.now().strftime('%Y-%m-%d %H:%M:%S'), str(e)[:200]))
124
+ except Exception:
125
+ pass
115
126
  print('<qoder-workflow>')
116
127
  print('hook error: ' + str(e)[:200])
128
+ print(' (详情见 .qoder/.runtime/hook-errors.log)')
117
129
  print('</qoder-workflow>')
@@ -199,6 +199,18 @@ if __name__ == '__main__':
199
199
  main()
200
200
  except Exception as e:
201
201
  # A broken hook must never kill the session - emit minimal context
202
+ # 同时落盘到日志, 方便后续排查 (stdout 一次性, AI 看完就没了)
203
+ try:
204
+ from pathlib import Path
205
+ log_path = Path(__file__).resolve().parents[1] / '.runtime' / 'hook-errors.log'
206
+ log_path.parent.mkdir(parents=True, exist_ok=True)
207
+ from datetime import datetime
208
+ with open(log_path, 'a', encoding='utf-8') as f:
209
+ f.write('[{}] session-start: {}\n'.format(
210
+ datetime.now().strftime('%Y-%m-%d %H:%M:%S'), str(e)[:200]))
211
+ except Exception:
212
+ pass # 日志写失败不影响降级
202
213
  print('<qoder-context>')
203
214
  print('session-start hook error: ' + str(e)[:200])
215
+ print(' (详情见 .qoder/.runtime/hook-errors.log)')
204
216
  print('</qoder-context>')
@@ -215,7 +215,7 @@ def scan_secrets(file_paths: List[str], repo_root: str) -> None:
215
215
  # 合法平台关键词 (出现在 PRD 内容里即视为已标注)
216
216
  _PLATFORM_KEYWORDS = [
217
217
  'web', 'pc', '管理端', 'fywl-ui', 'fywl_ui', 'vben', 'ant design',
218
- 'app', 'h5', '移动端', 'carmg', 'vant',
218
+ 'app', 'app移动端', 'h5', '移动端', 'carmg', 'vant', 'mobile',
219
219
  '两端', '双端', 'both',
220
220
  '后端', 'backend', '无前端',
221
221
  ]
@@ -293,6 +293,7 @@ def do_push(message=None, skip_eval=False, skip_secret=False):
293
293
  dev = get_developer()
294
294
 
295
295
  # === 文件锁: 串行化 push, 避免并发 stage/commit 交叉 ===
296
+ print('[team_sync] 推送产出(PRD/任务/索引), 不含源码. 源码改动用 /wl-commit')
296
297
  os.makedirs(os.path.dirname(PUSH_LOCK), exist_ok=True)
297
298
  try:
298
299
  lock_ctx = FileLock(PUSH_LOCK, timeout=60, stale_seconds=300)