teamsmith 0.4.7 → 0.4.8

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 (42) hide show
  1. package/README.md +4 -4
  2. package/package.json +1 -1
  3. package/skills/teamsmith/CHANGELOG.md +11 -0
  4. package/skills/teamsmith/SKILL.md +12 -8
  5. package/skills/teamsmith/references/config.md +11 -12
  6. package/skills/teamsmith/scripts/lib/cmd-review.sh +21 -33
  7. package/skills/teamsmith/scripts/lib/common.sh +1 -1
  8. package/skills/teamsmith/scripts/panel/README.md +35 -33
  9. package/skills/teamsmith/scripts/panel/panel.js +217 -199
  10. package/skills/teamsmith/scripts/panel/src/App.tsx +221 -66
  11. package/skills/teamsmith/scripts/panel/src/layout.ts +139 -302
  12. package/skills/teamsmith/scripts/panel/src/project-settings.ts +46 -0
  13. package/skills/teamsmith/scripts/panel/src/strings/en.ts +71 -205
  14. package/skills/teamsmith/scripts/panel/src/strings/index.ts +3 -5
  15. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +72 -204
  16. package/skills/teamsmith/scripts/panel/src/types.ts +23 -4
  17. package/skills/teamsmith/scripts/strings/commands.tsv +1 -1
  18. package/skills/teamsmith/templates/AGENTS.section.md.tmpl +7 -0
  19. package/skills/teamsmith/templates/pm-prompt.md.tmpl +10 -6
  20. package/skills/teamsmith/tests/help-surface.sh +75 -7
  21. package/skills/teamsmith/tests/install-shape.sh +7 -7
  22. package/skills/teamsmith/tests/key-replies-ui.sh +11 -5
  23. package/skills/teamsmith/tests/lib/main-team-fingerprint.sh +2 -0
  24. package/skills/teamsmith/tests/lib/model-routing-boundary.sh +255 -90
  25. package/skills/teamsmith/tests/lib/model-routing-expansion.sh +181 -61
  26. package/skills/teamsmith/tests/lib/model-routing-roles.sh +125 -67
  27. package/skills/teamsmith/tests/lib/reply-fixture.sh +14 -9
  28. package/skills/teamsmith/tests/lib/tmp-root.sh +1 -1
  29. package/skills/teamsmith/tests/loop-inventory.tsv +2 -0
  30. package/skills/teamsmith/tests/panel-b2.sh +91 -31
  31. package/skills/teamsmith/tests/panel-p21.sh +607 -1162
  32. package/skills/teamsmith/tests/panel-strings.mjs +21 -113
  33. package/skills/teamsmith/tests/remind-adversarial-faults.mjs +65 -38
  34. package/skills/teamsmith/tests/remind-adversarial-faults.sh +64 -12
  35. package/skills/teamsmith/tests/remind-adversarial-real.sh +13 -12
  36. package/skills/teamsmith/tests/remind-tool-real.mjs +159 -112
  37. package/skills/teamsmith/tests/remind-tool-real.sh +178 -3
  38. package/skills/teamsmith/tests/section-paths.tsv +10 -10
  39. package/skills/teamsmith/tests/smoke.sh +108 -114
  40. package/skills/teamsmith/tests/task-model-routing.sh +57 -26
  41. package/skills/teamsmith/tests/tmp-hygiene.sh +1 -1
  42. package/skills/teamsmith-init/SKILL.md +1 -1
@@ -15,7 +15,7 @@ while [ $# -gt 0 ]; do
15
15
  case "$1" in --select) SELECT="${2:?}"; shift 2 ;; --flip) SELECT=flip; shift ;; *) printf 'unknown option: %s\n' "$1"; exit 2 ;; esac
16
16
  done
17
17
  for group in ${SELECT//,/ }; do
18
- case "$group" in policy|machine|config|upgrade|dispatch|resume|transaction|limits|preview|sid-readers|pm|boundary|init|heal|adopt|updatecheck|flip) ;; *) printf 'unknown group: %s\n' "$group"; exit 2 ;; esac
18
+ case "$group" in policy|machine|config|upgrade|dispatch|resume|transaction|limits|preview|sid-readers|pm|boundary|init|heal|adopt|updatecheck|parameters|argv-worker|argv-pm|flip) ;; *) printf 'unknown group: %s\n' "$group"; exit 2 ;; esac
19
19
  done
