@aipper/aiws-spec 0.0.28 → 0.0.30

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 (138) hide show
  1. package/docs/cli-interface.md +10 -12
  2. package/docs/opencode-autonomous-swarm.md +178 -0
  3. package/docs/opencode-omo-adapter.md +123 -4
  4. package/docs/opencode-omo-validation-checklist.md +47 -0
  5. package/docs/opencode-subagent-first.md +187 -0
  6. package/docs/workflow-delegation-context-injection.md +217 -0
  7. package/docs/workflow-delegation-contracts.json +108 -2
  8. package/docs/workflow-delegation-contracts.md +13 -0
  9. package/docs/workflow-delegation-contracts.schema.json +152 -0
  10. package/docs/workflow-governance-rules.json +47 -6
  11. package/docs/workflow-governance-rules.md +8 -7
  12. package/docs/workflow-governance-rules.schema.json +39 -1
  13. package/docs/workflow-review-gates.json +6 -0
  14. package/docs/workflow-review-gates.md +14 -5
  15. package/docs/workflow-review-gates.schema.json +4 -0
  16. package/docs/workflow-router-rules.json +72 -8
  17. package/docs/workflow-router-rules.md +21 -14
  18. package/docs/workflow-router-rules.schema.json +4 -0
  19. package/docs/workflow-stage-contracts.json +24 -5
  20. package/docs/workflow-stage-contracts.md +16 -15
  21. package/docs/workflow-stage-contracts.schema.json +12 -1
  22. package/package.json +1 -1
  23. package/templates/workspace/.agents/skills/using-aiws/SKILL.md +16 -10
  24. package/templates/workspace/.agents/skills/ws-commit/SKILL.md +6 -118
  25. package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +6 -218
  26. package/templates/workspace/.agents/skills/ws-dev/SKILL.md +82 -141
  27. package/templates/workspace/.agents/skills/ws-finish/SKILL.md +9 -204
  28. package/templates/workspace/.agents/skills/ws-handoff/SKILL.md +10 -44
  29. package/templates/workspace/.agents/skills/ws-migrate/SKILL.md +6 -42
  30. package/templates/workspace/.agents/skills/ws-plan-verify/SKILL.md +6 -58
  31. package/templates/workspace/.agents/skills/ws-pull/SKILL.md +8 -109
  32. package/templates/workspace/.agents/skills/ws-push/SKILL.md +8 -100
  33. package/templates/workspace/.agents/skills/ws-review/SKILL.md +6 -1
  34. package/templates/workspace/.agents/skills/ws-submodule-setup/SKILL.md +10 -57
  35. package/templates/workspace/.agents/skills/ws-verify-before-complete/SKILL.md +12 -53
  36. package/templates/workspace/{changes → .aiws/changes}/README.md +20 -23
  37. package/templates/workspace/{changes → .aiws/changes}/templates/proposal.md +12 -12
  38. package/templates/workspace/{changes → .aiws/changes}/templates/tasks.md +8 -8
  39. package/templates/workspace/{issues → .aiws/issues}/problem-issues.csv +1 -1
  40. package/templates/workspace/.aiws/journal/.gitkeep +1 -0
  41. package/templates/workspace/{requirements → .aiws/requirements}/requirements-issues.csv +1 -1
  42. package/templates/workspace/.aiws/tmp/.gitkeep +0 -0
  43. package/templates/workspace/{tools → .aiws/tools}/requirements_contract.py +2 -2
  44. package/templates/workspace/{tools → .aiws/tools}/requirements_contract_sync.py +2 -2
  45. package/templates/workspace/{tools → .aiws/tools}/requirements_flow_gen.py +1 -1
  46. package/templates/workspace/{tools → .aiws/tools}/server_test_runner.py +10 -10
  47. package/templates/workspace/{tools → .aiws/tools}/ws_change_check.py +23 -23
  48. package/templates/workspace/{tools → .aiws/tools}/ws_resolve_sub_target.sh +2 -2
  49. package/templates/workspace/{tools → .aiws/tools}/ws_tasks_plan.py +3 -3
  50. package/templates/workspace/.claude/commands/ws-review.md +5 -1
  51. package/templates/workspace/.claude/settings.json.example +26 -0
  52. package/templates/workspace/.claude/skills/ws-commit/SKILL.md +6 -118
  53. package/templates/workspace/.claude/skills/ws-deliver/SKILL.md +6 -218
  54. package/templates/workspace/.claude/skills/ws-dev/SKILL.md +52 -141
  55. package/templates/workspace/.claude/skills/ws-finish/SKILL.md +9 -204
  56. package/templates/workspace/.claude/skills/ws-handoff/SKILL.md +10 -44
  57. package/templates/workspace/.claude/skills/ws-migrate/SKILL.md +6 -42
  58. package/templates/workspace/.claude/skills/ws-plan-verify/SKILL.md +6 -49
  59. package/templates/workspace/.claude/skills/ws-pull/SKILL.md +8 -109
  60. package/templates/workspace/.claude/skills/ws-push/SKILL.md +8 -100
  61. package/templates/workspace/.claude/skills/ws-review/SKILL.md +6 -1
  62. package/templates/workspace/.claude/skills/ws-submodule-setup/SKILL.md +10 -57
  63. package/templates/workspace/.claude/skills/ws-verify-before-complete/SKILL.md +12 -53
  64. package/templates/workspace/.githooks/pre-commit +13 -0
  65. package/templates/workspace/.githooks/pre-push +7 -0
  66. package/templates/workspace/.opencode/command/ws-auto.md +33 -0
  67. package/templates/workspace/.opencode/command/ws-autonomy.md +25 -0
  68. package/templates/workspace/.opencode/command/ws-review.md +5 -1
  69. package/templates/workspace/.opencode/commands/ws-auto.md +33 -0
  70. package/templates/workspace/.opencode/commands/ws-autonomy.md +25 -0
  71. package/templates/workspace/.opencode/commands/ws-commit.md +4 -56
  72. package/templates/workspace/.opencode/commands/ws-deliver.md +10 -50
  73. package/templates/workspace/.opencode/commands/ws-finish.md +11 -3
  74. package/templates/workspace/.opencode/commands/ws-handoff.md +9 -17
  75. package/templates/workspace/.opencode/commands/ws-migrate.md +10 -17
  76. package/templates/workspace/.opencode/commands/ws-plan-verify.md +5 -15
  77. package/templates/workspace/.opencode/commands/ws-pull.md +6 -75
  78. package/templates/workspace/.opencode/commands/ws-push.md +7 -82
  79. package/templates/workspace/.opencode/commands/ws-review.md +5 -1
  80. package/templates/workspace/.opencode/commands/ws-submodule-setup.md +8 -47
  81. package/templates/workspace/.opencode/commands/ws-verify-before-complete.md +10 -19
  82. package/templates/workspace/.opencode/helpers/approval-whitelist-check.sh +148 -0
  83. package/templates/workspace/.opencode/helpers/approval-whitelist-run.sh +82 -0
  84. package/templates/workspace/.opencode/helpers/approval-whitelist-watchdog.sh +144 -0
  85. package/templates/workspace/.opencode/helpers/tmux-swarm-rescue.sh +56 -0
  86. package/templates/workspace/.opencode/helpers/tmux-swarm-scan.sh +46 -0
  87. package/templates/workspace/.opencode/lib/aiws-context.js +953 -0
  88. package/templates/workspace/.opencode/oh-my-opencode.json.example +64 -4
  89. package/templates/workspace/.opencode/plugins/aiws-inject-context.js +201 -0
  90. package/templates/workspace/.opencode/plugins/aiws-session-start.js +86 -0
  91. package/templates/workspace/.opencode/plugins/aiws-workflow-state.js +116 -0
  92. package/templates/workspace/.opencode/scripts/ws-plan-gen-submodule-targets.sh +27 -0
  93. package/templates/workspace/.opencode/scripts/ws-plan-setup-worktree.sh +31 -0
  94. package/templates/workspace/.opencode/skills/using-aiws/SKILL.md +130 -77
  95. package/templates/workspace/.opencode/skills/ws-analyze/SKILL.md +1 -1
  96. package/templates/workspace/.opencode/skills/ws-auto/SKILL.md +46 -0
  97. package/templates/workspace/.opencode/skills/ws-autonomy/SKILL.md +62 -0
  98. package/templates/workspace/.opencode/skills/ws-bugfix/SKILL.md +1 -1
  99. package/templates/workspace/.opencode/skills/ws-commit/SKILL.md +6 -118
  100. package/templates/workspace/.opencode/skills/ws-delegate/SKILL.md +115 -40
  101. package/templates/workspace/.opencode/skills/ws-deliver/SKILL.md +6 -218
  102. package/templates/workspace/.opencode/skills/ws-dev/SKILL.md +105 -146
  103. package/templates/workspace/.opencode/skills/ws-dev-lite/SKILL.md +23 -7
  104. package/templates/workspace/.opencode/skills/ws-finish/SKILL.md +9 -204
  105. package/templates/workspace/.opencode/skills/ws-frontend-design/SKILL.md +1 -1
  106. package/templates/workspace/.opencode/skills/ws-handoff/SKILL.md +10 -44
  107. package/templates/workspace/.opencode/skills/ws-intake/SKILL.md +43 -4
  108. package/templates/workspace/.opencode/skills/ws-migrate/SKILL.md +6 -42
  109. package/templates/workspace/.opencode/skills/ws-plan/SKILL.md +15 -55
  110. package/templates/workspace/.opencode/skills/ws-plan-verify/SKILL.md +6 -49
  111. package/templates/workspace/.opencode/skills/ws-preflight/SKILL.md +1 -1
  112. package/templates/workspace/.opencode/skills/ws-pull/SKILL.md +8 -109
  113. package/templates/workspace/.opencode/skills/ws-push/SKILL.md +8 -100
  114. package/templates/workspace/.opencode/skills/ws-quality-review/SKILL.md +7 -2
  115. package/templates/workspace/.opencode/skills/ws-req-change/SKILL.md +1 -1
  116. package/templates/workspace/.opencode/skills/ws-req-contract-sync/SKILL.md +1 -1
  117. package/templates/workspace/.opencode/skills/ws-req-contract-validate/SKILL.md +1 -1
  118. package/templates/workspace/.opencode/skills/ws-req-flow-sync/SKILL.md +1 -1
  119. package/templates/workspace/.opencode/skills/ws-req-review/SKILL.md +1 -1
  120. package/templates/workspace/.opencode/skills/ws-review/SKILL.md +35 -4
  121. package/templates/workspace/.opencode/skills/ws-rule/SKILL.md +1 -1
  122. package/templates/workspace/.opencode/skills/ws-spec-review/SKILL.md +1 -1
  123. package/templates/workspace/.opencode/skills/ws-submodule-setup/SKILL.md +10 -57
  124. package/templates/workspace/.opencode/skills/ws-verify-before-complete/SKILL.md +45 -55
  125. package/templates/workspace/AGENTS.md +32 -84
  126. package/templates/workspace/AI_PROJECT.md +5 -5
  127. package/templates/workspace/AI_WORKSPACE.md +1 -1
  128. package/templates/workspace/REQUIREMENTS.md +1 -1
  129. package/templates/workspace/gitignore +1 -1
  130. package/templates/workspace/manifest.json +215 -395
  131. /package/templates/workspace/{changes → .aiws/changes}/templates/design.md +0 -0
  132. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/README.md +0 -0
  133. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/architecture.md +0 -0
  134. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/implementation-plan.md +0 -0
  135. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/progress.md +0 -0
  136. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/tech-stack.md +0 -0
  137. /package/templates/workspace/{requirements → .aiws/requirements}/CHANGELOG.md +0 -0
  138. /package/templates/workspace/{secrets → .aiws/secrets}/test-accounts.example.json +0 -0
