teamsmith 0.3.1 → 0.3.2

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 CHANGED
@@ -56,14 +56,14 @@ than replaced (`--force` replaces only an entry recognised as this skill).
56
56
  ### As a Pi package (no global CLI)
57
57
 
58
58
  ```bash
59
- pi install git:git@github.com:Track07-cda/teamsmith@v0.3.1 # user level: every project
60
- pi install -l git:git@github.com:Track07-cda/teamsmith@v0.3.1 # project level: recorded in .pi/settings.json
59
+ pi install git:git@github.com:Track07-cda/teamsmith@v0.3.2 # user level: every project
60
+ pi install -l git:git@github.com:Track07-cda/teamsmith@v0.3.2 # project level: recorded in .pi/settings.json
61
61
  ```
62
62
 
63
63
  - **Pin a released tag**: `@v<version>`, the version `team version` prints. Latest tag:
64
64
  `git tag --sort=-v:refname | head -1`.
65
- - The `git@github.com:` form (or `ssh://git@github.com/Track07-cda/teamsmith@v0.3.1`) uses your SSH key and works
66
- whether or not you have a token; the shorthand `git:github.com/Track07-cda/teamsmith@v0.3.1` takes the HTTPS
65
+ - The `git@github.com:` form (or `ssh://git@github.com/Track07-cda/teamsmith@v0.3.2`) uses your SSH key and works
66
+ whether or not you have a token; the shorthand `git:github.com/Track07-cda/teamsmith@v0.3.2` takes the HTTPS
67
67
  route, so it works anonymously on the public repository and asks for credentials if your access is private.
68
68
  - The clone lands in `~/.pi/agent/git/<host>/<path>` (user level) or `.pi/git/<host>/<path>` (project level); the
69
69
  skill directory — the `<skill>` used in every command below — is `<clone>/skills/teamsmith`.
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "teamsmith",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Turn one agent session into a project owner: self-contained task briefs dispatched to worker agents in their own git worktrees, independent verification on a separate checkout, and an auditable ledger (BOARD / reviews / threads / DECISIONS). Runs on Pi today.",
5
5
  "license": "MIT",
6
6
  "bin": {
7
- "team": "./bin/team.mjs"
7
+ "team": "./bin/team.mjs",
8
+ "pkill": "./skills/teamsmith/scripts/shim/pkill",
9
+ "killall": "./skills/teamsmith/scripts/shim/killall",
10
+ "pgrep": "./skills/teamsmith/scripts/shim/pgrep",
11
+ "pidof": "./skills/teamsmith/scripts/shim/pidof"
8
12
  },