20
20
  while IFS='=' read -r k _; do case "$k" in TEAM_*) unset "$k" 2>/dev/null || true ;; esac; done < <(env)
21
21
  TMP="$(tmp_root_create task-model-routing)" || exit 3
@@ -46,7 +46,25 @@ contains() { [[ "$1" == *"$2"* ]]; }
46
46
  sha() { if [ -f "$1" ]; then sha256sum "$1" | cut -d' ' -f1; else printf absent; fi; }
47
47
  CLI="$TREE/skills/teamsmith/scripts/team"
48
48
  SKILL="$TREE/skills/teamsmith"
49
- REPO="$TMP/repo"; mkdir -p "$REPO/.pi/team" "$REPO/docs/team/tasks" "$REPO/docs/team/threads"
49
+ REPO="$TMP/repo"; STATE="$REPO/.pi/team/state"; CONFIG="$REPO/.pi/team/config.sh"
50
+ if has parameters; then
51
+ [ "$SELECT" = parameters ] || { printf 'parameters cannot combine with full groups: %s\n' "$SELECT"; exit 2; }
52
+ source "$SKILL/scripts/lib/common.sh" || exit 3
53
+ routing_parameter_probes
54
+ printf '\nRESULT pass=%s fail=%s selected=%s\n' "$PASS" "$FAIL" "$SELECT"
55
+ [ "$FAIL" = 0 ]; exit $?
56
+ fi
57
+ if has argv-worker || has argv-pm; then
58
+ for group in ${SELECT//,/ }; do
59
+ case "$group" in argv-worker|argv-pm) ;; *) printf 'argv samples cannot combine with full groups: %s\n' "$group"; exit 2 ;; esac
60
+ done
61
+ routing_argv_setup || { printf 'ERROR argv-setup failed\n'; exit 3; }
62
+ if has argv-worker; then routing_worker_argv_probe; fi
63
+ if has argv-pm; then routing_pm_argv_probes; fi
64
+ printf '\nRESULT pass=%s fail=%s selected=%s\n' "$PASS" "$FAIL" "$SELECT"
65
+ [ "$FAIL" = 0 ]; exit $?
66
+ fi
67
+ mkdir -p "$REPO/.pi/team" "$REPO/docs/team/tasks" "$REPO/docs/team/threads"
50
68
  git -C "$REPO" init -q -b main
51
69
  git -C "$REPO" config user.name fixture; git -C "$REPO" config user.email fixture@example.invalid
52
70
  printf '# fixture\n' > "$REPO/README.md"; git -C "$REPO" add README.md; git -C "$REPO" commit -qm fixture
@@ -440,6 +458,7 @@ run_hook() { RC=0; effect_snapshot "before hook $*"; OUT="$(hooked "$@" 2>&1)" |
440
458
  stop_fixture_seat() { (cd "$REPO" && tmux kill-window -t "routing-fixture:$1") 2>/dev/null || true; }
441
459
  assignment_snapshot() { printf '%s:%s:%s' "$(sha "$STATE/dev.env")" "$(sha "$STATE/dev.pending")" "$(sha "$REPO/docs/team/BOARD.md")"; }
442
460
  if has boundary; then
461
+ routing_parameter_probes
443
462
  routing_template_probes
444
463
  routing_pm_template_probes
445
464
  routing_expansion_probes worker
@@ -447,6 +466,7 @@ if has boundary; then
447
466
  routing_role_probes worker
448
467
  routing_role_probes pm
449
468
  routing_resume_role_probes
469
+ routing_renderer_refusal_probes
450
470
  fi
451
471
  if has limits || has transaction; then
452
472
  run config set TEAM_TASK_MODELS 'routine=vendor/routine analysis=vendor/analysis verify=vendor/verify' --yes
@@ -1392,12 +1412,10 @@ fi
1392
1412
 
1393
1413
  if has flip; then
1394
1414
  CORE='policy,machine,init,config,upgrade,dispatch,resume,transaction,limits,preview,sid-readers,pm,heal,adopt,updatecheck,boundary'
1395
- # P358:臂预算。`flip_run` 只能给**所有臂一个值**(每条臂跑哪些组由变异体决定,耗时差一个量级),
1396
- # 所以这个值是**最慢那条臂**的上限,不是典型值:`template-shadow` 把 identity guard 整个拆掉之后,
1397
- # boundary 组 29 类故障模板 × 4 种模式全部走到真派单 —— 变异树实测 842s(2026-10-21,P358;同一条
1398
- # 命令的绿基线 411s)。原来的 900s 只剩 6% 余量,机器一忙就必然撞上(发布那轮 fail=2 → fail=1 的
1399
- # 漂移就是这里来的)。取实测 × 2 = 1800s,与整段 7200s 同一个口径:**它只回答「它没动」,不回答
1400
- # 「它慢」**。整段的上限归 §61b 那条段(smoke.sh 的 7200s),不因这里而变。
1415
+ # P358's shared arm budget stays unchanged. Its historical 842s template-shadow
1416
+ # reading preceded P468's parameters selection; it is not a reading of this
1417
+ # replacement. The timeout distinguishes an unfinished child from intended red,
1418
+ # never judges performance; the section-level 7200s budget is unchanged too.
1401
1419
  FLIP_ARM_BUDGET=1800
1402
1420
  # 撞上限只是 rc=124(1 是「它自己判红」)。超时必须是一条**点名**的红:只留 rc=124 就把「哪条臂、
1403
1421
  # 用满多少秒」留给下一个人去猜,那正是同一类问题的下一次复发(P358)。
@@ -1406,7 +1424,8 @@ if has flip; then
1406
1424
  printf 'FAIL flip-%s-arm-budget 臂 %s 用满臂预算 %ss(实跑 %ss)仍未出结果 —— 这是「它没跑完」,不是「它红了」\n' \
1407
1425
  "$1" "$1" "$FLIP_ARM_BUDGET" "$2"
1408
1426
  }