@@ -1,70 +1,18 @@
1
1
  ---
2
2
  name: ws-plan-verify
3
- description: 计划质检(执行前检查计划是否过长/跑偏,并给出最小修正清单)
3
+ description: `aiws plan-verify` 的薄包装入口
4
4
  ---
5
5
 
6
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
6
+ # ws-plan-verify
7
7
 
8
- 目标:
9
- - 在进入 `$ws-dev` 前,对 `plan/...` 与 `changes/<change-id>/proposal.md` 做一次“硬约束”质检
10
- - 避免计划过长、步骤不够具体、验证不可复现、与需求合同绑定不一致
11
- - 显式做一次多视角方案审查,避免计划“格式合格但方向跑偏”
12
- - 失败时只给最小修正项,修完后再进入实现
8
+ `aiws plan-verify` 的薄包装入口。
13
9
 
14
- 适用时机:
15
- - 已执行过 `$ws-plan`,且准备开始编码
16
- - 或用户反馈“计划太长/容易跑偏”,需要先压缩并对齐
17
-
18
- 阶段定位:
19
- - planning gate;负责在编码前检查计划是否满足 change 严格契约。
20
-
21
- 必需输入:
22
- - 当前 `plan/...`
23
- - `changes/<change-id>/proposal.md`
24
- - 当前 change 上下文
25
-
26
- 必需输出:
27
- - `Quality gate:` pass/fail
28
- - `Perspective findings:` 多视角审查结论
29
- - `Fix list:` 最小修正项
30
- - `Next:` 通过则 `$ws-dev`,未通过则继续修正并复跑
31
-
32
- 阻断条件:
33
- - 无法定位当前 change 或计划文件
34
- - `aiws change validate <change-id> --strict` 未通过
35
-
36
- 完成判定:
37
- - 计划满足严格门禁,且后续实现可以在不补需求/补绑定的情况下直接开始。
38
-
39
- 执行步骤(建议):
40
- 1) 先运行 `$ws-preflight`。
41
- 2) 识别 change 上下文:
42
- - 优先从当前分支推断 `change/<change-id>`
43
- - 若无法推断:读取 `changes/*/proposal.md` 中的 `Change_ID`,并让用户确认本次要质检的 change
44
- 3) 运行严格门禁(这是硬约束入口):
45
10
  ```bash
46
11
  if [[ -x "./node_modules/.bin/aiws" ]]; then
47
- ./node_modules/.bin/aiws change validate <change-id> --strict
12
+ ./node_modules/.bin/aiws plan-verify
48
13
  elif command -v aiws >/dev/null 2>&1; then
49
- aiws change validate <change-id> --strict
14
+ aiws plan-verify
50
15
  else
51
- npx @aipper/aiws change validate <change-id> --strict
16
+ npx @aipper/aiws plan-verify
52
17
  fi
53
18
  ```