9
13
  "repository": {
10
14
  "type": "git",
@@ -5,6 +5,21 @@
5
5
  > `SKILL.md`/`references/**`/`templates/**`/`extension/**` 在 Pi 里输入 `/reload`(或 `/pi-team-reload`)即生效;
6
6
  > 判断自己是不是旧的:`team mark-loaded`(开局记一次)→ `team version --check`。
7
7
 
8
+ ## v0.3.2(2026-10-22)
9
+
10
+ **npm 安装的人必须升级(0.3.0 与 0.3.1 都受影响)。**
11
+
12
+ 0.3.1 修好了「四个信号入口随包发布」这件事,但 `package.json` 的 `bin` 字段仍然只列了 `team`——
13
+ 而 `npm install -g` 只给 `bin` 里列出的名字建链接。于是**装完之后 `pkill` / `killall` / `pgrep` / `pidof`
14
+ 仍然解析到 `/usr/bin`,防误杀的信号闸门在 npm 路线上等于不存在**(包里的 shim 文件在,但没人指向它们)。
15
+ 用 Git 检出安装或跑 `install.sh` 的人不受影响。
16
+
17
+ 这一版把四个名字加进 `bin`(都指向包内的 shim),并在安装面夹具里补上那个缺失的证伪者:
18
+ `npm i -g --prefix …` 之后,`prefix/bin/{pkill,killall,pgrep,pidof}` 必须**解析到安装包内部**,
19
+ 否则判红。这一条以前没有,所以两次独立复验都漏过去了——它们只检查了「包内文件在不在」。
20
+
21
+ 除此之外与 0.3.1 完全相同。`0.3.1` 已在 npm 上标记为 deprecated。
22
+
8
23
  ## v0.3.1(2026-10-21)
9
24
 
10
25
  补丁版:**没有破坏性变化、没有默认行为切换、没有新依赖**。这一版修的是 0.3.0 发出后才暴露的六件事。
@@ -3,7 +3,7 @@ name: teamsmith
3
3
  description: teamsmith gives one agent real ownership of a project — it plans, writes self-contained task briefs, dispatches worker agents into their own tmux windows and git worktrees, verifies their work on an independent checkout, merges, and keeps an auditable ledger (BOARD/reviews/threads/DECISIONS). A pulse window (the periodic patrol) wakes the owner only when there is pending work, and the owner can deliberately stand down. Works with Pi; the launch/notify seam is an internal seam (frozen) reserved for a possible future non-Pi adapter, with no compatibility promise. Use when the user wants an agent to own a project end to end, dispatch tasks to worker agents, run agents in parallel in tmux with git worktree isolation, act as a PM/orchestrator over other agents, review an agent's work independently, run the patrol (`pulse`) as a tmux window, wake the PM only when there is pending work, or resume and coordinate a multi-agent project. To start a new project, use the teamsmith-init skill.
4
4
  license: MIT
5
5
  metadata:
6
- version: "0.3.1"
6
+ version: "0.3.2"
7
7
  ---
8
8
 
9
9
  # teamsmith · one agent that actually owns the project
@@ -3,7 +3,7 @@
3
3
  # 由 scripts/team 与各 cmd-*.sh source;不要直接执行。
4
4
  # 约定:所有函数名以 team_ 前缀;不依赖 jq / python / node。
5
5
 
6
- TEAM_VERSION="0.3.1"
6
+ TEAM_VERSION="0.3.2"
7
7
 
8
8
  # ---------------------------------------------------------------- 输出
9
9
  if [ -t 1 ] && [ -z "${NO_COLOR:-}" ]; then
@@ -105,6 +105,15 @@ inbox_hash() { # <仓库>:真实仓库收件箱指纹(M7.2 的反向守卫
105
105
  | while IFS= read -r f; do sha256sum "$f"; done | sha256sum | awk '{print $1}'
106
106
  )
107
107
  }
108
+ # P360 实测(2026-10-22):指纹比对在**活着的项目**上必然红 —— 收件箱由投递机制与巡检持续写入,
109
+ # 跟夹具一点关系都没有(那条红在我自己跑的三次里出现两次,另一次恰好在投递间隙)。判据的本意是
110
+ # 「夹具不许往真账本喂幻影待办」,所以判它自己留下的痕迹:本轮私有临时根路径出现在真实收件箱里。
111
+ inbox_fixture_leaks() { # <仓库> <本轮私有根>:真实收件箱里出现本轮夹具路径的行数
112
+ ( cd "$1" 2>/dev/null || return 0
113
+ find docs/team/inbox -type f 2>/dev/null | sort \
114
+ | while IFS= read -r f; do grep -hF -- "${2:-/nonexistent}" "$f" 2>/dev/null; done | wc -l | tr -d ' '
115
+ )
116
+ }
108
117
 
109
118
  # ── 版本锚点(P218):唯一来源 = 那棵树自己的 common.sh(TEAM_VERSION),本文件里不出现版本字面量 ──
110
119
  # 现场(P214):这四处改坏副本的 sed 原来写死成当时的版本号(`1.42.0`);版本改成 0.1.0 后 sed 空转 → 副本没被改坏 →
@@ -432,22 +441,30 @@ chk_init_docs_fact() { # <tree>
432
441
  return 0
433
442
  }
434
443
 
435
- chk_pack_manifest() { # <tree>:声明面 —— 恰好一个 bin 键,files 带着 bin/
444
+ chk_pack_manifest() { # <tree>:声明面 —— team + 四个信号入口,files 带着 bin/
436
445
  python3 - "$1/package.json" <<'PYMANI'
437
446
  import json, sys
438
447
  p = json.load(open(sys.argv[1]))
439
448
  binmap = p.get("bin") or {}
440
449
  files = p.get("files") or []
441
450
  problems = []
442
- if list(binmap.keys()) != ["team"]:
443
- problems.append("bin 键不是恰好一个 team:%r" % (list(binmap.keys()),))
451
+ # P360:0.3.1 的 bin 只有 team,`npm i -g` 因此不给 pkill/killall/pgrep/pidof 建链接,
452
+ # 用户敲这些名字落到 /usr/bin——闸门在 npm 路线上等于不存在。声明面必须含这四个名字。
453
+ want = ["team", "pkill", "killall", "pgrep", "pidof"]
454
+ if list(binmap.keys()) != want:
455
+ problems.append("bin 键不是 team + 四个信号入口:%r" % (list(binmap.keys()),))
444
456
  elif binmap["team"].lstrip("./") != "bin/team.mjs":
445
457
  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))