1409
- # One green baseline and one green restoration of the whole slice; each red arm has its own copy.
1427
+ # One full normal baseline; each red arm has its own copy. The two resplit
1428
+ # and five parameter arms observe healthy/restored on that same copy.
1410
1429
  flip_run() {
1411
1430
  local tag="$1" tree="$2" groups="$3" rc=0 started ended
1412
1431
  started="$(date +%s)"
@@ -1432,7 +1451,9 @@ if has flip; then
1432
1451
  latest-shell|latest-monitor) groups=sid-readers ;;
1433
1452
  pm-fallback) groups=pm ;;
1434
1453
  pm-publication) groups=dispatch,pm ;;
1435
- extra-shadow|template-shadow|template-unbound|template-roles|literal-shell-expansion|pm-literal-resplit|worker-literal-resplit) groups=boundary ;;
1454
+ extra-shadow|template-shadow|template-unbound|template-roles|literal-shell-expansion) groups=parameters ;;
1455
+ pm-literal-resplit) groups=argv-pm ;;
1456
+ worker-literal-resplit) groups=argv-worker ;;
1436
1457
  monitor-record-drift) groups=sid-readers ;;
1437
1458
  init-legacy-proceeds|template-retired-key) groups=init ;;
1438
1459
  migration-row-removed|no-backup|no-shape-number) groups=heal ;;
@@ -1448,6 +1469,10 @@ if has flip; then
1448
1469
  [ ! -d "$SKILL/$source_dir" ] || cp -a "$SKILL/$source_dir" "$scratch/skills/teamsmith/"
1449
1470
  done
1450
1471
  before="$(find "$scratch/skills/teamsmith/scripts" -type f -print0 | sort -z | xargs -0 sha256sum | sha256sum | cut -d' ' -f1)"
1472
+ case "$mutation" in pm-literal-resplit|worker-literal-resplit|extra-shadow|template-shadow|template-unbound|template-roles|literal-shell-expansion)
1473
+ flip_run "$mutation-healthy" "$scratch" "$groups"
1474
+ check "flip-$mutation-healthy" eq "$FLIP_RC" 0 ;;
1475
+ esac
1451
1476
  python3 "$here/lib/model-routing-flips.py" "$scratch" "$mutation" > "$TMP/mutation-$mutation.json"
1452
1477
  check "flip-$mutation-target-matched" eq "$?" 0
1453
1478
  check "flip-$mutation-shape-valid" bash -c 'for file in "$1"/scripts/lib/*.sh; do bash -n "$file" || exit; done; node --check "$1/scripts/monitor.mjs"' _ "$scratch/skills/teamsmith"
@@ -1465,23 +1490,23 @@ if has flip; then
1465
1490
  check flip-identity-overclaim-argv grep -q '^FAIL publication-record-equals-argv:model-only$' "$TMP/flip-$mutation.log"
1466
1491
  check flip-identity-overclaim-opaque grep -q '^FAIL publication-record:opaque$' "$TMP/flip-$mutation.log"