54
- 4) 若失败:按报错逐条修正 `proposal.md` / `plan/...`,优先级如下:
55
- - 先修绑定:`Change_ID` / `Req_ID|Problem_ID` / `Contract_Row` / `Plan_File` / `Evidence_Path`
56
- - 再修计划质量:必需章节、步骤数量、步骤具体性、验证命令与预期
57
- 5) 在 strict 通过后,增加多视角方案审查(不要跳过):
58
- - 产品/范围:目标是否清楚、是否有 scope creep、是否把不该做的内容带进来
59
- - 工程实现:数据流、边界条件、失败模式、回滚、验证是否闭合
60
- - 体验 / DX(按需):若任务涉及 UI、CLI、API、文档或工具链,检查关键路径是否可用、成本是否可接受
61
- - 验收完整性:是否能凭当前 Verify 判断 done / not done
62
- 6) 若多视角审查发现阻断问题:`Quality gate: fail`,只输出最小修正项,不进入实现。
63
- 7) 复跑 strict 校验,直到通过。
64
- 8) 输出“可执行最小计划摘要”(3-8 步),再进入 `$ws-dev`。
65
-
66
- 输出要求:
67
- - `Quality gate:` pass/fail
68
- - `Perspective findings:` 按视角列出阻断点 / 警告 / 通过结论
69
- - `Fix list:` 仅保留必须修改项(按阻断级别排序)
70
- - `Next:` 通过后建议 `$ws-dev`;未通过则继续修正并复跑 strict
@@ -1,119 +1,18 @@
1
1
  ---
2
2
  name: ws-pull
3
- description: 拉取并对齐 submodules(避免 detached;减少人为差异)
3
+ description: `aiws pull` 的薄包装入口
4
4
  ---
5
5
 
6
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
6
+ # ws-pull
7
7
 
8
- 背景:
9
- - Git submodule 在别的电脑 `git submodule update` 后常见现象是子模块处于 detached HEAD(因为主仓库记录的是固定 gitlink commit)。
10
- - detached 本身不一定是错,但会增加“需要手动切分支/容易忘”的操作差异。
8
+ `aiws pull` 的薄包装入口。
11
9
 
12
- 目标:
13
- - 安全拉取 superproject(默认只允许 fast-forward)
14
- - 初始化/同步 submodules(`--init --recursive`)
15
- - 在**不改动 superproject gitlink commit** 的前提下,尽量把每个 submodule 从 detached HEAD “挂回”到一个**确定的目标分支**(仅当该分支包含 gitlink commit 时)
16
- - 若未配置 `.gitmodules` 的 `submodule.<name>.branch`:保持 detached,并提示先运行 `$ws-submodule-setup`
17
-
18
- 安全约束(强制):
19
- - 不执行破坏性命令(不 `reset --hard` 主仓库;不改动远端)
20
- - 不自动提交/不自动 push
21
- - 若工作区不干净:停止并要求用户先 commit 或 stash(不要自动处理)
22
-
23
- 执行步骤(建议):
24
- 0) 输出上下文:
25
10
  ```bash
26
- git rev-parse --show-toplevel
27
- git branch --show-current
28
- git status --porcelain
29
- ```
30
- 若 `git status --porcelain` 非空:停止,要求用户先清理工作区(commit 或 stash)。
31
-
32
- 1) 拉取 superproject(默认只允许 fast-forward,避免隐式 merge/rebase):
33
- ```bash
34
- git pull --ff-only
35
- ```
36
- 若失败(需要 merge/rebase):停止并向用户解释原因,让用户明确选择 `git pull --rebase` 或手动处理。
37
-
38
- 2) 同步并更新 submodules 到 superproject 记录的 gitlink commit:
39
- ```bash
40
- if [[ -f .gitmodules ]]; then
41
- git submodule sync --recursive
42
- git submodule update --init --recursive
11
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
12
+ ./node_modules/.bin/aiws pull
13
+ elif command -v aiws >/dev/null 2>&1; then
14
+ aiws pull
43
15
  else
44
- echo "[info] no .gitmodules"
16
+ npx @aipper/aiws pull
45
17
  fi
46
18
  ```
