teamsmith 0.3.3 → 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.
Files changed (32) hide show
  1. package/README.md +4 -4
  2. package/package.json +2 -6
  3. package/skills/teamsmith/CHANGELOG.md +47 -0
  4. package/skills/teamsmith/SKILL.md +1 -1
  5. package/skills/teamsmith/extension/team-inbox-watch.ts +30 -1
  6. package/skills/teamsmith/extension/team-notify.ts +161 -20
  7. package/skills/teamsmith/references/agent-adapters.md +3 -1
  8. package/skills/teamsmith/references/config.md +1 -1
  9. package/skills/teamsmith/references/protocol.md +21 -0
  10. package/skills/teamsmith/references/troubleshooting.md +7 -3
  11. package/skills/teamsmith/scripts/lib/cmd-agents.sh +213 -19
  12. package/skills/teamsmith/scripts/lib/cmd-config.sh +1 -1
  13. package/skills/teamsmith/scripts/lib/cmd-status.sh +177 -21
  14. package/skills/teamsmith/scripts/lib/cmd-watch.sh +11 -1
  15. package/skills/teamsmith/scripts/lib/common.sh +7 -3
  16. package/skills/teamsmith/scripts/lib/outbox.sh +31 -3
  17. package/skills/teamsmith/scripts/panel/panel.js +1 -1
  18. package/skills/teamsmith/scripts/panel/src/strings/en.ts +1 -1
  19. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +1 -1
  20. package/skills/teamsmith/scripts/team +1 -0
  21. package/skills/teamsmith/templates/config.sh.tmpl +2 -1
  22. package/skills/teamsmith/tests/bg-ledger-harness.mjs +17 -6
  23. package/skills/teamsmith/tests/bg-ledger.sh +16 -5
  24. package/skills/teamsmith/tests/help-surface.sh +1 -1
  25. package/skills/teamsmith/tests/install-shape.sh +88 -38
  26. package/skills/teamsmith/tests/panel-choices.sh +11 -7
  27. package/skills/teamsmith/tests/section-paths.tsv +2 -2
  28. package/skills/teamsmith/tests/smoke.sh +594 -11
  29. package/skills/teamsmith/tests/task-model-routing.sh +10 -1
  30. package/skills/teamsmith/tests/team-inbox-watch-harness.mjs +33 -0
  31. package/skills/teamsmith/tests/team-notify-knock-marker.mjs +91 -0
  32. package/skills/teamsmith-init/SKILL.md +1 -1
@@ -853,17 +853,24 @@ const groupMerge = async () => {
853
853
  }
854
854
 
855
855
  // ⑨ 行计数读者:合并行算一行;被后续事件扩展后仍是已读
856
+ // turn-notice-in-pm-inbox(A1)之后本席位自己的记录行**不计流量**(一次交付让待办 +1 而不是 +2),
857
+ // 所以未读只能从**指针行**(docs/team/inbox/pm.md,agent: 是发送者)量:三条同键事件 = 一条指针行、
858
+ // ack 之后再来一条同键事件仍并进那一行 → 仍然已读。合并语义(×N 与首末窗口)在记录行与指针行
859
+ // 两处同时验,所以这条仍然守着「合并」本身,而不是 A1 之前的计数。
856
860
  {
857
861
  const b = makeBase('merge-readers')
858
862
  resetNotify(b.base)
859
863
  for (const t of ['one', 'two', 'three']) await notify.settle(b.wt, 'stop', `MERGE-READERS ${t}`)
860
- const before = inboxNewCount(b.base)
861
- runCliRc(b.base, ['inbox', 'dev', '--ack'])
864
+ const before = inboxNewCount(b.base, 'pm')
865
+ runCliRc(b.base, ['inbox', 'pm', '--ack'])
862
866
  await notify.settle(b.wt, 'stop', 'MERGE-READERS four')
863
- const after = inboxNewCount(b.base)
867
+ const after = inboxNewCount(b.base, 'pm')
868
+ const recLine = inboxAll(b.base)[0] ?? ''
869
+ const pmLine = inboxAll(b.base, 'pm')[0] ?? ''
864
870
  check('merge: line-counting readers count a merged line once',
865
- before === 1 && after === 0 && /×4/.test(inboxAll(b.base)[0] ?? ''),
866
- `before=${before} after=${after} :: ${inboxAll(b.base)[0] ?? ''}`)
871
+ before === 1 && after === 0 && inboxAll(b.base).length === 1 && inboxAll(b.base, 'pm').length === 1 &&
872
+ /×4 first=\S+ last=\S+/.test(recLine) && /×4 first=\S+ last=\S+/.test(pmLine),
873
+ `before=${before} after=${after} :: pm=${pmLine} || dev=${recLine}`)
867
874
  }