1467
1492
  check flip-identity-overclaim-claim grep -q '^FAIL publication-claim-gap:model-only$' "$TMP/flip-$mutation.log" ;;
1468
- template-shadow) check flip-template-shadow-specific-worker grep -q '^FAIL template-refused:all-hardcoded:preview$' "$TMP/flip-$mutation.log"
1469
- check flip-template-shadow-specific-pm grep -q '^FAIL pm-template-refused:provider:launch$' "$TMP/flip-$mutation.log" ;;
1493
+ extra-shadow) check flip-extra-shadow-specific-model grep -q '^FAIL parameter-extra-refused:model$' "$TMP/flip-$mutation.log" ;;
1494
+ template-shadow) check flip-template-shadow-specific-worker grep -q '^FAIL parameter-template-refused:worker:all-hardcoded:continued$' "$TMP/flip-$mutation.log"
1495
+ check flip-template-shadow-specific-pm grep -q '^FAIL parameter-template-refused:pm:provider:fresh$' "$TMP/flip-$mutation.log" ;;
1470
1496
  template-unbound)
1471
- check flip-unbound-worker-positional grep -q '^FAIL template-refused:positional-model:launch$' "$TMP/flip-$mutation.log"
1472
- check flip-unbound-worker-data grep -q '^FAIL template-refused:data-sid:preview$' "$TMP/flip-$mutation.log"
1473
- check flip-unbound-pm-positional grep -q '^FAIL pm-custom-missing-refused:positional-model:launch$' "$TMP/flip-$mutation.log"
1474
- check flip-unbound-pm-data grep -q '^FAIL pm-template-refused:data-provider:preview$' "$TMP/flip-$mutation.log" ;;
1497
+ check flip-unbound-worker-positional grep -q '^FAIL parameter-template-refused:worker:positional-model:continued$' "$TMP/flip-$mutation.log"
1498
+ check flip-unbound-worker-data grep -q '^FAIL parameter-template-refused:worker:data-sid:continued$' "$TMP/flip-$mutation.log"
1499
+ check flip-unbound-pm-positional grep -q '^FAIL parameter-template-refused:pm:positional-model:continued$' "$TMP/flip-$mutation.log"
1500
+ check flip-unbound-pm-data grep -q '^FAIL parameter-template-refused:pm:data-provider:fresh$' "$TMP/flip-$mutation.log" ;;
1475
1501
  template-roles)
1476
- check flip-role-worker-selector-as-data grep -q '^FAIL worker-role-refused:model:--skill:launch$' "$TMP/flip-$mutation.log"
1477
- check flip-role-pm-selector-as-data grep -q '^FAIL pm-role-refused:provider:--skill:launch$' "$TMP/flip-$mutation.log"
1478
- check flip-role-pm-resume-data grep -q '^FAIL pm-role-resume-refused:builtin:--skill --continue:launch$' "$TMP/flip-$mutation.log" ;;
1502
+ check flip-role-worker-selector-as-data grep -q '^FAIL parameter-role-refused:worker:model:--skill$' "$TMP/flip-$mutation.log"
1503
+ check flip-role-pm-selector-as-data grep -q '^FAIL parameter-role-refused:pm:provider:--skill$' "$TMP/flip-$mutation.log"
1504
+ check flip-role-pm-resume-data grep -q '^FAIL parameter-resume-role-refused:--skill --continue$' "$TMP/flip-$mutation.log" ;;
1479
1505
  monitor-record-drift) check flip-monitor-record-drift-specific-nonce grep -q '^FAIL reader-monitor-unavailable:nonce$' "$TMP/flip-$mutation.log" ;;
1480
1506
  literal-shell-expansion)
1481
- check flip-literal-shell-specific-worker-template grep -q '^FAIL worker-expansion-refused:template:model-glob:launch$' "$TMP/flip-$mutation.log"
1482
- check flip-literal-shell-specific-worker-extra grep -q '^FAIL worker-expansion-refused:extra:model-glob:launch$' "$TMP/flip-$mutation.log"
1483
- check flip-literal-shell-specific-pm-template grep -q '^FAIL pm-expansion-refused:template:model-glob:launch$' "$TMP/flip-$mutation.log"
1484
- check flip-literal-shell-specific-pm-extra grep -q '^FAIL pm-expansion-refused:extra:model-glob:launch$' "$TMP/flip-$mutation.log" ;;
1507
+ check flip-literal-shell-specific-worker-template grep -q '^FAIL parameter-expansion-refused:worker-template:model-glob$' "$TMP/flip-$mutation.log"
1508
+ check flip-literal-shell-specific-pm-template grep -q '^FAIL parameter-expansion-refused:pm-template:model-glob$' "$TMP/flip-$mutation.log"
1509
+ check flip-literal-shell-specific-shared-extra grep -q '^FAIL parameter-expansion-refused:shared-extra:model-glob$' "$TMP/flip-$mutation.log" ;;
1485
1510
  pm-literal-resplit)
