aodw-skill 0.8.0 → 0.9.0

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 (53) hide show
  1. package/.aodw-next/01-core/aodw-constitution.md +38 -1
  2. package/.aodw-next/01-core/test-discipline.md +124 -0
  3. package/.aodw-next/02-workflow/rt-manager.md +57 -2
  4. package/.aodw-next/02-workflow/spec-full-profile.md +4 -3
  5. package/.aodw-next/02-workflow/spec-lite-profile.md +1 -0
  6. package/.aodw-next/02-workflow/task-pack-projection.md +8 -0
  7. package/.aodw-next/04-auditors/aodw-development-auditor-rules.md +31 -13
  8. package/.aodw-next/04-auditors/aodw-full-auditor-rules.md +61 -39
  9. package/.aodw-next/04-auditors/aodw-requirement-auditor-rules.md +50 -30
  10. package/.aodw-next/README.md +63 -1
  11. package/.aodw-next/SKILL.md +2 -0
  12. package/.aodw-next/config.yaml +5 -0
  13. package/.aodw-next/manifest.yaml +42 -2
  14. package/.aodw-next/manifests/rt-gates.yaml +49 -2
  15. package/.aodw-next/project.yaml +41 -1
  16. package/.aodw-next/skills/handover-pack/SKILL.md +219 -0
  17. package/.aodw-next/skills/handover-pack/references/format-contract.md +124 -0
  18. package/.aodw-next/skills/handover-pack/scripts/_common.sh +92 -0
  19. package/.aodw-next/skills/handover-pack/scripts/check-closure.sh +163 -0
  20. package/.aodw-next/skills/handover-pack/scripts/next-number.sh +111 -0
  21. package/.aodw-next/skills/handover-pack/scripts/validate.py +260 -0
  22. package/.aodw-next/skills/handover-pack/templates/handover-template.md +99 -0
  23. package/.aodw-next/templates/aodw-kernel-loader-template.md +1 -1
  24. package/.aodw-next/templates/rt-meta-template.yaml +11 -0
  25. package/.aodw-next/tools/fixtures/root-g101/RT/RT-701/meta.yaml +4 -0
  26. package/.aodw-next/tools/fixtures/root-g101/RT/RT-702/meta.yaml +4 -0
  27. package/.aodw-next/tools/fixtures/root-g101/RT/RT-703/meta.yaml +4 -0
  28. package/.aodw-next/tools/fixtures/root-g101/RT/index.yaml +11 -0
  29. package/.aodw-next/tools/fixtures/root-g114-noledger/RT/RT-811/meta.yaml +6 -0
  30. package/.aodw-next/tools/fixtures/root-g114-noledger/RT/RT-812/meta.yaml +6 -0
  31. package/.aodw-next/tools/fixtures/root-g114-noledger/RT/index.yaml +7 -0
  32. package/.aodw-next/tools/fixtures/root-g114g115/RT/RT-801/meta.yaml +10 -0
  33. package/.aodw-next/tools/fixtures/root-g114g115/RT/RT-802/meta.yaml +6 -0
  34. package/.aodw-next/tools/fixtures/root-g114g115/RT/RT-803/meta.yaml +7 -0
  35. package/.aodw-next/tools/fixtures/root-g114g115/RT/RT-804/meta.yaml +6 -0
  36. package/.aodw-next/tools/fixtures/root-g114g115/RT/RT-805/meta.yaml +6 -0
  37. package/.aodw-next/tools/fixtures/root-g114g115/RT/RT-806/meta.yaml +11 -0
  38. package/.aodw-next/tools/fixtures/root-g114g115/RT/RT-807/meta.yaml +6 -0
  39. package/.aodw-next/tools/fixtures/root-g114g115/RT/RT-808/meta.yaml +6 -0
  40. package/.aodw-next/tools/fixtures/root-g114g115/RT/RT-809/meta.yaml +9 -0
  41. package/.aodw-next/tools/fixtures/root-g114g115/RT/_deferred-items.md +53 -0
  42. package/.aodw-next/tools/fixtures/root-g114g115/RT/index.yaml +21 -0
  43. package/.aodw-next/tools/fixtures/root-u1/RT/RT-503/handoff/unit-U1-input.md +19 -0
  44. package/.aodw-next/tools/fixtures/root-u1/RT/RT-503/meta.yaml +5 -0
  45. package/.aodw-next/tools/fixtures/root-u1/RT/RT-503/retrospective.md +5 -0
  46. package/.aodw-next/tools/fixtures/root-u1/RT/RT-504/handoff/unit-U1-input.md +19 -0
  47. package/.aodw-next/tools/fixtures/root-u1/RT/RT-504/meta.yaml +5 -0
  48. package/.aodw-next/tools/fixtures/run-fixtures.sh +103 -0
  49. package/.aodw-next/tools/fixtures/run-skill-fixtures.sh +671 -0
  50. package/.aodw-next/tools/install-skills.sh +228 -0
  51. package/.aodw-next/tools/rt-guard.sh +169 -0
  52. package/bin/aodw.js +11 -0
  53. package/package.json +4 -2
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env bash
2
+ # =============================================================================
3
+ # next-number.sh — 给新交接包取一个不会撞的 H 序号
4
+ # =============================================================================
5
+ # 用法:
6
+ # next-number.sh 打印下一个可用序号(如 H004)与占用情况
7
+ # next-number.sh --quiet 只打印序号本身,便于脚本取用
8
+ # next-number.sh --list 列出全部已占用序号及其来源
9
+ # next-number.sh --dir <path> 指定交接包目录(默认 docs/handover)
10
+ # next-number.sh --root <dir> 指定项目根(默认取当前 git 顶层)
11
+ #
12
+ # 目录与项目根也可用环境变量或配置指定,优先级见 _common.sh:
13
+ # --dir > $AODW_HANDOVER_DIR > .aodw-next/config.yaml 的 handover_dir > docs/handover
14
+ # --root > $AODW_PROJECT_ROOT > 当前 git 顶层 > 脚本所在仓库顶层
15
+ #
16
+ # 为什么不能只 ls 一下工作区:
17
+ # 人工取号有两类已知事故——①在**未合并的分支**上占了号,合并时整块丢失,
18
+ # 数日后才靠翻 git 历史找回;②同一个问题隔了些天被登记两次。
19
+ # 只看当前工作区,这两类坑都挡不住。
20
+ # 故本脚本扫三处:①工作区文件 ②HEAD 的历史提交 ③**全部分支(含未合并的)**。
21
+ #
22
+ # 退出码:0 正常 / 2 用法错误
23
+ # =============================================================================
24
+ set -uo pipefail
25
+
26
+ # shellcheck source=_common.sh
27
+ . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/_common.sh"
28
+
29
+ MODE="normal"
30
+ DIR_OPT=""
31
+ ROOT_OPT=""
32
+
33
+ while [[ $# -gt 0 ]]; do
34
+ case "${1:-}" in
35
+ --quiet) MODE="quiet"; shift ;;
36
+ --list) MODE="list"; shift ;;
37
+ --dir) DIR_OPT="${2:-}"; shift 2 ;;
38
+ --root) ROOT_OPT="${2:-}"; shift 2 ;;
39
+ -h|--help) sed -n '2,20p' "$0"; exit 0 ;;
40
+ *) echo "未知参数:${1}(用 --help 看用法)" >&2; exit 2 ;;
41
+ esac
42
+ done
43
+
44
+ REPO="$(hp_resolve_root "$ROOT_OPT")" || {
45
+ echo "定位不到项目根(不在 git 仓库内?)——无法可靠取号。" >&2
46
+ echo "可用 --root <dir> 或 AODW_PROJECT_ROOT 显式指定。" >&2
47
+ exit 2; }
48
+ cd "$REPO" || exit 2
49
+
50
+ DIR="$(hp_resolve_dir "$DIR_OPT" "$REPO")" || exit 2
51
+
52
+ # ① 工作区
53
+ scan_worktree() {
54
+ [[ -d "$DIR" ]] || return 0
55
+ ls "$DIR" 2>/dev/null | grep -o "^H[0-9]\{3\}" | sed 's/^/工作区 /'
56
+ }
57
+ # ② 历史提交(文件可能已改名或删除,但号被用过就不该复用)
58
+ # core.quotepath=false:git 默认把非 ASCII 路径输出成 C 转义串
59
+ # (`交接/H004.md` → `"\344\272\244\346\216\245/H004.md"`),那样下面的 grep 全部落空,
60
+ # 历史与分支两路扫描静默失效——只剩工作区一路,正好漏掉它要防的那两类撞号事故。
61
+ scan_history() {
62
+ git -c core.quotepath=false log --all --pretty=format: --name-only --diff-filter=A -- "$DIR" 2>/dev/null \
63
+ | grep -o "$DIR/H[0-9]\{3\}" | sed "s|$DIR/||" | sed 's/^/历史 /'
64
+ }
65
+ # ③ 全部分支的当前内容(含未合并分支——已知事故 ① 正是栽在这)
66
+ scan_branches() {
67
+ for ref in $(git for-each-ref --format='%(refname)' refs/heads refs/remotes 2>/dev/null); do
68
+ git -c core.quotepath=false ls-tree -r --name-only "$ref" -- "$DIR" 2>/dev/null \
69
+ | grep -o "$DIR/H[0-9]\{3\}" | sed "s|$DIR/||" \
70
+ | sed "s|^|$(basename "$ref") |"
71
+ done
72
+ }
73
+
74
+ ALL="$(printf '%s\n%s\n%s\n' "$(scan_worktree)" "$(scan_history)" "$(scan_branches)" | grep -v '^$' || true)"
75
+ USED="$(printf '%s' "$ALL" | awk '{print $2}' | sort -u | grep -v '^$' || true)"
76
+
77
+ if [[ "$MODE" == "list" ]]; then
78
+ echo "已占用的 H 序号(目录:$DIR;来源含未合并分支):"
79
+ if [[ -z "$USED" ]]; then echo " (无)"; else
80
+ while read -r n; do
81
+ [[ -n "$n" ]] || continue
82
+ src="$(printf '%s' "$ALL" | awk -v n="$n" '$2==n{printf "%s ", $1}' | tr ' ' '\n' | sort -u | tr '\n' ' ')"
83
+ printf ' %s ← %s\n' "$n" "$src"
84
+ done <<< "$USED"
85
+ fi
86
+ exit 0
87
+ fi
88
+
89
+ max=0
90
+ while read -r n; do
91
+ [[ -n "$n" ]] || continue
92
+ v=$((10#${n#H}))
93
+ (( v > max )) && max=$v
94
+ done <<< "$USED"
95
+
96
+ next="$(printf 'H%03d' $((max + 1)))"
97
+
98
+ if [[ "$MODE" == "quiet" ]]; then
99
+ echo "$next"; exit 0
100
+ fi
101
+
102
+ count="$(printf '%s' "$USED" | grep -c . || true)"
103
+ echo "交接包取号"
104
+ echo " 目录: $DIR(相对 $REPO)"
105
+ echo " 已占用:$count 个(扫描范围:工作区 + 历史提交 + 全部分支含未合并)"
106
+ [[ -n "$USED" ]] && echo " 已用号:$(printf '%s' "$USED" | tr '\n' ' ')"
107
+ echo
108
+ echo " 下一个可用:$next"
109
+ echo
110
+ echo " 用法:$DIR/${next}-<主题>.md"
111
+ echo " ⚠️ 取号后请尽快提交占位,长期只在本地分支持有会让别人看不到。"
@@ -0,0 +1,260 @@
1
+ #!/usr/bin/env python3
2
+ """交接包格式校验器。
3
+
4
+ 用法:
5
+ validate.py <交接包路径> 校验,全过 exit 0
6
+ validate.py <路径> --quiet 只输出失败项
7
+
8
+ 退出码:0 通过 / 1 有必须修的问题 / 2 用法错误。
9
+
10
+ 设计原则(来自实测教训):
11
+ - 只判**能机械判定**的事。判不了的(下一步能不能动手、会不会误导)明确交回人工。
12
+ - 判到真问题,不判近似物。例:不只查「有没有 rt 字段」,还查它的值是否合法;
13
+ 不只查「有没有引用 commit」,还查那些 commit 是否真的存在。
14
+ - 每条判据都要有判别力——写完用「本该失败的样本」验一遍。
15
+ - 前提不成立时明确 skip,不产生假红(见 check_commits 的说明)。
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ import re
21
+ import subprocess
22
+ import sys
23
+ from pathlib import Path
24
+
25
+ REQUIRED_FIELDS = [
26
+ "title",
27
+ "status",
28
+ "kind",
29
+ "created",
30
+ "last_verified",
31
+ "owners",
32
+ "rt",
33
+ "related_items",
34
+ "scope",
35
+ "related",
36
+ ]
37
+ STATUS_VALUES = {"active", "superseded", "archived"}
38
+ # 交接包分两类,正文章节要求不同(见 check_sections):
39
+ # session 工作过程交接——「我做了什么、下一个人接着做什么」,八节缺一不可
40
+ # operations 运维手册交接——「这个系统怎么运维」,结构由内容决定,不套用八节
41
+ KIND_VALUES = {"session", "operations"}
42
+ RELATION_TYPES = {"发现", "认领", "结清", "受阻于", "同族"}
43
+ DATE_RE = re.compile(r"^\d{4}-\d{2}-\d{2}$")
44
+ RT_RE = re.compile(r"^(RT-\d+|none|\[.*\])$")
45
+ # 正文必需章节:关键词任一命中即算该节存在
46
+ REQUIRED_SECTIONS = [
47
+ ("一句话", ["一句话", "TL;DR", "摘要"]),
48
+ ("做了什么", ["做了什么", "已完成", "工作内容"]),
49
+ ("怎么做的", ["怎么做", "怎么查", "方法"]),
50
+ ("要解决什么", ["要解决", "希望解决", "为什么做", "问题背景"]),
51
+ ("发现了什么", ["发现了什么", "发现的问题", "实证结论"]),
52
+ ("下一步", ["下一步", "后续", "计划做什么"]),
53
+ ("现状变化", ["现状变化", "现状核实", "落笔前", "接手时的现状"]),
54
+ ("接手清单", ["接手清单", "接手步骤", "照着做"]),
55
+ ]
56
+
57
+ problems: list[str] = []
58
+ warnings: list[str] = []
59
+
60
+
61
+ def fail(msg: str) -> None:
62
+ problems.append(msg)
63
+
64
+
65
+ def warn(msg: str) -> None:
66
+ warnings.append(msg)
67
+
68
+
69
+ def split_frontmatter(text: str) -> tuple[str, str]:
70
+ """返回 (frontmatter 原文, 正文)。无 frontmatter 时前者为空串。"""
71
+ if not text.startswith("---"):
72
+ return "", text
73
+ end = text.find("\n---", 3)
74
+ if end == -1:
75
+ return "", text
76
+ return text[3:end], text[end + 4 :]
77
+
78
+
79
+ def check_frontmatter(fm: str, path: Path) -> None:
80
+ if not fm.strip():
81
+ fail("缺 frontmatter——必须以 `---` 开头(见 references/format-contract.md §一)")
82
+ return
83
+
84
+ # 用 yaml 解析;不可用时降级为逐行提取,保证校验器本身不因环境挂掉
85
+ data: dict = {}
86
+ try:
87
+ import yaml # type: ignore
88
+
89
+ data = yaml.safe_load(fm) or {}
90
+ if not isinstance(data, dict):
91
+ fail("frontmatter 不是 YAML 映射")
92
+ return
93
+ except ImportError:
94
+ for line in fm.splitlines():
95
+ m = re.match(r"^([a-z_]+):\s*(.*)$", line)
96
+ if m:
97
+ data[m.group(1)] = m.group(2).strip()
98
+ warn("未安装 pyyaml,已降级为逐行提取——列表类字段的校验会放宽")
99
+
100
+ for f in REQUIRED_FIELDS:
101
+ if f not in data or data[f] in (None, "", []):
102
+ if f == "related_items" and f in data:
103
+ continue # 空列表合法,但正文要说明;见下方检查
104
+ fail(f"frontmatter 缺必需字段 `{f}`")
105
+
106
+ if (kd := data.get("kind")) and str(kd) not in KIND_VALUES:
107
+ fail(f"`kind` 取值非法:{kd}(合法:{'/'.join(sorted(KIND_VALUES))})")
108
+
109
+ if (st := data.get("status")) and str(st) not in STATUS_VALUES:
110
+ fail(f"`status` 取值非法:{st}(合法:{'/'.join(sorted(STATUS_VALUES))})")
111
+
112
+ for f in ("created", "last_verified"):
113
+ v = data.get(f)
114
+ if v and not DATE_RE.match(str(v)):
115
+ fail(f"`{f}` 必须是 YYYY-MM-DD 格式,当前:{v}")
116
+
117
+ # rt:字段必须存在,但 none 是完全正当的取值——不挂 RT 的会话是常态,
118
+ # 硬凑一个「看起来相关」的编号比留空更浪费接手人的时间。
119
+ rt = data.get("rt")
120
+ if rt is not None:
121
+ rt_s = str(rt) if not isinstance(rt, list) else "[" + ",".join(str(x) for x in rt) + "]"
122
+ if not RT_RE.match(rt_s.replace(" ", "")):
123
+ fail(f"`rt` 取值非法:{rt}(应为 RT-XXX、列表、或 none)")
124
+ if rt_s == "none":
125
+ scope = str(data.get("scope", ""))
126
+ if len(scope.strip()) < 20:
127
+ fail(
128
+ "`rt: none` 完全正当,但请在 `scope` 里一句话说清这是什么性质的工作(当前 scope 过短)"
129
+ )
130
+
131
+ # related_items 的关系类型必须在封闭枚举内
132
+ items = data.get("related_items")
133
+ if isinstance(items, list) and items:
134
+ for it in items:
135
+ if isinstance(it, dict):
136
+ for k, v in it.items():
137
+ if str(v).strip() not in RELATION_TYPES:
138
+ fail(
139
+ f"`related_items` 中 {k} 的关系类型非法:{v}(合法:{'/'.join(sorted(RELATION_TYPES))})"
140
+ )
141
+ elif isinstance(it, str) and ":" in it:
142
+ rel = it.split(":", 1)[1].strip()
143
+ if rel not in RELATION_TYPES:
144
+ fail(f"`related_items` 中的关系类型非法:{rel}")
145
+ elif isinstance(items, list) and not items:
146
+ warn("`related_items` 为空——若本次确实无台账/RT 关联,这是正常的,正文一句话说明即可")
147
+
148
+
149
+ def check_sections(body: str, kind: str) -> None:
150
+ """章节要求按 kind 分流。
151
+
152
+ - session(工作过程交接):讲「我做了什么、下一个人接着做什么」,八节缺一不可。
153
+ - operations(操作手册交接):讲「这个系统怎么运维」,结构由内容决定
154
+ (怎么部署 / 怎么健康检查 / 出事怎么办),**不套用八节**——强行套会把
155
+ 一份好用的手册改坏。只要求它有「接手清单」性质的可操作内容。
156
+ """
157
+ heads = "\n".join(re.findall(r"^#{2,3}\s+.*$", body, re.M))
158
+ if kind == "operations":
159
+ if len(heads.strip().splitlines()) < 3:
160
+ fail("operations 类交接包正文至少要有 3 个二级/三级小节,便于按场景查阅")
161
+ return
162
+ for label, keys in REQUIRED_SECTIONS:
163
+ if not any(k in heads for k in keys):
164
+ fail(f"正文缺必需章节:{label}(标题里应含 {' / '.join(keys[:2])} 之一)")
165
+
166
+
167
+ def check_commits(text: str, repo: Path | None) -> None:
168
+ """引用的 commit hash 必须真实存在——防「引用一个不存在的提交」。
169
+
170
+ ⚠️ repo 为 None(文档不在 git 仓库内)时**整体跳过并 WARN**,不逐条报 FAIL。
171
+ 自检实测教训:把文档复制到临时目录校验时,原实现把每个 commit 都报成「不存在」
172
+ ——一次环境不满足产生十余条假红,掩盖了真正被测的那一条。
173
+ 判据在前提不成立时必须明确 skip,不能产生假红。
174
+ """
175
+ hashes = set(re.findall(r"`([0-9a-f]{7,40})`", text))
176
+ if not hashes:
177
+ warn("正文未引用任何 commit hash——交接包通常应给出可回溯的提交")
178
+ return
179
+ if repo is None:
180
+ warn(f"文档不在 git 仓库内,跳过 {len(hashes)} 个 commit 的存在性校验")
181
+ return
182
+ for h in sorted(hashes):
183
+ r = subprocess.run(
184
+ ["git", "-C", str(repo), "cat-file", "-t", h],
185
+ capture_output=True,
186
+ text=True,
187
+ )
188
+ if r.returncode != 0 or r.stdout.strip() != "commit":
189
+ fail(f"引用的 commit `{h}` 在仓库中不存在(或不是 commit)")
190
+
191
+
192
+ def check_links(text: str, doc: Path, repo: Path) -> None:
193
+ """文档内的相对链接必须指向真实存在的文件。"""
194
+ for label, target in re.findall(r"\[([^\]]+)\]\(([^)]+)\)", text):
195
+ if target.startswith(("http://", "https://", "#", "mailto:")):
196
+ continue
197
+ t = target.split("#", 1)[0]
198
+ if not t:
199
+ continue
200
+ cand = (doc.parent / t), (repo / t)
201
+ if not any(p.exists() for p in cand):
202
+ fail(f"链接指向的文件不存在:[{label}]({target})")
203
+
204
+
205
+ def main(argv: list[str]) -> int:
206
+ args = [a for a in argv[1:] if not a.startswith("--")]
207
+ quiet = "--quiet" in argv
208
+ if len(args) != 1:
209
+ print(__doc__.strip().splitlines()[2].strip(), file=sys.stderr)
210
+ print("用法:validate.py <交接包路径> [--quiet]", file=sys.stderr)
211
+ return 2
212
+
213
+ doc = Path(args[0]).resolve()
214
+ if not doc.is_file():
215
+ print(f"文件不存在:{doc}", file=sys.stderr)
216
+ return 2
217
+
218
+ r = subprocess.run(
219
+ ["git", "-C", str(doc.parent), "rev-parse", "--show-toplevel"],
220
+ capture_output=True,
221
+ text=True,
222
+ )
223
+ # 定位不到仓库根就传 None——让 commit 校验明确跳过,而不是逐条误报
224
+ repo = Path(r.stdout.strip()) if r.returncode == 0 and r.stdout.strip() else None
225
+
226
+ text = doc.read_text(encoding="utf-8")
227
+ fm, body = split_frontmatter(text)
228
+
229
+ kind = "session"
230
+ m = re.search(r"^kind:\s*(\w+)", fm, re.M)
231
+ if m:
232
+ kind = m.group(1)
233
+
234
+ check_frontmatter(fm, doc)
235
+ check_sections(body, kind)
236
+ check_commits(body, repo)
237
+ check_links(body, doc, repo or doc.parent)
238
+
239
+ if not quiet:
240
+ print(f"交接包校验 — {doc.name}\n")
241
+ for w in warnings:
242
+ print(f" \033[33mWARN\033[0m {w}")
243
+ for p in problems:
244
+ print(f" \033[31mFAIL\033[0m {p}")
245
+
246
+ if problems:
247
+ print(f"\n 合计 FAIL={len(problems)} WARN={len(warnings)}")
248
+ print(" ⚠️ 校验不过就不算写完。规则见 references/format-contract.md")
249
+ return 1
250
+
251
+ if not quiet:
252
+ print(f" \033[32mPASS\033[0m 格式校验全过(WARN={len(warnings)})\n")
253
+ print(" ⚠️ 脚本查不了这两件事,请人工过一遍:")
254
+ print(" 1. §下一步 的每一条,接手的人照着能不能直接动手?")
255
+ print(" 2. §现状变化 读完会不会被误导?")
256
+ return 0
257
+
258
+
259
+ if __name__ == "__main__":
260
+ sys.exit(main(sys.argv))
@@ -0,0 +1,99 @@
1
+ ---
2
+ title: <一句话说清这是什么工作的交接包>
3
+ status: active
4
+ kind: session # session=工作过程交接(本模板);operations=运维手册型,不套用八节
5
+ created: YYYY-MM-DD
6
+ last_verified: YYYY-MM-DD
7
+ owners: [<项目或团队标识>]
8
+ rt: RT-XXX # 会话在某 RT 里进行就填它;跨多个写 [RT-A, RT-B];
9
+ # 不挂 RT 就写 none——这是常态不是缺陷,别硬凑编号
10
+ related_items: # 与台账/RT 的关联。关系类型限:发现/认领/结清/受阻于/同族
11
+ # 确实没有关联就写 [],正文一句话说明即可
12
+ - DI-0XX: 认领
13
+ - RT-YYY: 同族
14
+ scope: >
15
+ 两三句话:这份交接包覆盖哪段工作、写给谁看、读者最该先看哪一节。
16
+ 若 rt 为 none,这里一句话说清工作性质(轻量车道 / 台账整理 / 工具改进 / 纯讨论 …)。
17
+ related:
18
+ - 路径/到/关键文件.py # 每条带注释说明为什么相关
19
+ ---
20
+
21
+ # <标题>
22
+
23
+ > 交接对象:<下一个接手的人 / worker agent>
24
+ > 落笔日期:YYYY-MM-DD | 工作发生于 YYYY-MM-DD ~ YYYY-MM-DD
25
+ > **落笔前已重新核实仓库现状**,差异见 §6——那节最重要,先读它。
26
+
27
+ ---
28
+
29
+ ## 0. 一句话
30
+
31
+ <不看别的、只读这段就知道发生了什么。一到三句。>
32
+
33
+ ---
34
+
35
+ ## 1. 我们之前做了什么
36
+
37
+ <按时间或主题列。每项带 commit hash。>
38
+
39
+ ### 1.1 起点:<为什么开始做这件事>
40
+
41
+ ### 1.2 <做的第一件事>(commit `xxxxxxx`)
42
+
43
+ ---
44
+
45
+ ## 2. 我们是怎么做的、怎么查的
46
+
47
+ **这一节是方法论,比结论更值得复用。**
48
+
49
+ <用什么命令查的、怎么验证的、踩过什么坑。写成下一个人能照着做的形式。>
50
+
51
+ ```bash
52
+ # 可直接复制运行的命令
53
+ ```
54
+
55
+ ---
56
+
57
+ ## 3. 我们希望解决的问题是什么
58
+
59
+ <为什么做这件事。没有这节,接手的人会把手段当目的。>
60
+
61
+ ---
62
+
63
+ ## 4. 当前我们发现了什么问题
64
+
65
+ <实证结论。每条带证据:file:line(附关键词)/ 命令输出 / commit hash。>
66
+
67
+ ---
68
+
69
+ ## 5. 下一步我们计划做什么
70
+
71
+ **每一条都要能直接动手**:改哪个文件、跑什么命令、预期什么结果。
72
+
73
+ | 建议 | 具体做什么 | 改动量 |
74
+ |---|---|---|
75
+ | | | |
76
+
77
+ ---
78
+
79
+ ## 6. 你接手时的现状变化(**最重要,先读这节**)
80
+
81
+ <落笔前重新核实的结果,与工作发生时的差异。**无差异也要显式写「已复核,无变化」**。>
82
+
83
+ <典型要核的:引用的 file:line 是否漂移、commit 是否还在、声称已解决的是否真解决、
84
+ 目录结构是否被重构、相关 RT/DI 的状态是否变了。>
85
+
86
+ ---
87
+
88
+ ## 7. 接手清单(照着做)
89
+
90
+ 1. **先确认环境**:<有环境陷阱就写在第一条>
91
+ 2. …
92
+
93
+ ---
94
+
95
+ ## 8. 相关提交索引
96
+
97
+ | commit | 内容 |
98
+ |---|---|
99
+ | `xxxxxxx` | |
@@ -32,7 +32,7 @@
32
32
  | **项目概览初始化** | {{REF_PREFIX}}.aodw-next/01-core/ai-project-overview-rules.md | 初始化或完善项目概览信息(技术栈、架构、模块等) |
33
33
  | **分析阶段** | {{REF_PREFIX}}.aodw-next/03-standards/ai-coding-rules.md (Sec 2-3)<br/>{{REF_PREFIX}}.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.4) | 影响分析、不变量检查,更新 impact.md, invariants.md |
34
34
  | **实现阶段** | {{REF_PREFIX}}.aodw-next/03-standards/ai-coding-rules.md (Sec 6)<br/>{{REF_PREFIX}}.aodw-next/01-core/ai-knowledge-rules.md (Sec 3.5)<br/>{{REF_PREFIX}}.aodw-next/01-core/module-doc-rules.md | 代码实现、测试编写、模块文档更新 |
35
- | **验证阶段** | {{REF_PREFIX}}.aodw-next/01-core/ai-knowledge-rules.md (Sec 5) | 验证文档与代码一致,检查 RT 完整性 |
35
+ | **验证阶段** | {{REF_PREFIX}}.aodw-next/01-core/ai-knowledge-rules.md (Sec 5)<br/>{{REF_PREFIX}}.aodw-next/01-core/test-discipline.md | 验证文档与代码一致,检查 RT 完整性;按判据纪律写验收判据(判据 / AI 评审 / 读产出三格) |
36
36
  | **CSF 审查** | {{REF_PREFIX}}.aodw-next/01-core/csf-thinking-framework.md | 执行 CSF 思维框架审查(以终为始、结构化分解、关键要素识别等) |
37
37
  | **执行需求审计** | {{REF_PREFIX}}.aodw-next/04-auditors/aodw-requirement-auditor-rules.md | 调用需求阶段审计官,对需求文档进行审计(自动触发或手动触发) |
38
38
  | **执行开发审计** | {{REF_PREFIX}}.aodw-next/04-auditors/aodw-development-auditor-rules.md | 调用开发阶段审计官,对代码进行审计(自动触发或手动触发) |
@@ -62,6 +62,17 @@ external_ids:
62
62
  github: null
63
63
  other: null
64
64
 
65
+ # 遗留事项(DI)台账联动。约定见 rt-manager.md §3.4b-2。
66
+ # **没转出 / 没认领就不要写这两个字段**——字段缺失即判据不适用(G114/G115 返回
67
+ # PASS 并说明「无声明可校验」),未采用台账约定的项目行为完全不变。
68
+ # 转出:本 RT 发现、并已写入 RT/_deferred-items.md 的 DI 编号。
69
+ # G114 校验:编号在台账须有条目,且该条目「发现于」属于本 RT。
70
+ # 认领:本 RT 从台账拿走继续做的 DI 编号。
71
+ # G115 校验:台账该条目的「状态」值单元格须已写明本 RT-ID,且不能仍是「未认领」。
72
+ # 只认这两个结构化字段的列表值;注释里出现的 DI 编号不会被当成声明。
73
+ # deferred_items_raised: []
74
+ # deferred_items_claimed: []
75
+
65
76
  # 额外说明(可选,供人和 AI 阅读)
66
77
  notes: >
67
78
  在这里简要描述本 RT 的背景、限制或特殊说明。
@@ -0,0 +1,4 @@
1
+ rt_id: RT-701
2
+ title: "fixture: type 非法但 index 条目带 backfill(存量回填,G101 豁免)"
3
+ type: Fix
4
+ profile: Spec-Lite
@@ -0,0 +1,4 @@
1
+ rt_id: RT-702
2
+ title: "fixture: type 非法且 index 条目不带 backfill(新 RT,G101 照常硬失败)"
3
+ type: Fix
4
+ profile: Spec-Lite
@@ -0,0 +1,4 @@
1
+ rt_id: RT-703
2
+ title: "fixture: type 非法且 index.yaml 里根本没有本 RT 条目(G101 照常硬失败)"
3
+ type: Feature + Bugfix
4
+ profile: Spec-Lite
@@ -0,0 +1,11 @@
1
+ # RT 索引(fixture 最小形态:G101 存量回填豁免的三态锚点)
2
+ # 条目缩进形态对齐真实 index.yaml:`entries:` 之下 `- id:` 顶格。
3
+ schema: rt-index-v1
4
+ entries:
5
+ - id: RT-701
6
+ title: 存量回填条目——带 backfill 键,G101 六值约束豁免
7
+ backfill: rt125-u4
8
+ - id: RT-702
9
+ title: 新 RT 条目——不带 backfill 键,G101 照常硬失败
10
+ - id: RT-999
11
+ title: 无关条目,仅用于确认 awk 块扫描在下一个 `- id:` 处正确收尾
@@ -0,0 +1,6 @@
1
+ rt_id: RT-811
2
+ title: "fixture: G114 边界——声明了转出,但 RT/_deferred-items.md 不存在"
3
+ type: Feature
4
+ profile: Spec-Lite
5
+ deferred_items_raised:
6
+ - DI-001
@@ -0,0 +1,6 @@
1
+ rt_id: RT-812
2
+ title: "fixture: G115 边界——声明了认领,但 RT/_deferred-items.md 不存在"
3
+ type: Feature
4
+ profile: Spec-Lite
5
+ deferred_items_claimed:
6
+ - DI-001
@@ -0,0 +1,7 @@
1
+ # RT 索引(fixture:本 root 有意**不含** RT/_deferred-items.md)
2
+ schema: rt-index-v1
3
+ entries:
4
+ - id: RT-811
5
+ title: G114 边界——声称转出但台账文件整个不存在
6
+ - id: RT-812
7
+ title: G115 边界——声称认领但台账文件整个不存在
@@ -0,0 +1,10 @@
1
+ rt_id: RT-801
2
+ title: "fixture: G114 正例——声称转出的 DI 全部在台账有属于本 RT 的条目"
3
+ type: Feature
4
+ profile: Spec-Lite
5
+ # 四条 DI 的「发现于」单元格都写 RT-801,G114 应全部命中
6
+ deferred_items_raised:
7
+ - DI-001
8
+ - DI-002
9
+ - DI-004
10
+ - DI-005
@@ -0,0 +1,6 @@
1
+ rt_id: RT-802
2
+ title: "fixture: G114 反例——声称转出的编号在台账里根本不存在"
3
+ type: Feature
4
+ profile: Spec-Lite
5
+ deferred_items_raised:
6
+ - DI-009
@@ -0,0 +1,7 @@
1
+ rt_id: RT-803
2
+ title: "fixture: G114 反例——编号已被别的 RT 占用(内容没落盘)"
3
+ type: Feature
4
+ profile: Spec-Lite
5
+ # DI-003 存在,但其「发现于」是 RT-802 ⇒ 本 RT 宣称转出实为空账
6
+ deferred_items_raised:
7
+ - DI-003
@@ -0,0 +1,6 @@
1
+ rt_id: RT-804
2
+ title: "fixture: G115 反例——声称认领但台账状态仍写「未认领」"
3
+ type: Feature
4
+ profile: Spec-Lite
5
+ deferred_items_claimed:
6
+ - DI-001
@@ -0,0 +1,6 @@
1
+ rt_id: RT-805
2
+ title: "fixture: G115 正例——台账状态列已标注本 RT-ID"
3
+ type: Feature
4
+ profile: Spec-Lite
5
+ deferred_items_claimed:
6
+ - DI-004
@@ -0,0 +1,11 @@
1
+ rt_id: RT-806
2
+ title: "fixture: G115 反例——台账状态标的是别的 RT(认领人不符)"
3
+ type: Feature
4
+ profile: Spec-Lite
5
+ # DI-002 状态=已认领(RT-803)——认领人是别的 RT。
6
+ # DI-004 状态=已认领(RT-805),但其「建议处置」行**有意提到 RT-806**:
7
+ # 若实现退化成「在整个条目块里 grep RT-ID」,DI-004 会被误判成一致。
8
+ # 本用例同时声称认领两条,靠 detail 必须同时报出两个编号来钉死该退化。
9
+ deferred_items_claimed:
10
+ - DI-002
11
+ - DI-004
@@ -0,0 +1,6 @@
1
+ rt_id: RT-807
2
+ title: "fixture: G115 反例——条目存在但台账缺「状态」行"
3
+ type: Feature
4
+ profile: Spec-Lite
5
+ deferred_items_claimed:
6
+ - DI-005
@@ -0,0 +1,6 @@
1
+ rt_id: RT-808
2
+ title: "fixture: G115 反例——声称认领的编号在台账里不存在"
3
+ type: Feature
4
+ profile: Spec-Lite
5
+ deferred_items_claimed:
6
+ - DI-009
@@ -0,0 +1,9 @@
1
+ rt_id: RT-809
2
+ title: "fixture: 向后兼容——完全不写 DI 字段的存量 RT,G114/G115 零影响"
3
+ type: Feature
4
+ profile: Spec-Lite
5
+ # 有意不写 deferred_items_raised / deferred_items_claimed。
6
+ # 台账文件就在同一 root 下(RT/_deferred-items.md),本用例证明判据不会
7
+ # 因「台账存在」就去反向追责没声明的 RT。
8
+ notes: >
9
+ 未采用 DI 台账约定的项目/RT,行为与本 PR 之前完全一致。