47
-
48
- 3) (可选但推荐)把 submodule 从 detached HEAD 尽量“挂回分支”,减少手工操作差异:
49
-
50
- 说明:
51
- - 该步骤不会改变 superproject 的 gitlink commit(也不会让主仓库出现“submodule modified”)。
52
- - 只在目标分支包含该 gitlink commit 时才执行“挂回”;否则保持 detached 并提示原因。
53
- - 为了避免 origin 分支较多时“猜错分支”,本步骤**只在** `.gitmodules` 明确配置了 `submodule.<name>.branch` 时才执行“挂回分支”;否则保持 detached 并提示先运行 `$ws-submodule-setup` 对齐配置。
54
-
55
- ```bash
56
- if [[ -f .gitmodules ]]; then
57
- base_branch="$(git branch --show-current)"
58
- git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null \
59
- | while read -r key sub_path; do
60
- [[ -z "${sub_path:-}" ]] && continue
61
- name="${key#submodule.}"
62
- name="${name%.path}"
63
- echo "== submodule: ${sub_path} (${name}) =="
64
-
65
- sub_sha="$(git rev-parse "HEAD:${sub_path}" 2>/dev/null || true)"
66
- if [[ -z "${sub_sha:-}" ]]; then
67
- echo "[warn] failed to read gitlink sha for ${sub_path}"
68
- continue
69
- fi
70
-
71
- cfg_branch="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
72
- if [[ "${cfg_branch:-}" == "." ]]; then cfg_branch="$base_branch"; fi
73
- if [[ -z "${cfg_branch:-}" ]]; then
74
- echo "[warn] ${sub_path}: missing .gitmodules submodule.${name}.branch; keep detached (run ws-submodule-setup to set it)"
75
- continue
76
- fi
77
-
78
- target_branch="${cfg_branch}"
79
- pin_branch="aiws/pin/${target_branch}"
80
-
81
- git -C "${sub_path}" fetch origin --prune || true
82
-
83
- if git -C "${sub_path}" show-ref --verify --quiet "refs/remotes/origin/${target_branch}"; then
84
- if git -C "${sub_path}" merge-base --is-ancestor "${sub_sha}" "origin/${target_branch}"; then
85
- # 不改动现有分支(避免把已有 main/master 等分支强行指回旧 commit)
86
- # 仅创建/更新一个 AIWS 专用 pin 分支指向 gitlink commit,从 detached “挂回分支”。
87
- git -C "${sub_path}" checkout -B "${pin_branch}" "${sub_sha}"
88
- git -C "${sub_path}" branch --set-upstream-to "origin/${target_branch}" "${pin_branch}" >/dev/null 2>&1 || true
89
- echo "[ok] attached ${sub_path} to ${pin_branch} (upstream=origin/${target_branch}) at ${sub_sha}"
90
- else
91
- echo "[warn] ${sub_path}: ${sub_sha} is not in origin/${target_branch}; keep detached"
92
- fi
93
- else
94
- echo "[warn] ${sub_path}: origin/${target_branch} not found; keep detached"
95
- fi
96
-
97
- git -C "${sub_path}" rev-parse --abbrev-ref HEAD 2>/dev/null || true
98
- git -C "${sub_path}" status -sb || true
99
- done
100
- fi
101
- ```
102
-
103
- 4) 一次性配置(方案 2):为每个 submodule 写入跟踪分支,便于团队统一(需要用户确认,会改动 `.gitmodules`):
104
- ```bash
105
- # 示例:把某个 submodule 固定跟踪 main(会写入 .gitmodules 的 submodule.<name>.branch)
106
- git submodule set-branch --branch main <sub_path>
107
-
108
- # 提示:该变更需要提交到 superproject
109
- git add .gitmodules
110
- git commit -m "chore(submodule): set tracking branch"
111
- ```
112
- 建议:
113
- - 只有当团队明确希望“子模块按分支滚动”(而不是锁定固定 commit)时,才采用方案 2。
114
- - 若只是想避免 detached 但仍锁定 gitlink commit:优先使用步骤 3(不改 `.gitmodules`)。
115
- - 推荐用 `$ws-submodule-setup` 交互式对齐所有 submodules 的 branch,并提交 `.gitmodules`。
116
-
117
- 输出要求:
118
- - `Context:` 当前分支 + 是否存在 `.gitmodules` + submodule 列表
119
- - `Result:` pull 是否 fast-forward;每个 submodule 是否成功“挂回分支”,失败原因是什么
@@ -1,110 +1,18 @@
1
1
  ---
2
2
  name: ws-push
3
- description: 推送(submodule 感知:先 submodules 后 superproject;fast-forward 安全)
3
+ description: `aiws push` 的薄包装入口
4
4
  ---
5
5
 
6
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
6
+ # ws-push
7
7
 
8
- 目标:
9
- - 在不自动提交的前提下,安全 push 当前仓库
10
- - 若仓库包含 submodules:按 `submodules -> superproject` 顺序 push,减少“别人拉取后子模块 detached/分叉”的协作摩擦
11
- - 若不包含 submodules:按普通 git 仓库的规则 push
8
+ `aiws push` 的薄包装入口。
12
9
 
13
- 安全约束(强制):
14
- - 不自动提交、不自动 `git add -A`
15
- - 不使用 `--force` / `--force-with-lease`
16
- - 默认只允许 fast-forward push(发现分叉则停止并提示人工处理)
17
- - 若工作区不干净:停止并要求先 commit 或 stash
18
-
19
- 执行步骤(建议):
20
- 0) 输出上下文:
21
- ```bash
22
- git branch --show-current
23
- git status --porcelain
24
- git status -sb
25
- ```
26
- 若 `git status --porcelain` 非空:停止。
27
-
28
- 1) 判断是否存在 submodules:
29
10
  ```bash
30
- if [[ -f .gitmodules ]]; then
31
- git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' || true
11
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
12
+ ./node_modules/.bin/aiws push
13
+ elif command -v aiws >/dev/null 2>&1; then
14
+ aiws push
32
15
  else
33
- echo "[info] no .gitmodules"
34
- fi
35
- ```
36
-
37
- 2) 若不存在 `.gitmodules` 或没有 submodule 条目:按普通仓库 push(仍需用户确认):
38
- ```bash
39
- git remote -v
40
- git push
41
- ```
42
-
43
- 3) 若存在 submodules:先检查 `.gitmodules` 的 branch 真值是否齐全(缺失则停止并提示 setup):
44
- ```bash
45
- missing=0
46
- while read -r key sub_path; do
47
- name="${key#submodule.}"; name="${name%.path}"
48
- b="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
49
- if [[ -z "${b:-}" ]]; then
50
- echo "error: missing .gitmodules submodule.${name}.branch (path=${sub_path})"
51
- missing=1
52
- fi
53
- done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
54
- if [[ "$missing" -ne 0 ]]; then
55
- echo "hint: run $ws-submodule-setup (and commit .gitmodules), then retry"
56
- exit 2
16
+ npx @aipper/aiws push
57
17
  fi
58
18
  ```