868
875
 
869
876
  // ⑩ 陈旧判据在合并行上读最后一条的 tip(更早的事件从明细里判)
@@ -954,16 +961,20 @@ const groupDetail = async () => {
954
961
  }
955
962
 
956
963
  // ⑥ 只读:不 ack、未读数不变
964
+ // A1 之后本席位自己的记录行不计流量,所以未读用**同一个文件里的一条 [manual] 流量行**来量:
965
+ // `--detail` 读的是记录,它不能把这条流量行 ack 掉(否则 before=1 → after=0 立刻红)。
957
966
  {
958
967
  const b = makeBase('detail-readonly')
959
968
  resetNotify(b.base)
960
969
  await notify.settle(b.wt, 'stop', 'READONLY one')
961
970
  await notify.settle(b.wt, 'stop', 'READONLY two')
971
+ runCliRc(b.base, ['notify', 'dev', 'READONLY manual notice'])
962
972
  const before = inboxNewCount(b.base)
963
973
  // --detail 在有缺口时**按契约非零退出**:夹具用 rc 宽容的调用(否则破坏树会把 harness 自身搞崩)
964
974
  runCliRc(b.base, ['inbox', 'dev', '--detail'])
965
975
  const after = inboxNewCount(b.base)
966
- check('detail: detail reading does not acknowledge', before === 1 && after === 1, `before=${before} after=${after}`)
976
+ check('detail: detail reading does not acknowledge', before === 1 && after === 1,
977
+ `before=${before} after=${after} :: ${inboxAll(b.base).at(-1) ?? ''}`)
967
978
  }
968
979
  }
969
980
 
@@ -252,11 +252,12 @@ if selects flip; then
252
252
  fi
253
253
  }
254
254
 
255
- # ① 措辞回退:把挂起默认改回退休句 → 旧措辞零命中必须红
256
- M1="$(flip_mut wording-rollback "$BG_EXT" 's#End your turn after starting; the completion wake-up#Harvest it with team_bg_wait before you end your turn#')"
257
- flip_premise wording-rollback "$M1" 'Harvest it with team_bg_wait before you end your turn' has
258
- run_harness flip-wording wording "$M1" "$NOTIFY_EXT"
259
- expect_red flip-wording "wording: the retired duty wording is gone from every registered text" "$TMP/h-flip-green.log"
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
@@ -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)"
@@ -524,30 +524,27 @@ chk_init_docs_fact() { # <tree>
524
524
  return 0
525
525
  }
526
526
 