446
463
  if "bin/" not in files:
447
464
  problems.append("files 白名单里没有 bin/:%r" % (files,))
448
465
  if problems:
449
466
  print(";".join(problems)); sys.exit(1)
450
- print("bin 一项 + files 带 bin/(%r)" % (binmap["team"],))
467
+ print("bin 五项(team + 四个信号入口,均指向包内文件)+ files 带 bin/")
451
468
  PYMANI
452
469
  }
453
470
 
@@ -493,7 +510,7 @@ chk_prefix_install() { # <tree>:npm 私有 prefix 安装后与 bash 入口一
493
510
  }
494
511
 
495
512
  chk_prefix_signal_entries() { # <prefix>:安装物的 pkill/killall/pgrep/pidof 在、解析到安装目录、判定生效
496
- local prefix="$1" shim backends stub wlog log t form out rc line fargs missing=""
513
+ local prefix="$1" shim backends stub wlog log t form out rc line fargs missing="" link want resolved
497
514
  shim="$prefix/lib/node_modules/teamsmith/skills/teamsmith/scripts/shim"
498
515
  backends="$tmp/prefix-signal-backends"; rm -rf "$backends"; mkdir -p "$backends"
499
516
  stub="$backends/.witness"
@@ -512,6 +529,28 @@ WITNESS
512
529
  if [ -n "$missing" ]; then
513
530
  printf '安装包没有携带信号闸门入口(npm 丢 120000 软链的历史形状):%s\n' "$missing"; return 1
514
531
  fi
532
+ # P360(0.3.1 实测漏网):**包里带着**不等于**装上能用** —— `npm i -g` 只在 package.json 的 `bin`
533
+ # 里列了谁才在 prefix/bin 里建链接。0.3.1 的 bin 只有 team,于是用户 `pkill` 落到 /usr/bin,
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
515
554
  for t in pkill killall pgrep pidof; do
516
555
  line="$(PATH="$shim:$backends:/usr/bin:/bin" command -v "$t" 2>/dev/null)"
517
556
  if [ "$line" != "$shim/$t" ]; then
@@ -762,7 +801,7 @@ if want pack; then
762
801
  if ! command -v npm >/dev/null 2>&1; then
763
802
  skip "本机没有 npm:打包清单与 prefix 安装都跳过(可见 SKIP,不是静默通过)"
764
803
  else
765
- check_holds "声明面:一个 bin 键(team → bin/team.mjs)+ files 带 bin/" chk_pack_manifest "$tree"
804
+ check_holds "声明面:team + 四个信号入口都指向包内 shim + files 带 bin/" chk_pack_manifest "$tree"
766
805
  check_holds "打包清单:bin/team.mjs + 两个 SKILL.md + install.sh,不含账本" chk_pack_walk "$tree"
767
806
  check_holds "私有 prefix 安装:version/help 与四个信号入口都来自安装物" chk_prefix_install "$tree"
768
807
  fi
@@ -1064,7 +1103,9 @@ PYEXT
1064
1103
  fi
1065
1104
 
1066
1105
  # ---------------------------------------------------------------- 结果
1067
- assert_eq "反向守卫(M7.2):整轮夹具没往真实仓库收件箱写一个字节" "$(inbox_hash "$tree")" "$inbox_before"
1106
+ # 判「夹具自己的痕迹」而不是「文件有没有被任何进程写过」:活着的项目里收件箱一直在长。
1107
+ assert_eq "反向守卫(M7.2):真实仓库收件箱里没有本轮夹具路径的痕迹" \
1108
+ "$(inbox_fixture_leaks "$tree" "$tmp")" "0"
1068
1109
  printf '\n\033[1m== 结果 ==\033[0m ✓ %d ✗ %d SKIP %d\n' "$PASS" "$FAIL" "$SKIP"
1069
1110
  [ "$FAIL" -eq 0 ] && exit 0
1070
1111
  exit 1
@@ -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.3.1"
6
+ version: "0.3.2"
7
7
  ---
8
8
 
9
9
  # teamsmith-init · bring a new project to "ready to dispatch"