59
-
60
- 4) 逐个 push submodules(fast-forward only),再 push superproject:
61
- ```bash
62
- base_branch="$(git branch --show-current)"
63
- change_id="$(echo "${base_branch}" | sed -n 's|^change/||p')"
64
- targets="changes/${change_id}/submodules.targets"
65
- # Note: if not on a change/ branch, change_id is empty and targets file won't exist;
66
- # resolution falls back to .gitmodules submodule.<name>.branch via ws_resolve_sub_target.
67
-
68
- source tools/ws_resolve_sub_target.sh
69
-
70
- git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null \
71
- | while read -r key sub_path; do
72
- name="${key#submodule.}"; name="${name%.path}"
73
- echo "== submodule: ${sub_path} (${name}) =="
74
-
75
- # submodule 工作区必须干净
76
- if [[ -n "$(git -C "${sub_path}" status --porcelain 2>/dev/null || true)" ]]; then
77
- echo "error: submodule dirty: ${sub_path}"
78
- exit 2
79
- fi
80
-
81
- ws_resolve_sub_target "${sub_path}" "${name}" "${targets}" "${base_branch}" || exit 2
82
- target_branch="${_resolved_branch}"
83
- remote="${_resolved_remote}"
84
-
85
- git -C "${sub_path}" fetch "${remote}" --prune
86
- if ! git -C "${sub_path}" show-ref --verify --quiet "refs/remotes/${remote}/${target_branch}"; then
87
- echo "error: missing ${remote}/${target_branch} for ${sub_path}"
88
- exit 2
89
- fi
90
-
91
- # fast-forward only: <remote>/<branch> 必须是 HEAD 的祖先
92
- if ! git -C "${sub_path}" merge-base --is-ancestor "${remote}/${target_branch}" HEAD; then
93
- echo "error: non-fast-forward (submodule=${sub_path}, remote=${remote}, branch=${target_branch})"
94
- echo "hint: rebase/merge in submodule, then retry"
95
- exit 2
96
- fi
97
-
98
- # push HEAD -> <remote>/<branch>(不 force)
99
- git -C "${sub_path}" push "${remote}" "HEAD:refs/heads/${target_branch}"
100
- done
101
-
102
- # 最后 push superproject(仍需用户确认远端/分支)
103
- git remote -v
104
- git push
105
- ```
106
-
107
- 输出要求:
108
- - `Context:` 当前分支 + 是否有 submodules
109
- - `Submodules:` 每个 submodule push 的目标分支与结果(成功/阻断原因)
110
- - `Superproject:` push 结果
@@ -6,6 +6,7 @@ description: 评审(提交前审计与证据落盘)
6
6
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
7
7
 
8
8
  目标:在提交/交付前审计当前改动,对照真值文件检查是否越界,并把审计证据优先落盘到 `changes/<change-id>/review/`(若无法确定 `change-id` 再回退 `.agentdocs/tmp/review/`)。
9
+ 若当前语境已经明确是“准备交付/finish”,则本入口不应只停留在通用 review:应继续同时补齐 `$ws-spec-review` 与 `$ws-quality-review`,把 dual review gate 一次性收敛完。
9
10
 
10
11
  阶段定位:
11
12
  - review 阶段;负责对当前改动做规范、风险和验证完整性的审计。
@@ -40,7 +41,11 @@ description: 评审(提交前审计与证据落盘)
40
41
  - 默认:`changes/<change-id>/review/codex-review.md`
41
42
  - 回退:`.agentdocs/tmp/review/codex-review.md`(仅在无法确定 `change-id` 时使用)
42
43
  - 若已有其它 reviewer 文件:不要覆盖它们;当前 reviewer 应写自己的文件或更新自己的汇总文件
43
- 4) 回复中输出:
44
+ 4) 若当前任务已进入“准备提交/交付/finish”的语境,继续补齐 dual review gate:
45
+ - 运行/收敛 `$ws-spec-review`,落盘 `changes/<change-id>/review/spec-review.md`(或回退 `.agentdocs/tmp/review/spec-review.md`)
46
+ - 运行/收敛 `$ws-quality-review`,落盘 `changes/<change-id>/review/quality-review.md`(或回退 `.agentdocs/tmp/review/quality-review.md`)
47
+ - 不要把单个 `codex-review.md` 误当成 finish gate 已完成
48
+ 5) 回复中输出:
44
49
  - `证据(Evidence):` 证据文件路径
45
50
  - `主要风险(Top risks):` 3–8 条(高→低)
46
51
  - `下一步(Next):` 最小修复清单 + 最小验证命令
@@ -1,65 +1,18 @@
1
1
  ---
2
2
  name: ws-submodule-setup
3
- description: 子模块分支对齐(写入 .gitmodules 的 submodule.<name>.branch;减少 detached 与人为差异)
3
+ description: `aiws submodule-setup` 的薄包装入口
4
4
  ---
5
5
 
6
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
6
+ # ws-submodule-setup
7
7
 
8
- 目标:
9
- - 为每个 submodule 写入 `.gitmodules` 的 `submodule.<name>.branch`,让 `ws-pull` / `ws-finish` 能确定性地“挂回分支/fast-forward push”,避免 origin 多分支时靠猜导致偏差。
10
- - 该变更是 **superproject 的团队真值**:需要提交 `.gitmodules`。
8
+ `aiws submodule-setup` 的薄包装入口。
11
9
 
12
- 安全约束(强制):
13
- - 不自动提交、不自动 push(必须先输出 diff 并让用户确认)
14
- - 不在 submodule 中做破坏性操作(不 `reset --hard` / 不改动远端)
15
-
16
- 步骤(建议):
17
- 1) 确认工作区干净(否则停止):
18
- ```bash
19
- git status --porcelain
20
- ```
21
-
22
- 2) 列出 submodules(没有则停止并说明无需配置):
23
- ```bash
24
- test -f .gitmodules || { echo "no .gitmodules"; exit 0; }
25
- git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$'
26
- ```
27
-
28
- 3) 对每个 submodule,输出当前配置与建议分支(让用户确认每个 submodule 的 branch):
29
- ```bash
30
- while read -r key sub_path; do
31
- name="${key#submodule.}"; name="${name%.path}"
32
- echo "== submodule: ${name} path=${sub_path} =="
33
- echo "[current] branch=$(git config --file .gitmodules --get submodule.${name}.branch || true)"
34
- echo "[origin] HEAD=$(git -C \"${sub_path}\" symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null || true)"
35
- git -C "${sub_path}" branch -r --list "origin/*" | sed -n '1,30p' || true
36
- echo "[choose] set one of:"
37
- echo " - a concrete branch, e.g. main / master / release/x.y"
38
- echo " - '.' to follow superproject current branch name (only if your team uses matching branch names)"
39
- done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$')
40
- ```
41
-
42
- 4) 逐个写入分支配置(每次写完都回显,避免误配):
43
10
  ```bash
44
- # Example:
45
- # git submodule set-branch --branch main path/to/submodule
46
- # git submodule set-branch --branch . path/to/submodule
11
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
12
+ ./node_modules/.bin/aiws submodule-setup
13
+ elif command -v aiws >/dev/null 2>&1; then
14
+ aiws submodule-setup
15
+ else
16
+ npx @aipper/aiws submodule-setup
17
+ fi
47
18
  ```