527
- chk_pack_manifest() { # <tree>:声明面 —— team + 四个信号入口,files 带着 bin/
527
+ chk_pack_manifest() { # <tree>:声明面 —— 唯一的 bin entry 是 team,files 带着 bin/
528
528
  python3 - "$1/package.json" <<'PYMANI'
529
529
  import json, sys
530
530
  p = json.load(open(sys.argv[1]))
531
531
  binmap = p.get("bin") or {}
532
532
  files = p.get("files") or []
533
533
  problems = []
534
- # P360:0.3.1 的 bin 只有 team,`npm i -g` 因此不给 pkill/killall/pgrep/pidof 建链接,
535
- # 用户敲这些名字落到 /usr/bin——闸门在 npm 路线上等于不存在。声明面必须含这四个名字。
536
- want = ["team", "pkill", "killall", "pgrep", "pidof"]
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"]
537
539
  if list(binmap.keys()) != want:
538
- problems.append("bin 键不是 team + 四个信号入口:%r" % (list(binmap.keys()),))
540
+ problems.append("bin 键不是只有 team:%r" % (list(binmap.keys()),))
539
541
  elif binmap["team"].lstrip("./") != "bin/team.mjs":
540
542
  problems.append("bin.team 指向 %r(要 bin/team.mjs)" % binmap["team"])
541
- else:
542
- for name in ("pkill", "killall", "pgrep", "pidof"):
543
- want_t = "skills/teamsmith/scripts/shim/" + name
544
- if binmap.get(name, "").lstrip("./") != want_t:
545
- problems.append("bin.%s 指向 %r(要 %s)" % (name, binmap.get(name), want_t))
546
543
  if "bin/" not in files:
547
544
  problems.append("files 白名单里没有 bin/:%r" % (files,))
548
545
  if problems:
549
546
  print(";".join(problems)); sys.exit(1)
550
- print("bin 五项(team + 四个信号入口,均指向包内文件)+ files 带 bin/")
547
+ print("bin 只有 team→bin/team.mjs(四个信号入口不占全局命令名)+ files 带 bin/")
551
548
  PYMANI
552
549
  }
553
550
 
@@ -587,16 +584,77 @@ chk_prefix_install() { # <tree>:npm 私有 prefix 安装后与 bash 入口一
587
584
  if ! diff <("$prefix/bin/team" help 2>&1) <(bash "$t/skills/teamsmith/scripts/team" help 2>&1) >/dev/null; then
588
585
  printf 'prefix 的 help 与 bash 入口不一致\n'; return 1
589
586
  fi
587
+ # P378:npm 只应给 `team` 建链接 —— 四个信号入口靠窗口前缀注入,不能占用户的全局命令名。
588
+ chk_prefix_bin_scope "$prefix" || return 1
590
589
  # P321:安装物还得带上信号闸门的四个入口。npm 的 tarball **不携带 120000 软链** —— 0.3.0 的包里
591
590
  # pkill/killall/pgrep/pidof 四个名字全部缺失,装完全部落到 /usr/bin(docs/team/reviews/release-0.3.0.md)。
592
591
  # 判据不看名字在不在:在**安装物**的 gated PATH 里用同名 argv 记录桩验拒绝/放行(不发任何信号)。
593
592
  chk_prefix_signal_entries "$prefix" || return 1
594
- printf '私有 prefix 安装后 version/help 与 bash 入口一致,四个信号入口在且判定生效(%s/bin/team)\n' "$prefix"
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,只断言「不是包内入口」)}"
595
653
  return 0
596
654
  }
597
655
 