1486
1511
  check flip-pm-resplit-specific-extra grep -q '^FAIL pm-expansion-literal-argv:extra$' "$TMP/flip-$mutation.log"
1487
1512
  check flip-pm-resplit-specific-resume grep -q '^FAIL pm-resume-literal-argv:builtin$' "$TMP/flip-$mutation.log" ;;
@@ -1525,13 +1550,19 @@ if has flip; then
1525
1550
  check flip-legacy-route-write-path grep -q '^FAIL init-legacy-config-set-derived$' "$TMP/flip-$mutation.log"
1526
1551
  check flip-legacy-route-paste grep -q '^FAIL init-paste-derived-exact$' "$TMP/flip-$mutation.log" ;;
1527
1552
  esac
1528
- cp -a "$SKILL/scripts/." "$scratch/skills/teamsmith/scripts/"
1553
+ case "$mutation" in
1554
+ extra-shadow|template-shadow|template-unbound|template-roles|literal-shell-expansion)
1555
+ cp -p "$SKILL/scripts/lib/common.sh" "$scratch/skills/teamsmith/scripts/lib/common.sh" ;;
1556
+ *) cp -a "$SKILL/scripts/." "$scratch/skills/teamsmith/scripts/" ;;
1557
+ esac
1529
1558
  restored="$(find "$scratch/skills/teamsmith/scripts" -type f -print0 | sort -z | xargs -0 sha256sum | sha256sum | cut -d' ' -f1)"
1530
1559
  check "flip-$mutation-source-restored" eq "$restored" "$before"
1531
1560
  printf 'CONTROL %s source_before=%s source_restored=%s\n' "$mutation" "$before" "$restored"
1561
+ case "$mutation" in pm-literal-resplit|worker-literal-resplit|extra-shadow|template-shadow|template-unbound|template-roles|literal-shell-expansion)
1562
+ flip_run "$mutation-restored" "$scratch" "$groups"
1563
+ check "flip-$mutation-restored" eq "$FLIP_RC" 0 ;;
1564
+ esac
1532
1565
  done
1533
- flip_run restored "$TREE" "$CORE"
1534
- check flip-restored-all-green eq "$FLIP_RC" 0
1535
1566
  fi
1536
1567
  fi
1537
1568
  printf '\nRESULT pass=%s fail=%s selected=%s\n' "$PASS" "$FAIL" "$SELECT"
@@ -164,7 +164,7 @@ _proc_start() { # <pid> → /proc/<pid>/stat 的 starttime
164
164
  # shellcheck disable=SC2086
165
165
  set -- $stat
166
166
  [ -n "${20:-}" ] || return 1
167
- printf '%s\n' "$20"
167
+ printf '%s\n' "${20}"
168
168
  }
169
169
  _proc_alive() { # <pid> [start]
170
170
  local pid="${1:-}" want="${2:-}" st state
@@ -3,7 +3,7 @@ name: teamsmith-init
3
3
  description: teamsmith-init is the new-project entry point of the teamsmith toolkit — organize multiple agents into a team, set up an agent collaboration protocol, and bootstrap this skill into a new project. It walks the questions to settle with the user first (dependencies, session and roster, the task-category mapping and the independent PM model, gates, VCS mode, install command, and the project's ROADMAP/OWNERSHIP/AGENTS.md red lines), then runs the one command that writes `.pi/team/config.sh` + the `docs/team/` skeleton + the `AGENTS.md` protocol section and starts the pulse, and finally hands day-to-day operation to the `teamsmith` skill. Use when the user wants to bootstrap teamsmith into a new repository, set up a brand-new team, organize multiple agents into a team, or set up an agent collaboration protocol where none exists yet.
4
4
  license: MIT
5
5
  metadata:
6
- version: "0.4.7"
6
+ version: "0.4.8"
7
7
  ---
8
8
 
9
9
  # teamsmith-init · bring a new project to "ready to dispatch"