48
-
49
- 5) 输出变更并让用户确认是否提交:
50
- ```bash
51
- git diff -- .gitmodules
52
- git status --porcelain
53
- ```
54
-
55
- 6) 若用户确认要提交:
56
- ```bash
57
- git add .gitmodules
58
- git commit -m "chore(submodule): set tracking branches"
59
- ```
60
-
61
- 输出要求:
62
- - `Submodules:` name/path + 选择的 branch(每个都列出)
63
- - `Diff:` `.gitmodules` 的 diff(或至少 `git diff -- .gitmodules` 的摘要)
64
- - `Next:` 提示后续用 `$ws-pull` 拉取可自动减少 detached;`aiws validate` 会检查该配置是否齐全
65
-
@@ -1,59 +1,18 @@
1
1
  ---
2
2
  name: ws-verify-before-complete
3
- description: 完成前验证(finish / handoff 前检查双审查与 validate/evidence 是否齐全)
3
+ description: `aiws verify-bc` 的薄包装入口
4
4
  ---
5
5
 
6
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
6
+ # ws-verify-before-complete
7
7
 
8
- 目标:
9
- - 在进入 `$ws-finish` / `$ws-handoff` 前,检查 review、validate stamp 和证据是否齐全
10
- - 输出明确的 pass/fail 结论,避免“看起来完成了但 gate 没过”的伪完成
8
+ `aiws verify-bc` 的薄包装入口。
11
9
 
12
- 阶段定位:
13
- - finish gate;负责 completion readiness 检查,不直接做 merge / push / handoff。
14
-
15
- 必需输入:
16
- - `changes/<change-id>/review/spec-review.md`
17
- - `changes/<change-id>/review/quality-review.md`
18
- - `.agentdocs/tmp/aiws-validate/*.json`
19
- - 若存在:`changes/<change-id>/evidence/...`、`git status`
20
-
21
- 必需输出:
22
- - `证据(Evidence):` `changes/<change-id>/evidence/verify-before-complete.md` 或回退 `.agentdocs/tmp/review/verify-before-complete.md`
23
- - `结论(Result):` pass / fail
24
- - `缺失项(Missing):` 未满足的 gate
25
- - `下一步(Next):` 进入 `$ws-finish` / `$ws-handoff`,或回退前置 gate
26
-
27
- 阻断条件:
28
- - 缺少 spec review
29
- - 缺少 quality review
30
- - 缺少 validate stamp
31
- - review 中仍有未关闭 blocker
32
- - 无法写 verification 证据
33
-
34
- 完成判定:
35
- - 已落盘 verify-before-complete 证据,并明确能否进入 `$ws-finish` / `$ws-handoff`。
36
-
37
- 步骤(建议):
38
- 1) 识别当前 `change/<change-id>`。
39
- 2) 检查以下最小 gate:
40
- - `changes/<change-id>/review/spec-review.md`
41
- - `changes/<change-id>/review/quality-review.md`
42
- - `.agentdocs/tmp/aiws-validate/*.json`
43
- 3) 若存在 `changes/<change-id>/evidence/`,检查是否已经收敛 review / validate / collaboration summary。
44
- 4) 将结果落盘到:
45
- - 默认:`changes/<change-id>/evidence/verify-before-complete.md`
46
- - 回退:`.agentdocs/tmp/review/verify-before-complete.md`
47
- 5) 输出:
48
- - `证据(Evidence):`
49
- - `结论(Result): pass|fail`
50
- - `缺失项(Missing):`
51
- - `下一步(Next):`
52
-
53
- 重点:
54
- - 这个 gate 不替代 `$ws-finish`;它只判断“是否具备进入 finish / handoff 的前置条件”。
55
- - 若 fail,必须明确回退到哪个 gate:`$ws-spec-review`、`$ws-quality-review`、`aiws validate . --stamp` 或 `aiws change evidence <change-id>`。
56
-
57
- 安全:
58
- - 不打印 secrets。
59
- - 不执行破坏性命令。
10
+ ```bash
11
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
12
+ ./node_modules/.bin/aiws verify-bc
13
+ elif command -v aiws >/dev/null 2>&1; then
14
+ aiws verify-bc
15
+ else
16
+ npx @aipper/aiws verify-bc
17
+ fi
18
+ ```
@@ -9,7 +9,7 @@
9
9
 
10
10
  建议结构:
