teamsmith 0.3.2 → 0.3.4
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/README.md +5 -4
- package/package.json +2 -6
- package/skills/handover/SKILL.md +117 -0
- package/skills/teamsmith/CHANGELOG.md +65 -0
- package/skills/teamsmith/SKILL.md +2 -1
- package/skills/teamsmith/extension/team-inbox-watch.ts +30 -1
- package/skills/teamsmith/extension/team-notify.ts +161 -20
- package/skills/teamsmith/references/agent-adapters.md +3 -1
- package/skills/teamsmith/references/config.md +1 -1
- package/skills/teamsmith/references/protocol.md +21 -0
- package/skills/teamsmith/references/troubleshooting.md +7 -3
- package/skills/teamsmith/scripts/lib/cmd-agents.sh +213 -19
- package/skills/teamsmith/scripts/lib/cmd-config.sh +1 -1
- package/skills/teamsmith/scripts/lib/cmd-init.sh +85 -9
- package/skills/teamsmith/scripts/lib/cmd-status.sh +177 -21
- package/skills/teamsmith/scripts/lib/cmd-watch.sh +11 -1
- package/skills/teamsmith/scripts/lib/common.sh +7 -3
- package/skills/teamsmith/scripts/lib/outbox.sh +31 -3
- package/skills/teamsmith/scripts/panel/panel.js +1 -1
- package/skills/teamsmith/scripts/panel/src/strings/en.ts +1 -1
- package/skills/teamsmith/scripts/panel/src/strings/zh.ts +1 -1
- package/skills/teamsmith/scripts/strings/help.en.tsv +1 -1
- package/skills/teamsmith/scripts/strings/help.zh.tsv +1 -1
- package/skills/teamsmith/scripts/team +1 -0
- package/skills/teamsmith/templates/config.sh.tmpl +2 -1
- package/skills/teamsmith/tests/bg-ledger-harness.mjs +17 -6
- package/skills/teamsmith/tests/bg-ledger.sh +16 -5
- package/skills/teamsmith/tests/checkout-shape-probe.sh +10 -2
- package/skills/teamsmith/tests/help-surface.sh +1 -1
- package/skills/teamsmith/tests/install-shape.sh +234 -46
- package/skills/teamsmith/tests/panel-choices.sh +11 -7
- package/skills/teamsmith/tests/section-paths.tsv +2 -2
- package/skills/teamsmith/tests/skill-load.mjs +6 -2
- package/skills/teamsmith/tests/smoke.sh +643 -27
- package/skills/teamsmith/tests/task-model-routing.sh +10 -1
- package/skills/teamsmith/tests/team-inbox-watch-harness.mjs +33 -0
- package/skills/teamsmith/tests/team-notify-knock-marker.mjs +91 -0
- package/skills/teamsmith/tests/tmux-lint.pl +12 -2
- package/skills/teamsmith-init/SKILL.md +1 -1
|
@@ -252,11 +252,12 @@ if selects flip; then
|
|
|
252
252
|
fi
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
# ①
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
# ① (已退休,2026-10-22 P368)措辞回退的红侧:它断言的用例
|
|
256
|
+
# 「wording: the retired duty wording is gone from every registered text」由 P264(4cd5827e,门禁瘦身,
|
|
257
|
+
# 独立复验 V39 PASS)连同整批 text-class 断言一起删掉了。用例没了,这条破坏就再无人应答:
|
|
258
|
+
# 它在 flip 组里恒红「破坏后夹具仍然全绿」,而 wording 组实际只剩一条行为用例(完成叫醒点名两个 id)。
|
|
259
|
+
# 按净零纪律用一个活的红侧(⑲,merge 组的行计数读者)换掉一个死的。不恢复被删的措辞断言:
|
|
260
|
+
# 那是 P264 已裁定并独立复验过的删除,不属于本任务。
|
|
260
261
|
|
|
261
262
|
# ② 删 start 行 → start 落盘断言必须红
|
|
262
263
|
M2="$(flip_mut start-line "$BG_EXT" 's#appendLedger(root, `start id=${id} pid=${job.pid}`)#void 0 /* flip: start line removed */#')"
|
|
@@ -406,6 +407,16 @@ if selects flip; then
|
|
|
406
407
|
run_harness flip-wake-suspended wake "$BG_EXT" "$M18"
|
|
407
408
|
expect_red flip-wake-suspended "wake: a suspended line never wakes" "$TMP/h-flip-green-notify.log"
|
|
408
409
|
|
|
410
|
+
# ⑲ P368 · merge 组的第二条红侧(行计数读者):让**指针腿**不再合并(每个事件另起一行)
|
|
411
|
+
# —— 一个 run 就在 pm.md 里变成三条待办,而契约是「一条合并行只算一行」。只改指针腿是因为
|
|
412
|
+
# 记录腿的合并由本组前面的用例钉住(一次全关合并会让 ② 先红、harness 在首个失败处退出,
|
|
413
|
+
# 就根本走不到 ⑨);指针腿是 ⑨ 量的那条流量。
|
|
414
|
+
M19="$(flip_tree merge-off)"
|
|
415
|
+
F19="$(flip_tree_sed merge-off scripts/lib/cmd-agents.sh "s|^ team_inbox_write_with_lock pm \"\$content\" \"\$file\" '-' >/dev/null\$| printf -- '- %s\\\\n' \"\$content\" >> \"\$file\" # P368FLIP pointer leg does not merge|")"
|
|
416
|
+
flip_premise merge-off "$F19" 'P368FLIP pointer leg does not merge' has
|
|
417
|
+
run_harness flip-merge-off merge "$BG_EXT" "$M19"
|
|
418
|
+
expect_red flip-merge-off "merge: line-counting readers count a merged line once" "$TMP/h-flip-green-notify.log"
|
|
419
|
+
|
|
409
420
|
# 还原后绿:pristine 树重跑一遍(上面所有破坏都只写 scratch 副本)
|
|
410
421
|
section "flip · 还原后绿(pristine 树重跑)"
|
|
411
422
|
run_harness flip-restored wording
|
|
@@ -99,8 +99,16 @@ scratch_tree() { # <名字> <product-only|internal|mixed>
|
|
|
99
99
|
cp -a "$x" "$d/$b"
|
|
100
100
|
done
|
|
101
101
|
cp -a "$REAL_ROOT/openspec/specs" "$d/openspec/specs"
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
# P361:拷贝集合从源派生 —— 真实目录 + SKILL.md 的 name 与目录名一致(与产品 team_skill_inventory、
|
|
103
|
+
# 夹具 skill_src_names 同一口径)。写死两个名字时,第三个技能缺席会让嵌套 run 的 §0b 判红(V93 实测
|
|
104
|
+
# ok126/bad21),而那并不是被检树的问题,是探针自己的形状不合规。以后加技能不必再改这里。
|
|
105
|
+
for x in "$REAL_ROOT"/skills/*/; do
|
|
106
|
+
[ -d "$x" ] || continue
|
|
107
|
+
[ -L "${x%/}" ] && continue
|
|
108
|
+
b="$(basename "$x")"
|
|
109
|
+
[ "$(sed -n 's/^name:[[:space:]]*//p' "$x/SKILL.md" 2>/dev/null | head -1)" = "$b" ] || continue
|
|
110
|
+
cp -a "$x" "$d/skills/$b"
|
|
111
|
+
done
|
|
104
112
|
if [ "$mode" = "internal" ] || [ "$mode" = "mixed" ]; then
|
|
105
113
|
# 公开导出树里没有 AGENTS.md / SCOPE.md / .pi / openspec/changes / docs/team/reports:有就拷,没有就
|
|
106
114
|
# 建最小骨架(内部/混合树的控制会自己判断这棵树里有没有可判的内部材料,没有就可见 skip)。
|
|
@@ -812,7 +812,7 @@ check_coverage() {
|
|
|
812
812
|
[ "$aw" = "0" ] && ok "每个别名都打印主命令的页并点名该别名"
|
|
813
813
|
|
|
814
814
|
# O2 · the dispatcher's internal entries are a closed set, declared in one place (here)
|
|
815
|
-
local internal="__inbox-write __panel-data"
|
|
815
|
+
local internal="__inbox-write __notify-settle __panel-data"
|
|
816
816
|
local found want nm extra="" miss="" n
|
|
817
817
|
found="$(team_internal_labels)"
|
|
818
818
|
want="$(printf '%s\n' $internal | sort -u)"
|
|
@@ -162,6 +162,28 @@ drift_skill_copy() { # <tree> <repo> → DRIFT_VER = 漂移版本;自检不过
|
|
|
162
162
|
}
|
|
163
163
|
DRIFT_VER=""
|
|
164
164
|
|
|
165
|
+
# P361:技能名的真源 —— 源里有几个技能,而不是代码里写死的数字。口径与产品 team_skill_inventory 同一条:
|
|
166
|
+
# 真实目录(不是软链)+ 有 SKILL.md + frontmatter 的 name 与目录名一致。装上第四个技能时,下面所有「数了几个」
|
|
167
|
+
# 的断言跟着源清单走(写死的 2 会先红一次再被改掉 —— P361 就是这么暴的)。
|
|
168
|
+
skill_md_name_of() { # <skill 目录> → frontmatter 的 name(与产品 team_skill_md_name 同一读法)
|
|
169
|
+
awk '
|
|
170
|
+
/^---[[:space:]]*$/ { n++; if (n == 2) exit 0; next }
|
|
171
|
+
n == 1 && /^name:[[:space:]]*/ {
|
|
172
|
+
sub(/^name:[[:space:]]*/, ""); sub(/[[:space:]]+$/, ""); print; exit 0
|
|
173
|
+
}
|
|
174
|
+
' "$1/SKILL.md" 2>/dev/null
|
|
175
|
+
}
|
|
176
|
+
src_skill_names() { # <tree>:源里真实存在的技能名(一项一行,排序)
|
|
177
|
+
local t="$1" d n
|
|
178
|
+
for d in "$t"/skills/*/; do
|
|
179
|
+
[ -d "$d" ] || continue
|
|
180
|
+
[ -L "${d%/}" ] && continue
|
|
181
|
+
n="$(basename "$d")"
|
|
182
|
+
[ "$(skill_md_name_of "$d")" = "$n" ] || continue
|
|
183
|
+
printf '%s\n' "$n"
|
|
184
|
+
done | sort
|
|
185
|
+
}
|
|
186
|
+
|
|
165
187
|
# 假 pi:doctor 的其它行不该由宿主环境决定(本节只测 install 行)
|
|
166
188
|
FAKE_PI="$tmp/fake-pi"
|
|
167
189
|
mkdir -p "$FAKE_PI"
|
|
@@ -258,6 +280,67 @@ chk_unknown_survives() { # <tree> <已在 .pi/skills/teamsmith 放了未识别
|
|
|
258
280
|
return 0
|
|
259
281
|
}
|
|
260
282
|
|
|
283
|
+
# ── P361 · 技能源口径:**谁是源**由发现回答,**少了谁**只能由声明回答 ──
|
|
284
|
+
chk_skill_sources_ok() { # <tree> <repo>:源完整 → 全部装上、没有 miss、没有不合法裁决
|
|
285
|
+
local t="$1" p="$2" out rc want got
|
|
286
|
+
out="$(init_proj "$t" "$p")"; rc=$?
|
|
287
|
+
if [ "$rc" -ne 0 ]; then printf 'init rc=%s(完整的源不该有裁决)\n' "$rc"; return 1; fi
|
|
288
|
+
case "$out" in
|
|
289
|
+
*' miss '*) printf '源完整却报了 miss:[%s]\n' "$(printf '%s' "$out" | grep -F ' miss ' | head -1)"; return 1 ;;
|
|
290
|
+
*不合法*) printf '源完整却裁了「不合法」:[%s]\n' "$(printf '%s' "$out" | grep -F '不合法' | head -1)"; return 1 ;;
|
|
291
|
+
esac
|
|
292
|
+
want="$(src_skill_names "$t" | tr '\n' ' ')"; got="$(ls -1A "$p/.pi/skills" 2>/dev/null | sort | tr '\n' ' ')"
|
|
293
|
+
if [ "$got" != "$want" ]; then printf '.pi/skills/ 与源清单不一致:装成 [%s],源里 [%s]\n' "$got" "$want"; return 1; fi
|
|
294
|
+
printf '源里 %s 个技能全部装上(%s),没有 miss / 不合法\n' "$(printf '%s' "$want" | wc -w | tr -d ' ')" "$want"
|
|
295
|
+
return 0
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
chk_skill_bad_name_reported() { # <tree> <repo>:frontmatter 的 name 与目录名不符 → 非 0 并点名两个名字
|
|
299
|
+
local t="$1" p="$2" out rc
|
|
300
|
+
out="$(init_proj "$t" "$p")"; rc=$?
|
|
301
|
+
if [ "$rc" -eq 0 ]; then printf 'name 不符却 rc=0\n'; return 1; fi
|
|
302
|
+
case "$out" in *不合法*) ;; *) printf '没裁「不合法」:%s\n' "$(printf '%s' "$out" | tail -2 | tr '\n' ' ')"; return 1 ;; esac
|
|
303
|
+
case "$out" in *handover-x*) ;; *) printf '没点名 SKILL.md 里的错名字 handover-x\n'; return 1 ;; esac
|
|
304
|
+
case "$out" in *'/skills/handover '*) ;; *) printf '没点名源目录 skills/handover\n'; return 1 ;; esac
|
|
305
|
+
printf 'rc=%s,点名源目录 skills/handover 与错名字 handover-x\n' "$rc"
|
|
306
|
+
return 0
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
chk_skill_no_note() { # <tree> <repo>:声明面完整 → 全部装上且**没有** note 行(未登记分支不该被触发)
|
|
310
|
+
local t="$1" p="$2" out rc want got
|
|
311
|
+
out="$(init_proj "$t" "$p")"; rc=$?
|
|
312
|
+
if [ "$rc" -ne 0 ]; then printf 'init rc=%s(声明面完整不该有裁决)\n' "$rc"; return 1; fi
|
|
313
|
+
case "$out" in
|
|
314
|
+
*' note '*) printf '声明面完整却报了未登记:[%s]\n' "$(printf '%s' "$out" | grep -F ' note ' | head -1)"; return 1 ;;
|
|
315
|
+
esac
|
|
316
|
+
want="$(src_skill_names "$t" | tr '\n' ' ')"; got="$(ls -1A "$p/.pi/skills" 2>/dev/null | sort | tr '\n' ' ')"
|
|
317
|
+
if [ "$got" != "$want" ]; then printf '.pi/skills/ 与源清单不一致:装成 [%s],源里 [%s]\n' "$got" "$want"; return 1; fi
|
|
318
|
+
printf '没有 note 行,%s 个技能全部装上(%s)\n' "$(printf '%s' "$want" | wc -w | tr -d ' ')" "$want"
|
|
319
|
+
return 0
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
chk_skill_unregistered_reported() { # <tree> <repo>:源里有、声明里没有 → 照装(rc=0)并点名它是未登记
|
|
323
|
+
local t="$1" p="$2" out rc want got
|
|
324
|
+
out="$(init_proj "$t" "$p")"; rc=$?
|
|
325
|
+
if [ "$rc" -ne 0 ]; then printf '未登记只是「照装并喊一声」,不该 rc=%s\n' "$rc"; return 1; fi
|
|
326
|
+
case "$out" in *' note handover '*) ;; *) printf '没有可见地说 handover 未登记:%s\n' "$(printf '%s' "$out" | head -2 | tr '\n' ' ')"; return 1 ;; esac
|
|
327
|
+
want="$(src_skill_names "$t" | tr '\n' ' ')"; got="$(ls -1A "$p/.pi/skills" 2>/dev/null | sort | tr '\n' ' ')"
|
|
328
|
+
if [ "$got" != "$want" ]; then printf '未登记的技能没被装上:装成 [%s],源里 [%s]\n' "$got" "$want"; return 1; fi
|
|
329
|
+
printf 'rc=0,点名 note handover,%s 个技能全部照装(%s)\n' "$(printf '%s' "$want" | wc -w | tr -d ' ')" "$want"
|
|
330
|
+
return 0
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
chk_skill_missing_reported() { # <tree> <repo>:源里少一个技能 → 不崩(rc=0)且可见地点名少了谁
|
|
334
|
+
local t="$1" p="$2" out rc n_n m_n
|
|
335
|
+
out="$(init_proj "$t" "$p")"; rc=$?
|
|
336
|
+
if [ "$rc" -ne 0 ]; then printf '少一个技能源就 rc=%s(安装不该崩)\n' "$rc"; return 1; fi
|
|
337
|
+
case "$out" in *' miss handover(源 '*) ;; *) printf '没有可见地说少了 handover:%s\n' "$(printf '%s' "$out" | head -2 | tr '\n' ' ')"; return 1 ;; esac
|
|
338
|
+
n_n="$(src_skill_names "$t" | wc -l | tr -d ' ')"; m_n="$(ls -1A "$p/.pi/skills" 2>/dev/null | wc -l | tr -d ' ')"
|
|
339
|
+
if [ "$n_n" != "$m_n" ]; then printf '装了 %s 个,源里 %s 个\n' "$m_n" "$n_n"; return 1; fi
|
|
340
|
+
printf 'rc=0,点名 miss handover,其余 %s 个照装\n' "$m_n"
|
|
341
|
+
return 0
|
|
342
|
+
}
|
|
343
|
+
|
|
261
344
|
mk_unknown() { # <repo> <shape>:造一个不认识的条目(nodir=没有 SKILL.md / othername=name 不符 / file=普通文件)
|
|
262
345
|
local p="$1" shape="$2" dest
|
|
263
346
|
dest="$p/.pi/skills/teamsmith"
|
|
@@ -441,48 +524,48 @@ chk_init_docs_fact() { # <tree>
|
|
|
441
524
|
return 0
|
|
442
525
|
}
|
|
443
526
|
|
|
444
|
-
chk_pack_manifest() { # <tree>:声明面 ——
|
|
527
|
+
chk_pack_manifest() { # <tree>:声明面 —— 唯一的 bin entry 是 team,files 带着 bin/
|
|
445
528
|
python3 - "$1/package.json" <<'PYMANI'
|
|
446
529
|
import json, sys
|
|
447
530
|
p = json.load(open(sys.argv[1]))
|
|
448
531
|
binmap = p.get("bin") or {}
|
|
449
532
|
files = p.get("files") or []
|
|
450
533
|
problems = []
|
|
451
|
-
#
|
|
452
|
-
#
|
|
453
|
-
|
|
534
|
+
# P378:0.3.2–0.3.3 把 pkill/killall/pgrep/pidof 加进 bin,`npm i -g` 于是在用户的全局 prefix/bin
|
|
535
|
+
# 里建这四个链接——Teamsmith 之外的一个普通终端敲 `pgrep -f …` 都会进闸门并 exit 64。闸门本来就由
|
|
536
|
+
# `team_tmux_shim_exports` 注入 PM/worker 窗口的 PATH,全局命令名一个都不需要(init-skill 规格:
|
|
537
|
+
# 「exactly one bin entry, team」)。
|
|
538
|
+
want = ["team"]
|
|
454
539
|
if list(binmap.keys()) != want:
|
|
455
|
-
problems.append("bin
|
|
540
|
+
problems.append("bin 键不是只有 team:%r" % (list(binmap.keys()),))
|
|
456
541
|
elif binmap["team"].lstrip("./") != "bin/team.mjs":
|
|
457
542
|
problems.append("bin.team 指向 %r(要 bin/team.mjs)" % binmap["team"])
|
|
458
|
-
else:
|
|
459
|
-
for name in ("pkill", "killall", "pgrep", "pidof"):
|
|
460
|
-
want_t = "skills/teamsmith/scripts/shim/" + name
|
|
461
|
-
if binmap.get(name, "").lstrip("./") != want_t:
|
|
462
|
-
problems.append("bin.%s 指向 %r(要 %s)" % (name, binmap.get(name), want_t))
|
|
463
543
|
if "bin/" not in files:
|
|
464
544
|
problems.append("files 白名单里没有 bin/:%r" % (files,))
|
|
465
545
|
if problems:
|
|
466
546
|
print(";".join(problems)); sys.exit(1)
|
|
467
|
-
print("bin
|
|
547
|
+
print("bin 只有 team→bin/team.mjs(四个信号入口不占全局命令名)+ files 带 bin/")
|
|
468
548
|
PYMANI
|
|
469
549
|
}
|
|
470
550
|
|
|
471
551
|
chk_pack_walk() { # <tree>:npm pack --dry-run 清单齐全且不含账本
|
|
472
552
|
local t="$1" json="$tmp/pack-walk.json"
|
|
473
553
|
( cd "$t" && npm pack --dry-run --json >"$json" 2>/dev/null ) || { printf 'npm pack --dry-run 失败\n'; return 1; }
|
|
474
|
-
python3 - "$json" <<'PYPACK'
|
|
554
|
+
python3 - "$json" "$(src_skill_names "$t" | tr '\n' ' ')" <<'PYPACK'
|
|
475
555
|
import json, sys
|
|
476
556
|
data = json.load(open(sys.argv[1]))
|
|
477
557
|
files = [f["path"] for f in data[0]["files"]]
|
|
478
|
-
|
|
558
|
+
names = sys.argv[2].split()
|
|
559
|
+
if not names:
|
|
560
|
+
print("源里一个技能都没找到"); sys.exit(1)
|
|
561
|
+
want = ["bin/team.mjs", "install.sh"] + ["skills/%s/SKILL.md" % n for n in names]
|
|
479
562
|
missing = [p for p in want if p not in files]
|
|
480
563
|
forbidden = [p for p in files if p.startswith(("docs/team/", ".pi/", "openspec/")) or "node_modules" in p]
|
|
481
564
|
if missing:
|
|
482
565
|
print("缺:" + "、".join(missing)); sys.exit(1)
|
|
483
566
|
if forbidden:
|
|
484
567
|
print("不该在包里:" + "、".join(forbidden[:3])); sys.exit(1)
|
|
485
|
-
print("清单齐全(%d
|
|
568
|
+
print("清单齐全(%d 项,含 %d 个技能的 SKILL.md)且不含账本/node_modules" % (len(files), len(names)))
|
|
486
569
|
PYPACK
|
|
487
570
|
}
|
|
488
571
|
|
|
@@ -501,16 +584,77 @@ chk_prefix_install() { # <tree>:npm 私有 prefix 安装后与 bash 入口一
|
|
|
501
584
|
if ! diff <("$prefix/bin/team" help 2>&1) <(bash "$t/skills/teamsmith/scripts/team" help 2>&1) >/dev/null; then
|
|
502
585
|
printf 'prefix 的 help 与 bash 入口不一致\n'; return 1
|
|
503
586
|
fi
|
|
587
|
+
# P378:npm 只应给 `team` 建链接 —— 四个信号入口靠窗口前缀注入,不能占用户的全局命令名。
|
|
588
|
+
chk_prefix_bin_scope "$prefix" || return 1
|
|
504
589
|
# P321:安装物还得带上信号闸门的四个入口。npm 的 tarball **不携带 120000 软链** —— 0.3.0 的包里
|
|
505
590
|
# pkill/killall/pgrep/pidof 四个名字全部缺失,装完全部落到 /usr/bin(docs/team/reviews/release-0.3.0.md)。
|
|
506
591
|
# 判据不看名字在不在:在**安装物**的 gated PATH 里用同名 argv 记录桩验拒绝/放行(不发任何信号)。
|
|
507
592
|
chk_prefix_signal_entries "$prefix" || return 1
|
|
508
|
-
printf '私有 prefix 安装后 version/help 与 bash
|
|
593
|
+
printf '私有 prefix 安装后 version/help 与 bash 入口一致;prefix/bin 只有 team;四个 shim 在包内且判定生效(%s/bin/team)\n' "$prefix"
|
|
594
|
+
return 0
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
chk_prefix_bin_scope() { # <prefix>:npm 只给 team 建链接;四个信号入口由窗口前缀注入,不占全局命令名
|
|
598
|
+
local prefix="$1" pkg skill shim t missing="" shadowed="" got sys notsys="" probe want_n ok_n val
|
|
599
|
+
pkg="$prefix/lib/node_modules/teamsmith"
|
|
600
|
+
skill="$pkg/skills/teamsmith"
|
|
601
|
+
shim="$skill/scripts/shim"
|
|
602
|
+
# ① 包里仍带着四个入口:撤掉的是 npm 的全局链接,不是闸门本身
|
|
603
|
+
for t in pkill killall pgrep pidof; do
|
|
604
|
+
[ -f "$shim/$t" ] && [ -x "$shim/$t" ] || missing="${missing:+$missing }$t"
|
|
605
|
+
done
|
|
606
|
+
if [ -n "$missing" ]; then
|
|
607
|
+
printf '安装包里没有可执行的信号闸门入口:%s\n' "$missing"; return 1
|
|
608
|
+
fi
|
|
609
|
+
# ② 用户的全局 prefix/bin 里只有 team
|
|
610
|
+
if [ ! -x "$prefix/bin/team" ]; then
|
|
611
|
+
printf '安装后 prefix/bin 里没有可执行的 team(实际:[%s])\n' "$(ls -1A "$prefix/bin" 2>/dev/null | tr '\n' ' ')"; return 1
|
|
612
|
+
fi
|
|
613
|
+
for t in pkill killall pgrep pidof; do
|
|
614
|
+
if [ -e "$prefix/bin/$t" ] || [ -L "$prefix/bin/$t" ]; then shadowed="${shadowed:+$shadowed }$t"; fi
|
|
615
|
+
done
|
|
616
|
+
if [ -n "$shadowed" ]; then
|
|
617
|
+
printf '安装后 prefix/bin 里有 %s —— npm 又把信号闸门做成了全局命令(Teamsmith 之外的普通终端敲这些名字会进闸门、exit 64);它们只应由 team_tmux_shim_exports 注入 PM/worker 窗口的 PATH\n' "$shadowed"
|
|
618
|
+
return 1
|
|
619
|
+
fi
|
|
620
|
+
# ③ 普通 shell:prefix/bin 放在 PATH 最前,pkill/pgrep 仍解析到系统可执行(不是包内 shim)
|
|
621
|
+
for t in pkill pgrep; do
|
|
622
|
+
got="$(PATH="$prefix/bin:/usr/bin:/bin" command -v "$t" 2>/dev/null)"
|
|
623
|
+
sys="$(PATH=/usr/bin:/bin command -v "$t" 2>/dev/null)"
|
|
624
|
+
case "$got" in
|
|
625
|
+
"$pkg"/*|"$prefix"/*)
|
|
626
|
+
printf '普通 shell 里 %s 解析到安装包内 [%s] —— 全局遮蔽还在\n' "$t" "$got"; return 1 ;;
|
|
627
|
+
esac
|
|
628
|
+
if [ -n "$sys" ] && [ "$got" != "$sys" ]; then
|
|
629
|
+
printf '普通 shell 里 %s 解析到 [%s],不是系统可执行 [%s]\n' "$t" "${got:-<解析不出>}" "$sys"; return 1
|
|
630
|
+
fi
|
|
631
|
+
[ -n "$sys" ] || notsys="${notsys:+$notsys }$t"
|
|
632
|
+
done
|
|
633
|
+
# ④ 管理会话:窗口前缀(team_tmux_shim_exports)仍把四个名字解析到包内的 shim
|
|
634
|
+
probe="$(env -u TEAM_ROOT -u TEAM_MAIN_ROOT -u TEAM_PROJECT -u TEAM_SESSION \
|
|
635
|
+
TEAM_SKILL_DIR="$skill" TEAM_STATE_DIR="$tmp/managed-session-state" bash -c '
|
|
636
|
+
. "$1/skills/teamsmith/scripts/lib/common.sh"
|
|
637
|
+
eval "$(team_tmux_shim_exports)"
|
|
638
|
+
for t in pkill killall pgrep pidof; do printf "%s=%s\n" "$t" "$(command -v "$t" 2>/dev/null)"; done
|
|
639
|
+
' _ "$pkg" 2>&1)" || {
|
|
640
|
+
printf '从安装包渲染 team_tmux_shim_exports 失败:%s\n' "$(printf '%s' "$probe" | tail -2 | tr '\n' ' ')"; return 1
|
|
641
|
+
}
|
|
642
|
+
want_n=0; ok_n=0
|
|
643
|
+
for t in pkill killall pgrep pidof; do
|
|
644
|
+
want_n=$((want_n + 1))
|
|
645
|
+
val="$(printf '%s\n' "$probe" | sed -n "s/^$t=//p")"
|
|
646
|
+
if [ "$val" = "$shim/$t" ]; then ok_n=$((ok_n + 1)); else
|
|
647
|
+
printf '窗口前缀下 %s 解析到 [%s],不是包内 shim [%s]\n' "$t" "${val:-<解析不出>}" "$shim/$t"
|
|
648
|
+
fi
|
|
649
|
+
done
|
|
650
|
+
[ "$ok_n" -eq "$want_n" ] || return 1
|
|
651
|
+
printf 'prefix/bin 只有 team;普通 shell 的 pkill/pgrep 仍是系统可执行%s;窗口前缀把四个名字解析回包内 shim\n' \
|
|
652
|
+
"${notsys:+(本机没有系统的 $notsys,只断言「不是包内入口」)}"
|
|
509
653
|
return 0
|
|
510
654
|
}
|
|
511
655
|
|
|
512
656
|
chk_prefix_signal_entries() { # <prefix>:安装物的 pkill/killall/pgrep/pidof 在、解析到安装目录、判定生效
|
|
513
|
-
local prefix="$1" shim backends stub wlog log t form out rc line fargs missing=""
|
|
657
|
+
local prefix="$1" shim backends stub wlog log t form out rc line fargs missing=""
|
|
514
658
|
shim="$prefix/lib/node_modules/teamsmith/skills/teamsmith/scripts/shim"
|
|
515
659
|
backends="$tmp/prefix-signal-backends"; rm -rf "$backends"; mkdir -p "$backends"
|
|
516
660
|
stub="$backends/.witness"
|
|
@@ -529,28 +673,8 @@ WITNESS
|
|
|
529
673
|
if [ -n "$missing" ]; then
|
|
530
674
|
printf '安装包没有携带信号闸门入口(npm 丢 120000 软链的历史形状):%s\n' "$missing"; return 1
|
|
531
675
|
fi
|
|
532
|
-
#
|
|
533
|
-
#
|
|
534
|
-
# 闸门在 npm 路线上等于不存在;而上面两条断言只查了「包内文件在不在」,两次复验都没抓住。
|
|
535
|
-
# 这里补的正是那个缺失的证伪者:装完必须在 prefix/bin 里解析到**这个包的**那个 shim。
|
|
536
|
-
# 两类形状分开判、一起点名(P360 红侧实测:`readlink -f` 对不存在的最后一级会原样吐出路径而不是空,
|
|
537
|
-
# 所以「在不在」必须先自己判,否则「bin 字段没列它们」那条永远打不出来;判据是解析到**这个包的**那个 shim,
|
|
538
|
-
# 所以指向包外、指向包内别的文件、悬空软链都落进 foreign)。
|
|
539
|
-
local miss_bin="" foreign=""
|
|
540
|
-
for t in pkill killall pgrep pidof; do
|
|
541
|
-
link="$prefix/bin/$t"
|
|
542
|
-
want="$(readlink -f "$shim/$t" 2>/dev/null || true)"
|
|
543
|
-
if [ ! -e "$link" ] && [ ! -L "$link" ]; then miss_bin="${miss_bin:+$miss_bin }$t"; continue; fi
|
|
544
|
-
resolved="$(readlink -f "$link" 2>/dev/null || true)"
|
|
545
|
-
[ "$resolved" = "$want" ] && continue
|
|
546
|
-
foreign="${foreign:+$foreign }$t→[${resolved:-<解析不出>}](要 $want)"
|
|
547
|
-
done
|
|
548
|
-
if [ -n "$miss_bin" ]; then
|
|
549
|
-
printf '安装后 prefix/bin 里没有 %s —— npm 没为这些名字建链接(bin 字段没列它们,或列的目标不是包内文件);用户敲这些名字会落到 /usr/bin\n' "$miss_bin"; return 1
|
|
550
|
-
fi
|
|
551
|
-
if [ -n "$foreign" ]; then
|
|
552
|
-
printf '安装后 prefix/bin 的入口没有落在包内 shim:%s\n' "$foreign"; return 1
|
|
553
|
-
fi
|
|
676
|
+
# P378:这里**不再**要求 prefix/bin 里有这四个链接(那正是要撤掉的全局遮蔽);链接形状由
|
|
677
|
+
# chk_prefix_bin_scope 反向钉住。本函数只证明「包里的闸门文件还在、判定没被削弱」。
|
|
554
678
|
for t in pkill killall pgrep pidof; do
|
|
555
679
|
line="$(PATH="$shim:$backends:/usr/bin:/bin" command -v "$t" 2>/dev/null)"
|
|
556
680
|
if [ "$line" != "$shim/$t" ]; then
|
|
@@ -674,9 +798,13 @@ if want install; then
|
|
|
674
798
|
p="$tmp/p-link"; git_new "$p"; assert_isolated "$tree" "$p"
|
|
675
799
|
out="$(init_proj "$tree" "$p")"; rc=$?
|
|
676
800
|
assert_eq "init 退出码 0" "$rc" "0"
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
801
|
+
n_src="$(src_skill_names "$tree" | wc -l | tr -d ' ')"
|
|
802
|
+
[ "$n_src" -ge 3 ] || fail_setup "源里只找到 $n_src 个技能(期望至少 teamsmith / teamsmith-init / handover 三个):$(src_skill_names "$tree" | tr '\n' ' ')"
|
|
803
|
+
assert_eq "输出逐 skill 一条 link 行(源里 $n_src 个技能:$(src_skill_names "$tree" | tr '\n' ' '))" \
|
|
804
|
+
"$(printf '%s' "$out" | grep -cE '^ link .*/\.pi/skills/[A-Za-z0-9._-]+ → ' || true)" "$n_src"
|
|
805
|
+
while IFS= read -r s_name; do
|
|
806
|
+
assert_link_to "$p/.pi/skills/$s_name" "$tree/skills/$s_name" ".pi/skills/$s_name 是指向源 $s_name 的软链"
|
|
807
|
+
done < <(src_skill_names "$tree")
|
|
680
808
|
# P59:装完打一行信任提示(.pi/skills/ 是 Pi 的信任资源 → 第一次跑 pi 会问;三条出路)
|
|
681
809
|
check_holds "P59 装完一行信任提示(触发资源 + 三条出路)" chk_trust_hint "$out"
|
|
682
810
|
case "$out" in *"link $p/.pi/skills/teamsmith → $tree/skills/teamsmith"*) ok "link 行是逐 skill 一行(含目标与源)" ;;
|
|
@@ -689,7 +817,8 @@ if want install; then
|
|
|
689
817
|
assert_eq "第二次 init 后目标不变" "$(readlink -f "$p/.pi/skills/teamsmith")" "$t1"
|
|
690
818
|
assert_eq "第二次 init 后兄弟目标不变" "$(readlink -f "$p/.pi/skills/teamsmith-init")" "$t2"
|
|
691
819
|
check_holds "P59 重跑(skip)仍然打那一行" chk_trust_hint "$out2"
|
|
692
|
-
assert_eq ".pi/skills/
|
|
820
|
+
assert_eq ".pi/skills/ 里的名字与源清单一致($n_src 个:$(src_skill_names "$tree" | tr '\n' ' '))" \
|
|
821
|
+
"$(ls -1A "$p/.pi/skills" | sort | tr '\n' ' ')" "$(src_skill_names "$tree" | tr '\n' ' ')"
|
|
693
822
|
out3="$(init_proj "$tree" "$p" --copy)"; rc3=$?
|
|
694
823
|
assert_eq "--copy 对着已有软链退出 0(skip,不是覆盖)" "$rc3" "0"
|
|
695
824
|
assert_eq "--copy 后仍是同一软链目标" "$(readlink -f "$p/.pi/skills/teamsmith")" "$t1"
|
|
@@ -716,6 +845,14 @@ if want install; then
|
|
|
716
845
|
assert_not_file "$p/.pi/skills/teamsmith/scripts/panel/node_modules" "--copy 排除了 node_modules/"
|
|
717
846
|
assert_not_file "$p/.pi/skills/teamsmith/.git" "--copy 排除了 .git/"
|
|
718
847
|
assert_not_file "$p/.pi/skills/teamsmith-init/scripts/panel/node_modules" "--copy 的兄弟条目也排除 node_modules/"
|
|
848
|
+
# P361:每个源技能都得是「真目录 + 逐字节 + 自己认得出自己」(判定入口是 SKILL.md 的 name:)
|
|
849
|
+
for s_name in $(src_skill_names "$tree"); do
|
|
850
|
+
[ -d "$p/.pi/skills/$s_name" ] && [ ! -L "$p/.pi/skills/$s_name" ] \
|
|
851
|
+
&& ok "--copy 的 $s_name 是真目录(不是软链)" || bad "--copy 的 $s_name 不是真目录"
|
|
852
|
+
assert_eq "--copy 的 $s_name/SKILL.md 与源逐字节相等" \
|
|
853
|
+
"$(cmp -s "$tree/skills/$s_name/SKILL.md" "$p/.pi/skills/$s_name/SKILL.md" && echo same || echo differ)" "same"
|
|
854
|
+
assert_eq "--copy 的 $s_name/SKILL.md 的 name: 等于目录名" "$(skill_md_name_of "$p/.pi/skills/$s_name")" "$s_name"
|
|
855
|
+
done
|
|
719
856
|
|
|
720
857
|
# ④ linked worktree:装到主工作树,不装到 worktree
|
|
721
858
|
p="$tmp/p-wt"; git_new "$p"; init_proj "$tree" "$p" --no-skills >/dev/null
|
|
@@ -801,9 +938,9 @@ if want pack; then
|
|
|
801
938
|
if ! command -v npm >/dev/null 2>&1; then
|
|
802
939
|
skip "本机没有 npm:打包清单与 prefix 安装都跳过(可见 SKIP,不是静默通过)"
|
|
803
940
|
else
|
|
804
|
-
check_holds "声明面:
|
|
805
|
-
check_holds "打包清单:bin/team.mjs +
|
|
806
|
-
check_holds "私有 prefix 安装:version/help
|
|
941
|
+
check_holds "声明面:bin 只有 team→bin/team.mjs + files 带 bin/" chk_pack_manifest "$tree"
|
|
942
|
+
check_holds "打包清单:bin/team.mjs + 每个源的 SKILL.md + install.sh,不含账本" chk_pack_walk "$tree"
|
|
943
|
+
check_holds "私有 prefix 安装:version/help 一致、prefix/bin 不遮蔽信号命令、包内 shim 仍生效" chk_prefix_install "$tree"
|
|
807
944
|
fi
|
|
808
945
|
fi
|
|
809
946
|
|
|
@@ -992,13 +1129,25 @@ PYPACKF
|
|
|
992
1129
|
ft="$tmp/f-pack2"; scratch_tree "$ft"; rm -f "$ft/bin/team.mjs"
|
|
993
1130
|
check_holds "⑤b 对照:真实树打包清单齐全" chk_pack_walk "$tree"
|
|
994
1131
|
check_breaks "⑤b 翻转:bin 目标文件不在(package 不完整)" chk_pack_walk "$ft"
|
|
1132
|
+
# ⑤c P378:把四个信号入口加回 bin → npm 又在全局 prefix/bin 里遮蔽这四个命令,安装判据必须红
|
|
1133
|
+
ft="$tmp/f-pack-bin-global"; scratch_tree "$ft"
|
|
1134
|
+
python3 - "$ft/package.json" <<'PYPACKBIN'
|
|
1135
|
+
import json, sys
|
|
1136
|
+
p = sys.argv[1]
|
|
1137
|
+
d = json.load(open(p))
|
|
1138
|
+
for name in ("pkill", "killall", "pgrep", "pidof"):
|
|
1139
|
+
d["bin"][name] = "./skills/teamsmith/scripts/shim/" + name
|
|
1140
|
+
json.dump(d, open(p, "w"), indent=2)
|
|
1141
|
+
PYPACKBIN
|
|
1142
|
+
check_holds "⑤c 对照:真实树安装后 prefix/bin 只有 team,普通 shell 的 pkill/pgrep 仍是系统可执行" chk_prefix_install "$tree"
|
|
1143
|
+
check_breaks "⑤c 翻转:四个信号入口加回 bin(npm 又全局遮蔽这四个命令)" chk_prefix_install "$ft"
|
|
995
1144
|
# ⑥ P321:把四个信号入口改回 0.3.0 的软链形状 —— npm 的 tarball 丢掉它们,安装判据必须红
|
|
996
1145
|
ft="$tmp/f-pack-symlink"; scratch_tree "$ft"
|
|
997
1146
|
for _fs in pkill killall pgrep pidof; do
|
|
998
1147
|
rm -f "$ft/skills/teamsmith/scripts/shim/$_fs"
|
|
999
1148
|
ln -s signal-gate "$ft/skills/teamsmith/scripts/shim/$_fs"
|
|
1000
1149
|
done
|
|
1001
|
-
check_holds "⑥
|
|
1150
|
+
check_holds "⑥ 对照:真实树的安装物带着四个可执行信号入口且判定生效" chk_prefix_install "$tree"
|
|
1002
1151
|
check_breaks "⑥ 翻转:入口退回 0.3.0 的软链形状(npm 的 tarball 不携带软链)" chk_prefix_install "$ft"
|
|
1003
1152
|
fi
|
|
1004
1153
|
# ⑦ P59:安装步的信任提示行 —— 去掉它 → 判据红;让它在 --no-skills 下出现 → 判据红
|
|
@@ -1097,6 +1246,45 @@ PYEXT
|
|
|
1097
1246
|
pf="$tmp/f-ext-doctor-red"; git_new "$pf"; init_proj "$ft" "$pf" >/dev/null 2>&1; rm -f "$pf/.pi/extensions/team.ts"
|
|
1098
1247
|
check_holds "⑧b 对照:真实树报扩展缺失" chk_ext_doctor_missing "$tree" "$pg"
|
|
1099
1248
|
check_breaks "⑧b 翻转:/team 的 doctor 行被静默" chk_ext_doctor_missing "$ft" "$pf"
|
|
1249
|
+
# ⑩ P361:源的 frontmatter name 与目录名不符 → 安装必须红并**点名**(读数 4 的红侧①)
|
|
1250
|
+
ft="$tmp/f-skill-name"; scratch_tree "$ft"
|
|
1251
|
+
python3 - "$ft/skills/handover/SKILL.md" <<'PYNAME'
|
|
1252
|
+
import sys
|
|
1253
|
+
p = sys.argv[1]
|
|
1254
|
+
s = open(p, encoding='utf-8').read()
|
|
1255
|
+
if "\nname: handover\n" not in s:
|
|
1256
|
+
print("handover/SKILL.md 里找不到 name: handover"); sys.exit(1)
|
|
1257
|
+
open(p, "w", encoding="utf-8").write(s.replace("\nname: handover\n", "\nname: handover-x\n", 1))
|
|
1258
|
+
PYNAME
|
|
1259
|
+
pg="$tmp/f-skill-name-green"; git_new "$pg"
|
|
1260
|
+
pf="$tmp/f-skill-name-red"; git_new "$pf"
|
|
1261
|
+
check_holds "⑩ 对照:真实树的源都合法、全部装上" chk_skill_sources_ok "$tree" "$pg"
|
|
1262
|
+
check_breaks "⑩ 翻转:handover 的 name: 改成 handover-x" chk_skill_sources_ok "$ft" "$pf"
|
|
1263
|
+
check_holds "⑩ 红侧点名:非 0 且点名源目录与错名字" chk_skill_bad_name_reported "$ft" "$pf"
|
|
1264
|
+
# ⑪ P361:源里整个少一个技能 → 不崩(rc=0),并且**可见地**说出少了一个(读数 4 的红侧②)
|
|
1265
|
+
ft="$tmp/f-skill-missing"; scratch_tree "$ft"; rm -rf "$ft/skills/handover"
|
|
1266
|
+
pg="$tmp/f-skill-missing-green"; git_new "$pg"
|
|
1267
|
+
pf="$tmp/f-skill-missing-red"; git_new "$pf"
|
|
1268
|
+
check_holds "⑪ 对照:真实树没有 miss 行" chk_skill_sources_ok "$tree" "$pg"
|
|
1269
|
+
check_breaks "⑪ 翻转:源里删掉 handover 整个目录" chk_skill_sources_ok "$ft" "$pf"
|
|
1270
|
+
check_holds "⑪ 红侧点名:rc=0 且可见地说少了 handover" chk_skill_missing_reported "$ft" "$pf"
|
|
1271
|
+
# ⑫ P361:声明面漏登记 → 源里的技能**照装**,但必须喊出来(未登记分支的抗体;V93 实测它原先没人钉)
|
|
1272
|
+
ft="$tmp/f-skill-unregistered"; scratch_tree "$ft"
|
|
1273
|
+
python3 - "$ft/skills/teamsmith/scripts/lib/cmd-init.sh" <<'PYDECL'
|
|
1274
|
+
import sys
|
|
1275
|
+
p = sys.argv[1]
|
|
1276
|
+
s = open(p, encoding='utf-8').read()
|
|
1277
|
+
old = "team_skill_declared() { printf '%s\\n' teamsmith teamsmith-init handover; return 0; }"
|
|
1278
|
+
if old not in s:
|
|
1279
|
+
print("声明面形状变了,夹具需要跟着改:" + repr([l for l in s.splitlines() if "team_skill_declared()" in l]))
|
|
1280
|
+
sys.exit(1)
|
|
1281
|
+
open(p, "w", encoding="utf-8").write(s.replace(old, old.replace(" handover;", ";"), 1))
|
|
1282
|
+
PYDECL
|
|
1283
|
+
pg="$tmp/f-skill-unregistered-green"; git_new "$pg"
|
|
1284
|
+
pf="$tmp/f-skill-unregistered-red"; git_new "$pf"
|
|
1285
|
+
check_holds "⑫ 对照:真实树声明面完整、没有 note 行" chk_skill_no_note "$tree" "$pg"
|
|
1286
|
+
check_breaks "⑫ 翻转:声明面删掉 handover(源里还有)" chk_skill_no_note "$ft" "$pf"
|
|
1287
|
+
check_holds "⑫ 红侧点名:rc=0 且可见地说 handover 未登记、照装" chk_skill_unregistered_reported "$ft" "$pf"
|
|
1100
1288
|
# ⑥ 真实树没被夹具动过:git status 指纹前后一致
|
|
1101
1289
|
porcelain_after="$(cd "$tree" && git status --porcelain | sha256sum)"
|
|
1102
1290
|
assert_eq "⑥ 夹具没碰真实树(git status 指纹不变)" "$porcelain_after" "$porcelain_before"
|
|
@@ -511,11 +511,15 @@ fi
|
|
|
511
511
|
if want flip-drop-pm; then
|
|
512
512
|
section "flip F-A · 从 known 里去掉独立 PM 模型 → known 断言必须红且点名独立 PM;恢复 → 绿"
|
|
513
513
|
ft="$tmp/flip-drop-pm"
|
|
514
|
+
# P367:flip 树是**源技能目录的整份拷贝**(照源派生),不再手写拷贝清单 —— 清单已经漏过两次:
|
|
515
|
+
# P315 漏 extension/、P361 之后 `team init` 又要求技能源带 SKILL.md 且 frontmatter name 与目录名
|
|
516
|
+
# 一致(`cmd-init.sh:76`,拒绝在 `:307/:313`)。两次的形状一样:清单落后于 init 的要求 → init 先拒源,
|
|
517
|
+
# F-A/F-D 想看的诊断根本没机会出现,红侧变假红。整份拷贝之后,翻转只在副本里改要翻的那个文件。
|
|
518
|
+
# 目标目录**先建**、源写成 `"$skill/."`:拷进来的必须是**真目录**(`cp -a "$skill" dir/` 在 $skill 是
|
|
519
|
+
# 软链时会把软链原样搬过来,随后 python 补丁就顺着软链写进真树 —— P367 用软链变体树做过一次红侧,
|
|
520
|
+
# 实测就是这么把真树的 cmd-config.sh 改脏的)。
|
|
514
521
|
mkdir -p "$ft/skills/teamsmith"
|
|
515
|
-
cp -a "$skill
|
|
516
|
-
# P315:`team init` 现在要装 `/team` 扩展(源 = <skill>/extension/team.ts),夹具的拷贝集合要跟上;
|
|
517
|
-
# 少拷一层时 `new_proj` 里的 init 直接退出、走查拿不到结论,红侧就是假红。
|
|
518
|
-
cp -a "$skill/templates" "$skill/references" "$skill/extension" "$ft/skills/teamsmith/"
|
|
522
|
+
cp -a "$skill/." "$ft/skills/teamsmith/"
|
|
519
523
|
python3 - "$ft/skills/teamsmith/scripts/lib/cmd-config.sh" <<'PYPATCH'
|
|
520
524
|
import sys
|
|
521
525
|
p = sys.argv[1]
|
|
@@ -553,10 +557,10 @@ fi
|
|
|
553
557
|
if want flip-suggest; then
|
|
554
558
|
section "flip F-D · 建议值落在最小之外(30 < 60)→ 走查必须红且点名;恢复 → 绿"
|
|
555
559
|
ft="$tmp/flip-suggest"
|
|
560
|
+
# P367:与 F-A 同理 —— 整份拷贝源技能目录(含 SKILL.md),不维护第二份拷贝清单;目标目录先建,
|
|
561
|
+
# 保证翻转树里是真目录(理由见 F-A 那段)。
|
|
556
562
|
mkdir -p "$ft/skills/teamsmith"
|
|
557
|
-
cp -a "$skill
|
|
558
|
-
# P315:与 F-A 同理 —— `team init` 要 extension/team.ts 才能装完,少拷一层就是夹具坏掉(走查 rc=3)。
|
|
559
|
-
cp -a "$skill/templates" "$skill/references" "$skill/extension" "$ft/skills/teamsmith/"
|
|
563
|
+
cp -a "$skill/." "$ft/skills/teamsmith/"
|
|
560
564
|
flip_cfg="$ft/skills/teamsmith/scripts/lib/cmd-config.sh"
|
|
561
565
|
cp -a "$cmd_config" "$flip_cfg"
|
|
562
566
|
python3 - "$flip_cfg" <<'PY'
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
15b 15b · 必需依赖:doctor 三态 + paths + dispatch 预检 skills/teamsmith/SKILL.md skills/teamsmith/references skills/teamsmith/references/* skills/teamsmith/templates skills/teamsmith/templates/* skills/teamsmith/scripts/lib/cmd-agents.sh skills/teamsmith/scripts/lib/cmd-project.sh skills/teamsmith/scripts/team 2,3b,5 段内点名 4 条真实路径 token;段内调用 team dispatch/doctor/paths
|
|
85
85
|
15c 15c · harness 与插件清单:只告知、不推荐(M29) README.md skills/teamsmith/scripts/team skills/teamsmith/SKILL.md skills/teamsmith/references skills/teamsmith/references/* skills/teamsmith/templates skills/teamsmith/templates/* skills/teamsmith/scripts/lib skills/teamsmith/scripts/lib/* skills/teamsmith-init/SKILL.md skills/teamsmith/references/troubleshooting.md skills/teamsmith/references/workflows.md - 段内点名 14 条真实路径 token
|
|
86
86
|
12 12 · roster / status / ps skills/teamsmith/scripts/lib/cmd-status.sh skills/teamsmith/scripts/lib/cmd-watch.sh skills/teamsmith/scripts/team 4 段内调用 team digest/paths/ps/pulse/roster/up
|
|
87
|
-
13 13 · notify 扩展(去重 + 只在 worktree 触发) skills/teamsmith/extension/team-notify.ts 2 段内点名 1 条真实路径 token;P117/V2 逐键审计:补 {2} 后该键的选集 ✗0(缺时该键红;口径见 tests/section-needs-audit.sh
|
|
87
|
+
13 13 · notify 扩展(去重 + 只在 worktree 触发) skills/teamsmith/extension/team-notify.ts 2,5 段内点名 1 条真实路径 token;P117/V2 逐键审计:补 {2} 后该键的选集 ✗0(缺时该键红;口径见 tests/section-needs-audit.sh);P367:再补 {5} —— §13 的夹具读 §5 add-agent 建的 .worktrees/dev,缺 5 时 `--select 13` 的收口是 ✗ 且逐键审计判 bad 13(两者一致为红),补后两者一致为绿
|
|
88
88
|
13b 13b · 通知只代表「回合结束」(M4.3 E:内部生命周期不得被广播成交付) skills/teamsmith/extension/team-notify.ts 2 段内点名 1 条真实路径 token;P117/V2 逐键审计:补 {2} 后该键的选集 ✗0(缺时该键红;口径见 tests/section-needs-audit.sh)
|
|
89
89
|
13c 13c · 团队后台车道(M27/M30):拉起链注入 / 收割契约 / 账本 / worktree 侧 skills/teamsmith/scripts/lib/cmd-agents.sh skills/teamsmith/extension/team-bg.ts skills/teamsmith/tests/team-bg-harness.mjs skills/teamsmith/tests/bg-ledger.sh skills/teamsmith/tests/bg-ledger-harness.mjs skills/teamsmith/templates/AGENTS.section.md.tmpl skills/teamsmith/templates/pm-prompt.md.tmpl skills/teamsmith/references/protocol.md skills/teamsmith/references/workflows.md 6i,6f P237 §4.3:本段折叠 A 刀的 wording/ledger 两组(bg-ledger 入口),并按 long-job-suspend 的 dispatch delta 四条场景钉住提示词 / AGENTS 模板 / protocol / workflows §E2 与 PM 模板的三态口径——改这些面都要重跑本段;P251:bg-ledger-harness.mjs 也是本段的夹具本体(turn-notice-merge 的 merge/detail/wake 三组与十一个写入面红侧)
|
|
90
90
|
12b 12b · 延后投递与草稿入口(delivery-guard:守卫 / 队列 / 排水 / 草稿) skills/teamsmith/tests/guard-matrix.sh skills/teamsmith/scripts/lib/cmd-status.sh skills/teamsmith/scripts/lib/cmd-draft.sh skills/teamsmith/scripts/lib/cmd-agents.sh skills/teamsmith/scripts/lib/cmd-outbox.sh skills/teamsmith/scripts/lib/cmd-watch.sh skills/teamsmith/scripts/team skills/teamsmith/scripts/lib/outbox.sh 5 段内点名 1 条真实路径 token;段内调用 team digest/draft/notify/outbox/paths/say/status/watch;另声明:该段驱动/断言 outbox 投递路径|needs:5(say 要名册里有 dev,12b-c 实测)
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
12b-h0b 12b-h0b · M45 输入框判据:pi 的更新横幅(整行 ─ 与框边框同形等宽) skills/teamsmith/tests/frames skills/teamsmith/tests/frames/* skills/teamsmith/scripts/lib/common.sh skills/teamsmith/scripts/lib/outbox.sh - 段内点名 3 条真实路径 token
|
|
93
93
|
12b-h0d 12b-h0d · P80 下边框判据:最低的合格规则行(草稿自己的框线留在框内) skills/teamsmith/tests/frames skills/teamsmith/tests/frames/* skills/teamsmith/scripts/lib/common.sh skills/teamsmith/scripts/lib/outbox.sh skills/teamsmith/tests/lib/box-judge.sh skills/teamsmith/tests/pm-box-real.sh skills/teamsmith/tests skills/teamsmith/tests/* - 段内点名 8 条真实路径 token;P238 坑 3 复核:保留 `skills/teamsmith/tests/*` —— 段内用 `grep -rln … "$SKILL_DIR/tests"` 递归扫整棵 tests 树找第二份几何实现,任何新增测试文件都可能在扫描面内
|
|
94
94
|
12b-h0c 12b-h0c · P59 输入框判据:覆盖层(Pi 的项目信任弹窗)≠ 非空输入框 skills/teamsmith/tests/pm-box-real.sh skills/teamsmith/tests/frames/pi-0.87.0-project-trust-prompt.txt skills/teamsmith/tests/fake-tui.py skills/teamsmith/extension/team-notify.ts skills/teamsmith/scripts/lib/cmd-status.sh skills/teamsmith/scripts/lib/cmd-draft.sh skills/teamsmith/scripts/lib/cmd-agents.sh skills/teamsmith/scripts/lib/cmd-outbox.sh skills/teamsmith/scripts/lib/cmd-watch.sh skills/teamsmith/scripts/team skills/teamsmith/scripts/lib/outbox.sh 12b 段内点名 6 条真实路径 token;段内调用 team digest/draft/notify/outbox/say/watch;另声明:该段驱动/断言 outbox 投递路径|needs:12b(12b-i 复用 12b 的 outbox 夹具现场,实测)
|
|
95
|
-
12b-pi 12b-pi · M30 投递换道:pi 通道零 tmux 粘贴(收件箱监视唤醒) skills/teamsmith/extension/team-inbox-watch.ts skills/teamsmith/tests/team-inbox-watch-harness.mjs skills/teamsmith/scripts/lib/cmd-draft.sh skills/teamsmith/scripts/lib/cmd-agents.sh skills/teamsmith/scripts/team skills/teamsmith/scripts/lib/outbox.sh 6i,12b 段内点名 4 条真实路径 token;段内调用 team draft/notify/say;另声明:该段驱动/断言 outbox 投递路径|needs:12b(12b-pi 的 spool/投递现场接在 12b 之后,实测)
|
|
95
|
+
12b-pi 12b-pi · M30 投递换道:pi 通道零 tmux 粘贴(收件箱监视唤醒) skills/teamsmith/extension/team-inbox-watch.ts skills/teamsmith/tests/team-inbox-watch-harness.mjs skills/teamsmith/scripts/lib/cmd-draft.sh skills/teamsmith/scripts/lib/cmd-agents.sh skills/teamsmith/scripts/team skills/teamsmith/scripts/lib/outbox.sh skills/teamsmith/tests/team-notify-knock-marker.mjs skills/teamsmith/extension/team-notify.ts 6i,12b 段内点名 4 条真实路径 token;段内调用 team draft/notify/say;另声明:该段驱动/断言 outbox 投递路径|needs:12b(12b-pi 的 spool/投递现场接在 12b 之后,实测)
|
|
96
96
|
12b-pi2 12b-pi2 · M46 投递降级可见(skip 留痕)与慢路径自愈(残留/目标消失) skills/teamsmith/scripts/lib/cmd-project.sh skills/teamsmith/scripts/lib/cmd-outbox.sh skills/teamsmith/scripts/lib/cmd-agents.sh skills/teamsmith/scripts/lib/cmd-status.sh skills/teamsmith/scripts/team skills/teamsmith/scripts/lib/outbox.sh 12b-pi 段内调用 team doctor/outbox/say/status;另声明:该段驱动/断言 outbox 投递路径
|
|
97
97
|
12b-pi3 12b-pi3 · M53 降级通道可见(watch-degraded:doctor/status/面板 + inotify 余量) skills/teamsmith/scripts/lib/cmd-project.sh skills/teamsmith/scripts/lib/cmd-watch.sh skills/teamsmith/scripts/lib/cmd-status.sh skills/teamsmith/scripts/team skills/teamsmith/scripts/lib/outbox.sh 12b,12b-pi 段内调用 team doctor/monitor/status;另声明:该段驱动/断言 outbox 投递路径
|
|
98
98
|
14 14 · teardown skills/teamsmith/scripts/lib/cmd-agents.sh skills/teamsmith/scripts/team - 段内调用 team teardown
|
|
@@ -11,7 +11,7 @@ import { fileURLToPath } from 'node:url'
|
|
|
11
11
|
|
|
12
12
|
const here = dirname(fileURLToPath(import.meta.url))
|
|
13
13
|
const skillDir = resolve(process.argv[2] ?? join(here, '..'))
|
|
14
|
-
// P16
|
|
14
|
+
// P16 拆分起,skills/ 下的每个 skill 共用这份加载器:期望的 name 就是目录名(teamsmith / teamsmith-init / handover)。
|
|
15
15
|
const expectedName = basename(skillDir)
|
|
16
16
|
|
|
17
17
|
const candidates = [
|
|
@@ -44,7 +44,11 @@ const skill = result.skills[0]
|
|
|
44
44
|
if (skill) {
|
|
45
45
|
if (skill.name !== expectedName) problems.push(`name 不是 ${expectedName}:${skill.name}`)
|
|
46
46
|
if (!skill.description || skill.description.length > 1024) problems.push(`description 长度非法或缺失`)
|
|
47
|
-
|
|
47
|
+
// P361:路由词汇必须先点名技能自己 —— 换成泛用关键词表(teamsmith|多 Agent|团队)会把 handover
|
|
48
|
+
// 这类兄弟 skill 判死;「描述里有自己的名字」对每个技能都成立,且改名忘改描述时会红。
|
|
49
|
+
if (!skill.description.includes(expectedName)) {
|
|
50
|
+
problems.push(`description 没有点名技能自己(${expectedName}):调用者靠这段描述路由`)
|
|
51
|
+
}
|
|
48
52
|
if (!skill.baseDir) problems.push('缺少 baseDir(相对路径无法解析)')
|
|
49
53
|
}
|
|
50
54
|
if (result.diagnostics.length) problems.push(...result.diagnostics.map(d => `诊断:${JSON.stringify(d)}`))
|