598
656
  chk_prefix_signal_entries() { # <prefix>:安装物的 pkill/killall/pgrep/pidof 在、解析到安装目录、判定生效
599
- local prefix="$1" shim backends stub wlog log t form out rc line fargs missing="" link want resolved
657
+ local prefix="$1" shim backends stub wlog log t form out rc line fargs missing=""
600
658
  shim="$prefix/lib/node_modules/teamsmith/skills/teamsmith/scripts/shim"
601
659
  backends="$tmp/prefix-signal-backends"; rm -rf "$backends"; mkdir -p "$backends"
602
660
  stub="$backends/.witness"
@@ -615,28 +673,8 @@ WITNESS
615
673
  if [ -n "$missing" ]; then
616
674
  printf '安装包没有携带信号闸门入口(npm 丢 120000 软链的历史形状):%s\n' "$missing"; return 1
617
675
  fi
618
- # P360(0.3.1 实测漏网):**包里带着**不等于**装上能用** —— `npm i -g` 只在 package.json 的 `bin`
619
- # 里列了谁才在 prefix/bin 里建链接。0.3.1 的 bin 只有 team,于是用户 `pkill` 落到 /usr/bin,
620
- # 闸门在 npm 路线上等于不存在;而上面两条断言只查了「包内文件在不在」,两次复验都没抓住。
621
- # 这里补的正是那个缺失的证伪者:装完必须在 prefix/bin 里解析到**这个包的**那个 shim。
622
- # 两类形状分开判、一起点名(P360 红侧实测:`readlink -f` 对不存在的最后一级会原样吐出路径而不是空,
623
- # 所以「在不在」必须先自己判,否则「bin 字段没列它们」那条永远打不出来;判据是解析到**这个包的**那个 shim,
624
- # 所以指向包外、指向包内别的文件、悬空软链都落进 foreign)。
625
- local miss_bin="" foreign=""
626
- for t in pkill killall pgrep pidof; do
627
- link="$prefix/bin/$t"
628
- want="$(readlink -f "$shim/$t" 2>/dev/null || true)"
629
- if [ ! -e "$link" ] && [ ! -L "$link" ]; then miss_bin="${miss_bin:+$miss_bin }$t"; continue; fi
630
- resolved="$(readlink -f "$link" 2>/dev/null || true)"
631
- [ "$resolved" = "$want" ] && continue
632
- foreign="${foreign:+$foreign }$t→[${resolved:-<解析不出>}](要 $want)"
633
- done
634
- if [ -n "$miss_bin" ]; then
635
- printf '安装后 prefix/bin 里没有 %s —— npm 没为这些名字建链接(bin 字段没列它们,或列的目标不是包内文件);用户敲这些名字会落到 /usr/bin\n' "$miss_bin"; return 1
636
- fi
637
- if [ -n "$foreign" ]; then
638
- printf '安装后 prefix/bin 的入口没有落在包内 shim:%s\n' "$foreign"; return 1
639
- fi
676
+ # P378:这里**不再**要求 prefix/bin 里有这四个链接(那正是要撤掉的全局遮蔽);链接形状由
677
+ # chk_prefix_bin_scope 反向钉住。本函数只证明「包里的闸门文件还在、判定没被削弱」。
640
678
  for t in pkill killall pgrep pidof; do
641
679
  line="$(PATH="$shim:$backends:/usr/bin:/bin" command -v "$t" 2>/dev/null)"
642
680
  if [ "$line" != "$shim/$t" ]; then
@@ -900,9 +938,9 @@ if want pack; then
900
938
  if ! command -v npm >/dev/null 2>&1; then
901
939
  skip "本机没有 npm:打包清单与 prefix 安装都跳过(可见 SKIP,不是静默通过)"
902
940
  else
903
- check_holds "声明面:team + 四个信号入口都指向包内 shim + files 带 bin/" chk_pack_manifest "$tree"
941
+ check_holds "声明面:bin 只有 team→bin/team.mjs + files 带 bin/" chk_pack_manifest "$tree"
904
942
  check_holds "打包清单:bin/team.mjs + 每个源的 SKILL.md + install.sh,不含账本" chk_pack_walk "$tree"
905
- check_holds "私有 prefix 安装:version/help 与四个信号入口都来自安装物" chk_prefix_install "$tree"
943
+ check_holds "私有 prefix 安装:version/help 一致、prefix/bin 不遮蔽信号命令、包内 shim 仍生效" chk_prefix_install "$tree"
906
944
  fi
907
945
  fi
908
946
 
@@ -1091,13 +1129,25 @@ PYPACKF
1091
1129
  ft="$tmp/f-pack2"; scratch_tree "$ft"; rm -f "$ft/bin/team.mjs"
1092
1130
  check_holds "⑤b 对照:真实树打包清单齐全" chk_pack_walk "$tree"
1093
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"
1094
1144
  # ⑥ P321:把四个信号入口改回 0.3.0 的软链形状 —— npm 的 tarball 丢掉它们,安装判据必须红
1095
1145
  ft="$tmp/f-pack-symlink"; scratch_tree "$ft"
1096
1146
  for _fs in pkill killall pgrep pidof; do
1097
1147
  rm -f "$ft/skills/teamsmith/scripts/shim/$_fs"
1098
1148
  ln -s signal-gate "$ft/skills/teamsmith/scripts/shim/$_fs"
1099
1149
  done
1100
- check_holds "⑥ 对照:真实树的私有 prefix 安装带四个可执行信号入口" chk_prefix_install "$tree"
1150
+ check_holds "⑥ 对照:真实树的安装物带着四个可执行信号入口且判定生效" chk_prefix_install "$tree"
1101
1151
  check_breaks "⑥ 翻转:入口退回 0.3.0 的软链形状(npm 的 tarball 不携带软链)" chk_prefix_install "$ft"
1102
1152
  fi
1103
1153
  # ⑦ P59:安装步的信任提示行 —— 去掉它 → 判据红;让它在 --no-skills 下出现 → 判据红
@@ -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/scripts" "$ft/skills/teamsmith/scripts"
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/scripts" "$ft/skills/teamsmith/scripts"
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