11
11
  ```
12
- changes/
12
+ .aiws/changes/
13
13
  README.md
14
14
  <change-id>/
15
15
  proposal.md
@@ -32,15 +32,12 @@ changes/
32
32
  - `aiws change new <change-id>` 会预创建以上目录,减少临时约定漂移。
33
33
 
34
34
  常用命令(推荐使用 `aiws`;不依赖 dotfiles):
35
- - `aiws change start <change-id>`(默认:切到 `change/<change-id>` 并初始化工件目录;若检测到 `.gitmodules` 则默认优先使用 worktree,失败则回退为不切分支,避免 submodule 状态混乱)
35
+ - `aiws change start <change-id>`(默认:切到 `change/<change-id>` 并初始化工件目录)
36
36
  - `aiws change start <change-id> --no-switch`(superproject + submodule 场景:不切分支,仅准备 `change/<change-id>` 分支与工件目录)
37
- - `aiws change start <change-id> --switch`(显式允许切换 superproject 分支;仅切 superproject,不递归切换 submodule;仅在存在 `.gitmodules` 时有意义)
38
- - `aiws change start <change-id> --worktree`(推荐用于 superproject + submodule:创建独立 worktree;当前目录分支保持不变)
39
- - 可选:`--worktree-dir <path>` 覆盖 worktree 目录
40
- - 可选:`--submodules` 在 worktree 内执行 `git submodule update --init --recursive`
37
+ - `aiws change start <change-id> --switch`(显式允许切换 superproject 分支;仅切 superproject,不递归切换 submodule
41
38
  - `aiws change finish <change-id>`(安全合并:fast-forward 合并回目标分支;在 `change/<change-id>` 分支上执行时会尝试使用 `.ws-change.json` 的 `base_branch` 作为目标分支)
42
- - `aiws change finish <change-id> --push [--remote <name>]`(最小收尾闭环:若存在 `.gitmodules` 则先按 `changes/<id>/submodules.targets` 顺序 push submodule,再 push 目标分支;默认优先遵循 upstream 配置;若 `change/<change-id>` 位于独立 worktree,且该 worktree 干净,则在 push 成功后自动执行 worktree cleanup,并把 `changes/<id>/` 自动归档到 `changes/archive/...`,同时生成 `handoff.md` 与 archive commit)
43
- - 已 archive 的 `change/<change-id>` 才算真正终态;若只是“已 finish 但仍有 active `changes/<id>/` 未归档”,默认应重跑 `aiws change finish <change-id> --push` 续完收尾,而不是继续开发或复用旧 branch 做新需求。
39
+ - `aiws change finish <change-id> --push [--remote <name>]`(最小收尾闭环:若存在 `.gitmodules` 则先按 `.aiws/changes/<id>/submodules.targets` 顺序 push submodule,再 push 目标分支;默认优先遵循 upstream 配置;push 成功后把 `.aiws/changes/<id>/` 自动归档到 `.aiws/changes/archive/...`,同时生成 `handoff.md` 与 archive commit)
40
+ - 已 archive 的 `change/<change-id>` 才算真正终态;若只是"已 finish 但仍有 active `.aiws/changes/<id>/` 未归档",默认应重跑 `aiws change finish <change-id> --push` 续完收尾,而不是继续开发或复用旧 branch 做新需求。
44
41
  - `aiws change new <change-id>`
45
42
  - `aiws change list`
46
43
  - `aiws change status <change-id>`
@@ -48,24 +45,24 @@ changes/
48
45
  - `aiws change validate <change-id>`
49
46
  - `aiws change sync <change-id>`
50
47
  - `aiws change archive <change-id>`(手工恢复 / 历史兼容入口;标准链路一般不需要单独执行)
51
- - `aiws change evidence <change-id>`(收敛 review / validate / collaboration summary 到 `changes/<id>/evidence/`)
48
+ - `aiws change evidence <change-id>`(收敛 review / validate / collaboration summary 到 `.aiws/changes/<id>/evidence/`)
52
49
 
53
50
  Active change(推荐,团队共享):
54
51
  - 使用分支名声明当前变更:`change/<change-id>`(也支持 `changes/`、`ws/`、`ws-change/`)
55
52
  - 切到该分支后,可省略 `<change-id>` 执行:`aiws change status|next|validate|sync`
56
53
 
57
54
  计划质量门(推荐,执行前):
58
- - 先生成计划:`$ws-plan`(若尚未进入 `change/<change-id>` 上下文,应先由它调用 `aiws change start <change-id>` 建立分支 / worktree,再在该上下文内写 `plan/...`)
55
+ - 先生成计划:`$ws-plan`(若尚未进入 `change/<change-id>` 上下文,应先由它调用 `aiws change start <change-id>` 建立分支,再在该上下文内写 `.aiws/plan/...`)
59
56
  - 再执行计划质检:`$ws-plan-verify`
60
57
  - 最后进入实现:`$ws-dev`
61
- - 若 `$ws-plan` 创建了独立 worktree,后续 `$ws-plan-verify` / `$ws-dev` / `$ws-finish` 都应优先在该 worktree 内继续
58
+ - 若 `$ws-plan` 创建了独立 `change/<change-id>` 分支,后续 `$ws-plan-verify` / `$ws-dev` / `$ws-finish` 都应优先在该分支内继续
62
59
  - 目标:确保计划具备主索引绑定、步骤不过长、验证命令可复现且有预期结果
63
60
 
64
61
  模板覆盖(可选):
65
- - 在工作区创建 `changes/templates/` 可覆盖默认模板:
66
- - `changes/templates/proposal.md`
67
- - `changes/templates/tasks.md`
68
- - `changes/templates/design.md`
62
+ - 在工作区创建 `.aiws/changes/templates/` 可覆盖默认模板:
63
+ - `.aiws/changes/templates/proposal.md`
64
+ - `.aiws/changes/templates/tasks.md`
65
+ - `.aiws/changes/templates/design.md`
69
66
  - 快速初始化模板:`aiws change templates init`
70
67
  - 查看模板来源:`aiws change templates which`
71
68
 
@@ -80,7 +77,7 @@ Hooks/CI(推荐,硬约束):
80
77
  - submodule / 普通仓库:默认 `warn`,提示优先使用中文 commit message
81
78
  - 若执行 `git config aiws.commitMessagePolicy strict`,则会拒绝全英文首行(`Merge/Revert/fixup!/squash!` 例外)
82
79
  - `pre-commit` / `pre-push`:默认执行 `aiws validate .`
83
- - 还会安装门禁脚本(`tools/ws_change_check.py`、`tools/requirements_contract.py`)。
80
+ - 还会安装门禁脚本(`.aiws/tools/ws_change_check.py`、`.aiws/tools/requirements_contract.py`)。
84
81
  - **启用 hooks 需要本地配置**(不会自动提交到 git):
85
82
  - 直接启用:`git config core.hooksPath .githooks`
86
83
  - 或使用:`aiws hooks install .`(等价)
@@ -88,13 +85,13 @@ Hooks/CI(推荐,硬约束):
88
85
  - 紧急跳过(不推荐):`WS_CHANGE_HOOK_BYPASS=1 ...`(CI 不应允许跳过)。
89
86
 
90
87
  合并建议(减少人为 merge 引入新问题):
91
- - 优先使用 worktree + fast-forward 合并:
92
- - 完成后在主工作区(例如 `main`)执行:`aiws change finish <change-id>`(等价于 `git merge --ff-only change/<change-id>`)
93
- - 若还要顺手 push 并清理独立 change worktree:`aiws change finish <change-id> --push`
94
- - 若失败:先在 worktree `git rebase main`(或更新 main 后再 rebase),再重试 `--ff-only`
88
+ - 优先使用 fast-forward 合并:
89
+ - 完成后在目标分支(例如 `main`)执行:`aiws change finish <change-id>`(等价于 `git merge --ff-only change/<change-id>`)
90
+ - 若还要顺手 push:`aiws change finish <change-id> --push`
91
+ - 若失败:先在 change 分支 `git rebase main`(或更新 main 后再 rebase),再重试 `--ff-only`
95
92
 
96
93
  协同交付建议:
97
- - 委托分析先落到 `changes/<id>/analysis/`,由主 agent 在 `ws-review` 或 `review/*.md` 中收敛结论。
98
- - patch 草案先落到 `changes/<id>/patches/`,未经审查不要直接应用。
99
- - 交付前建议执行:`aiws change evidence <change-id>`,让 `delivery-summary` 与 `collaboration-summary` 一起落到 `changes/<id>/evidence/`。
94
+ - 委托分析先落到 `.aiws/changes/<id>/analysis/`,由主 agent 在 `ws-review` 或 `review/*.md` 中收敛结论。
95
+ - patch 草案先落到 `.aiws/changes/<id>/patches/`,未经审查不要直接应用。
96
+ - 交付前建议执行:`aiws change evidence <change-id>`,让 `delivery-summary` 与 `collaboration-summary` 一起落到 `.aiws/changes/<id>/evidence/`。
100
97
  - finish 自动归档后生成的 `handoff.md` 会包含协同工件摘要,便于下一次会话继续接力。
@@ -18,8 +18,8 @@
18
18
  - 需求交付:`Req_ID` = <!-- WS:TODO (需求交付可填;例如 TOOLING-001B) -->
19
19
  - 问题修复:`Problem_ID` = <!-- WS:TODO (问题修复可填;例如 PROB-001) -->
20
20
  - `Contract_Row` = <!-- WS:TODO 绑定执行合同中的行 ID,可多项(逗号分隔);例如 Req_ID=TOOLING-001B -->
21
- - `Plan_File` = <!-- WS:TODO 例如 plan/2026-02-08_15-30-00-xxx.md -->
22
- - `Evidence_Path` = <!-- WS:TODO 证据路径,可多项(逗号分隔);优先写持久证据 changes/<change-id>/evidence/...;也可附带 changes/<change-id>/review/... 或 .agentdocs/tmp/... -->
21
+ - `Plan_File` = <!-- WS:TODO 例如 .aiws/plan/2026-02-08_15-30-00-xxx.md -->
22
+ - `Evidence_Path` = <!-- WS:TODO 证据路径,可多项(逗号分隔);优先写持久证据 .aiws/changes/<change-id>/evidence/...;也可附带 .aiws/changes/<change-id>/review/... 或 .aiws/tmp/... -->
23
23
 
24
24
  ## 依赖关系(可选)
25
25
 
@@ -33,7 +33,7 @@
33
33
 
34
34
  > 规则:
35
35
  > - `Req_ID` 与 `Problem_ID` 至少填写一项。
36
- > - `Contract_Row` 必须引用 `requirements/requirements-issues.csv` 或 `issues/problem-issues.csv` 中的真实行。
36
+ > - `Contract_Row` 必须引用 `.aiws/requirements/requirements-issues.csv` 或 `.aiws/issues/problem-issues.csv` 中的真实行。
37
37
  > - `Plan_File` 对应的计划文件必须存在,且其绑定字段与本文件一致。
38
38
  > - `Evidence_Path` 可先声明计划路径,交付前需完成证据落盘。
39
39
 
@@ -48,9 +48,9 @@
48
48
  ## 协同与委托(可选)
49
49
 
50
50
  - `analysis/`:
51
- - <!-- WS:TODO 如需委托分析,写明预计产物;例如 `changes/<change-id>/analysis/research-a.md` -->
51
+ - <!-- WS:TODO 如需委托分析,写明预计产物;例如 `.aiws/changes/<change-id>/analysis/research-a.md` -->
52
52
  - `patches/`:
53
- - <!-- WS:TODO 如需外部 patch 草案,写明预计文件;例如 `changes/<change-id>/patches/fix-a.patch` -->
53
+ - <!-- WS:TODO 如需外部 patch 草案,写明预计文件;例如 `.aiws/changes/<change-id>/patches/fix-a.patch` -->
54
54
  - `review/`:
55
55
  - <!-- WS:TODO 如需多审查者,写明 reviewer 文件命名或汇总策略 -->
56
56
 
@@ -96,17 +96,17 @@
96
96
  > 从 `AI_WORKSPACE.md` 选择最贴近本变更的验证入口,写成可直接复制执行的命令。
97
97
 
98
98
  - 命令:
99
- - <!-- WS:TODO 例如:`uv run tools/server_test_runner.py --workspace .` -->
99
+ - <!-- WS:TODO 例如:`uv run .aiws/tools/server_test_runner.py --workspace .` -->
100
100
  - 期望结果:
101
101
  - <!-- WS:TODO 例如:所有相关用例 DONE;无新增错误日志 -->
102
102
 
103
103
  ## 真值文件/合同更新清单
104
104
 
105
105
  - `REQUIREMENTS.md`:<!-- WS:TODO 需要/不需要;如需要,写明新增/修改的验收条款 -->
106
- - `requirements/CHANGELOG.md`:<!-- WS:TODO 需要/不需要 -->
107
- - `requirements/requirements-issues.csv`:<!-- WS:TODO 需要/不需要 -->
108
- - `issues/problem-issues.csv`:<!-- WS:TODO 需要/不需要 -->
106
+ - `.aiws/requirements/CHANGELOG.md`:<!-- WS:TODO 需要/不需要 -->
107
+ - `.aiws/requirements/requirements-issues.csv`:<!-- WS:TODO 需要/不需要 -->
108
+ - `.aiws/issues/problem-issues.csv`:<!-- WS:TODO 需要/不需要 -->
109
109
  - 证据落盘(推荐双层):
110
- - 持久(建议入库):`changes/<change-id>/evidence/...`(例如 validate 总结、review 总结、关键日志摘要)
111
- - 临时(可忽略入库):`.agentdocs/tmp/...`(例如 `aiws validate . --stamp` 的 JSON)
112
- - 协同(按需):`changes/<change-id>/analysis/...`、`patches/...`、`review/...`
110
+ - 持久(建议入库):`.aiws/changes/<change-id>/evidence/...`(例如 validate 总结、review 总结、关键日志摘要)
111
+ - 临时(可忽略入库):`.aiws/tmp/...`(例如 `aiws validate . --stamp` 的 JSON)
112
+ - 协同(按需):`.aiws/changes/<change-id>/analysis/...`、`.aiws/changes/<change-id>/patches/...`、`.aiws/changes/<change-id>/review/...`