teamsmith 0.1.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -7
- package/package.json +1 -1
- package/skills/teamsmith/CHANGELOG.md +67 -0
- package/skills/teamsmith/SKILL.md +26 -8
- package/skills/teamsmith/extension/team-notify.ts +37 -6
- package/skills/teamsmith/extension/team.ts +438 -0
- package/skills/teamsmith/references/agent-adapters.md +7 -7
- package/skills/teamsmith/references/config.md +65 -18
- package/skills/teamsmith/references/migration.md +220 -34
- package/skills/teamsmith/references/protocol.md +250 -25
- package/skills/teamsmith/references/troubleshooting.md +124 -7
- package/skills/teamsmith/references/workflows.md +66 -20
- package/skills/teamsmith/scripts/lib/cmd-agents.sh +525 -90
- package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +71 -10
- package/skills/teamsmith/scripts/lib/cmd-config.sh +562 -128
- package/skills/teamsmith/scripts/lib/cmd-death.sh +2 -15
- package/skills/teamsmith/scripts/lib/cmd-docs.sh +6 -3
- package/skills/teamsmith/scripts/lib/cmd-draft.sh +4 -4
- package/skills/teamsmith/scripts/lib/cmd-help.sh +677 -0
- package/skills/teamsmith/scripts/lib/cmd-init.sh +157 -5
- package/skills/teamsmith/scripts/lib/cmd-interrupt.sh +461 -0
- package/skills/teamsmith/scripts/lib/cmd-meeting.sh +2 -25
- package/skills/teamsmith/scripts/lib/cmd-project.sh +149 -105
- package/skills/teamsmith/scripts/lib/cmd-reap.sh +277 -0
- package/skills/teamsmith/scripts/lib/cmd-reply.sh +96 -0
- package/skills/teamsmith/scripts/lib/cmd-review.sh +188 -40
- package/skills/teamsmith/scripts/lib/cmd-status.sh +268 -30
- package/skills/teamsmith/scripts/lib/cmd-update.sh +36 -7
- package/skills/teamsmith/scripts/lib/cmd-watch.sh +634 -54
- package/skills/teamsmith/scripts/lib/common.sh +1560 -109
- package/skills/teamsmith/scripts/lib/gate-lock.sh +544 -0
- package/skills/teamsmith/scripts/monitor.mjs +34 -3
- package/skills/teamsmith/scripts/panel/README.md +22 -11
- package/skills/teamsmith/scripts/panel/draft-send.sh +11 -1
- package/skills/teamsmith/scripts/panel/panel.js +226 -224
- package/skills/teamsmith/scripts/panel/src/App.tsx +478 -184
- package/skills/teamsmith/scripts/panel/src/clipboard.ts +11 -5
- package/skills/teamsmith/scripts/panel/src/compose.ts +6 -3
- package/skills/teamsmith/scripts/panel/src/data.ts +95 -7
- package/skills/teamsmith/scripts/panel/src/layout.ts +703 -152
- package/skills/teamsmith/scripts/panel/src/main.tsx +129 -19
- package/skills/teamsmith/scripts/panel/src/settings.ts +1 -1
- package/skills/teamsmith/scripts/panel/src/strings/en.ts +76 -31
- package/skills/teamsmith/scripts/panel/src/strings/zh.ts +78 -33
- package/skills/teamsmith/scripts/panel/src/types.ts +204 -17
- package/skills/teamsmith/scripts/replies.mjs +896 -0
- package/skills/teamsmith/scripts/shim/tmux +18 -0
- package/skills/teamsmith/scripts/strings/commands.tsv +86 -0
- package/skills/teamsmith/scripts/strings/help.en.tsv +503 -0
- package/skills/teamsmith/scripts/strings/help.zh.tsv +489 -0
- package/skills/teamsmith/scripts/team +20 -6
- package/skills/teamsmith/templates/AGENTS.section.md.tmpl +23 -3
- package/skills/teamsmith/templates/BOARD.md.tmpl +2 -2
- package/skills/teamsmith/templates/OWNERSHIP.md.tmpl +7 -3
- package/skills/teamsmith/templates/PROTOCOL.md.tmpl +17 -0
- package/skills/teamsmith/templates/config.sh.tmpl +29 -5
- package/skills/teamsmith/templates/memory-seed.md.tmpl +3 -0
- package/skills/teamsmith/templates/pm-prompt.md.tmpl +41 -1
- package/skills/teamsmith/templates/report.md.tmpl +12 -0
- package/skills/teamsmith/templates/task.md.tmpl +4 -0
- package/skills/teamsmith/tests/bg-ledger-harness.mjs +464 -40
- package/skills/teamsmith/tests/bg-ledger.sh +168 -10
- package/skills/teamsmith/tests/checkout-shape-probe.sh +3 -1
- package/skills/teamsmith/tests/config-cli.sh +320 -300
- package/skills/teamsmith/tests/death-cause.sh +5 -2
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +7 -1
- package/skills/teamsmith/tests/fixtures/p287/lint-good.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p287/lint-hardcoded.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p287/lint-no-ns.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +18 -6
- package/skills/teamsmith/tests/flip-m33.sh +5 -3
- package/skills/teamsmith/tests/flip-m37.sh +4 -1
- package/skills/teamsmith/tests/flip-m4.3.sh +4 -1
- package/skills/teamsmith/tests/flip-m6.3.sh +4 -1
- package/skills/teamsmith/tests/flip-m6.5.sh +4 -1
- package/skills/teamsmith/tests/flip-m7.2.sh +4 -1
- package/skills/teamsmith/tests/flip-p158.sh +2 -1
- package/skills/teamsmith/tests/flip-p210.sh +4 -1
- package/skills/teamsmith/tests/flip-p217.sh +4 -1
- package/skills/teamsmith/tests/flip-p287-lock.sh +342 -0
- package/skills/teamsmith/tests/flip-p287-name.sh +279 -0
- package/skills/teamsmith/tests/flip-p304-read-side.sh +98 -0
- package/skills/teamsmith/tests/flip-p308-skip-not-pass.sh +151 -0
- package/skills/teamsmith/tests/flip-p309-p162-deep.sh +122 -0
- package/skills/teamsmith/tests/flip-p310-lock.sh +216 -0
- package/skills/teamsmith/tests/flip-p310-socket.sh +125 -0
- package/skills/teamsmith/tests/help-surface.sh +1664 -0
- package/skills/teamsmith/tests/install-shape.sh +283 -22
- package/skills/teamsmith/tests/key-replies-pty.sh +374 -0
- package/skills/teamsmith/tests/key-replies-ui.sh +325 -0
- package/skills/teamsmith/tests/key-replies.sh +1314 -0
- package/skills/teamsmith/tests/ledger-ban.sh +9 -8
- package/skills/teamsmith/tests/ledger-claim.sh +248 -0
- package/skills/teamsmith/tests/lib/bounded-spin.sh +90 -0
- package/skills/teamsmith/tests/lib/model-policy.sh +30 -0
- package/skills/teamsmith/tests/lib/model-routing-boundary.sh +420 -0
- package/skills/teamsmith/tests/lib/model-routing-expansion.sh +155 -0
- package/skills/teamsmith/tests/lib/model-routing-flips.py +187 -0
- package/skills/teamsmith/tests/lib/model-routing-roles.sh +250 -0
- package/skills/teamsmith/tests/lib/proc-io.sh +103 -0
- package/skills/teamsmith/tests/lib/reply-fixture.sh +367 -0
- package/skills/teamsmith/tests/lib/section-guard.sh +258 -13
- package/skills/teamsmith/tests/lib/tmp-root.sh +139 -27
- package/skills/teamsmith/tests/lib/tmux-cap.sh +10 -1
- package/skills/teamsmith/tests/lib/tmux-iso.sh +39 -13
- package/skills/teamsmith/tests/loop-inventory.tsv +59 -47
- package/skills/teamsmith/tests/panel-b2.sh +107 -4
- package/skills/teamsmith/tests/panel-b3-stub.sh +139 -4
- package/skills/teamsmith/tests/panel-b3.sh +189 -29
- package/skills/teamsmith/tests/panel-choices.sh +81 -63
- package/skills/teamsmith/tests/panel-cpu.sh +3 -2
- package/skills/teamsmith/tests/panel-knobs.sh +7 -1
- package/skills/teamsmith/tests/panel-p21.sh +445 -241
- package/skills/teamsmith/tests/panel-snapshots.sh +41 -225
- package/skills/teamsmith/tests/panel-strings.mjs +33 -18
- package/skills/teamsmith/tests/perf.sh +122 -31
- package/skills/teamsmith/tests/pm-box-real.sh +1 -1
- package/skills/teamsmith/tests/pulse-nudge-key.sh +1 -1
- package/skills/teamsmith/tests/routes.sh +364 -109
- package/skills/teamsmith/tests/seat-interrupt.sh +1002 -0
- package/skills/teamsmith/tests/seat-visibility.sh +675 -0
- package/skills/teamsmith/tests/section-budgets.tsv +26 -12
- package/skills/teamsmith/tests/section-guard.sh +6 -1
- package/skills/teamsmith/tests/section-needs-audit.sh +24 -7
- package/skills/teamsmith/tests/section-paths.tsv +42 -26
- package/skills/teamsmith/tests/section-select.sh +90 -7
- package/skills/teamsmith/tests/slash-team-e2e.sh +323 -0
- package/skills/teamsmith/tests/slash-team.sh +617 -0
- package/skills/teamsmith/tests/smoke.sh +3762 -628
- package/skills/teamsmith/tests/snapshots/zh-dark-120-detail.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-120-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-120.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-dark-160-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-160.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-dark-59-detail.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-dark-59-p4.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-dark-59.txt +5 -5
- package/skills/teamsmith/tests/snapshots/zh-dark-99-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-99.txt +5 -5
- package/skills/teamsmith/tests/snapshots/zh-light-120-detail.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-120-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-120.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-light-160-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-160.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-light-59-detail.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-light-59-p4.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-light-59.txt +5 -5
- package/skills/teamsmith/tests/snapshots/zh-light-99-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-99.txt +5 -5
- package/skills/teamsmith/tests/task-header-model.sh +2 -1
- package/skills/teamsmith/tests/task-model-routing.sh +1511 -0
- package/skills/teamsmith/tests/tmp-hygiene.sh +782 -45
- package/skills/teamsmith/tests/tmux-identity-leak.sh +773 -0
- package/skills/teamsmith/tests/tmux-lint-legacy.txt +12 -18
- package/skills/teamsmith/tests/upgrade-recipe.sh +537 -0
- package/skills/teamsmith-init/SKILL.md +43 -43
- package/skills/teamsmith-init/references/bootstrap.md +8 -6
- package/skills/teamsmith-init/templates/bootstrap-prompt.md.tmpl +9 -5
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.
|
|
60
|
-
pi install -l git:git@github.com:Track07-cda/teamsmith@v0.
|
|
59
|
+
pi install git:git@github.com:Track07-cda/teamsmith@v0.3.0 # user level: every project
|
|
60
|
+
pi install -l git:git@github.com:Track07-cda/teamsmith@v0.3.0 # 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.
|
|
66
|
-
whether or not you have a token; the shorthand `git:github.com/Track07-cda/teamsmith@v0.
|
|
65
|
+
- The `git@github.com:` form (or `ssh://git@github.com/Track07-cda/teamsmith@v0.3.0`) uses your SSH key and works
|
|
66
|
+
whether or not you have a token; the shorthand `git:github.com/Track07-cda/teamsmith@v0.3.0` 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`.
|
|
@@ -116,18 +116,24 @@ No forge dependency: the PM uses `git`/`gh`/`glab` directly, and cross-project c
|
|
|
116
116
|
## Quickstart (in a project repo)
|
|
117
117
|
|
|
118
118
|
1. **Bring the project up** — ask your agent to run the `teamsmith-init` skill. It settles the questions with you
|
|
119
|
-
(session and roster,
|
|
119
|
+
(session and roster, the task-category model map and the independent PM model, gates, VCS mode, patrol rhythm),
|
|
120
|
+
shows the plan, then writes it:
|
|
120
121
|
|
|
121
122
|
```bash
|
|
122
123
|
bash <skill>/scripts/team bootstrap --print # the plan; writes nothing
|
|
123
|
-
bash <skill>/scripts/team bootstrap
|
|
124
|
+
bash <skill>/scripts/team bootstrap --agents "dev verify" \
|
|
125
|
+
--task-models 'routine=vendor/light analysis=vendor/strong verify=vendor/strong' --pm-model 'vendor/strong:high'
|
|
124
126
|
bash <skill>/scripts/team doctor # self-check: git/tmux/agent CLI/dependencies/gates/capacity
|
|
125
127
|
openspec init --tools pi # required dependency: spec root + the generated phase commands
|
|
126
128
|
# (a pin without a `verify` workflow — 1.8.0 has only `core` —
|
|
127
129
|
# does not generate `opsx-verify`; see references/openspec.md §6)
|
|
128
130
|
```
|
|
129
131
|
|
|
130
|
-
|
|
132
|
+
A fresh project must pass `--task-models` and `--pm-model` (there is no default model to guess); a project whose
|
|
133
|
+
config already carries a valid policy may re-enter without them, and a config still on the retired worker keys is
|
|
134
|
+
refused before any side effect and migrates through `team config upgrade-models` (see
|
|
135
|
+
`skills/teamsmith/references/migration.md` §5b). `bootstrap` is idempotent and prints the `git worktree add`
|
|
136
|
+
command for each agent (git stays with the PM).
|
|
131
137
|
|
|
132
138
|
2. **Dispatch the first task**:
|
|
133
139
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teamsmith",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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": {
|
|
@@ -5,6 +5,73 @@
|
|
|
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.0(2026-10-18)
|
|
9
|
+
|
|
10
|
+
### ⚠️ 默认变化:临时根落到磁盘(tmp-root-on-disk)
|
|
11
|
+
|
|
12
|
+
夹具、门禁、评审与清扫用的临时根,默认从 `/tmp` 搬到**磁盘**上的 `/var/tmp/teamsmith-<项目 ns>`
|
|
13
|
+
(`/var/tmp` 不可写时退回 `/tmp`)。理由:本机 `/tmp` 是 tmpfs —— 夹具写盘吃的是 RAM,与 OOM killer
|
|
14
|
+
读同一个池(现场读数见 `openspec/changes/tmp-root-on-disk/design.md`)。
|
|
15
|
+
|
|
16
|
+
- **一个解析函数**:`team_tmp_root`(`TMPDIR` → `TEAM_TMP_ROOT` → 平台默认)是唯一实现;清扫器、门禁、
|
|
17
|
+
派单地板、doctor、面板与夹具都调它。谁怎么解析的会被打印出来:`team status`、派单的余量行、
|
|
18
|
+
`tmp-hygiene --status` 都在根旁边写 `source=tmpdir|config|default`;环境里的 `TMPDIR` 盖过项目钉的
|
|
19
|
+
`TEAM_TMP_ROOT` 时,输出**点名**这件事。
|
|
20
|
+
- **升级须知**(老项目不用做任何事,但有三件事会变):
|
|
21
|
+
1. 第一次写盘时创建 `/var/tmp/teamsmith-<ns>`(0700);显式指定的根(`TMPDIR` / `TEAM_TMP_ROOT`)**不会**
|
|
22
|
+
被代建 —— 不可用就具名失败(点名路径 + 修法)并拒绝派单,绝不静默换一个根。
|
|
23
|
+
2. 旧默认根 `/tmp` 里的残留不会自己搬家:`tmp-hygiene --status` 会报旧根下的家族目录数量,并给出
|
|
24
|
+
`TMPDIR=/tmp … --sweep` 这一条(同一条清扫命令,把旧基准显式选出来);清扫器一次只作用于一个基准
|
|
25
|
+
(混着判会把新根里的东西判成「别家」)。
|
|
26
|
+
3. `tmp-hygiene --lint` 多一条规则:任何自己算临时根的地方(`${TMPDIR:-/tmp}`、`${TMPDIR}`、面板源码里的
|
|
27
|
+
`process.env.TMPDIR` / 无参 `tmpdir()`)都是 finding。豁免只有两处:解析函数自己、以及**冻结的**门禁锁
|
|
28
|
+
发布路径 `/tmp/teamsmith-smoke.lock`(P287:搬它会在升级窗口里新开一条静默并发窗口)。
|
|
29
|
+
- **回滚**:在项目配置 `.pi/team/config.sh` 里写 `TEAM_TMP_ROOT="/tmp"`(旧行为;`team config set` 按
|
|
30
|
+
`refuse` 类拒绝改它 —— 搬家是操作者动作)。门禁锁的位置不受这个键影响,它仍是 `/tmp/teamsmith-smoke.lock`。
|
|
31
|
+
- **锁不搬**:项目锁与门禁锁的位置仍按环境里的 `TMPDIR`(未设则 `/tmp`),**不**跟着临时根走 ——
|
|
32
|
+
锁是跨版本串行用的共享状态,跟着搬会在升级窗口里让新旧两版各取各的锁(与 P287 冻结门禁锁发布路径同一条纪律)。
|
|
33
|
+
- **地板**:派单的字节/inode 余量判的是**选定的**那个根(不再硬编码 `/tmp`),拒绝文案点名它;
|
|
34
|
+
doctor 多一行「锁文件系统」只警告行 —— 锁所在的文件系统可能没被别的行覆盖,但它不拒绝派单。
|
|
35
|
+
|
|
36
|
+
## v0.2.0 · 2026-10-14
|
|
37
|
+
|
|
38
|
+
功能版:**按任务类别分配模型**(含破坏式配置迁移)、**Pulse 关键回复页**,以及长作业车道的提示词侧。
|
|
39
|
+
|
|
40
|
+
### ⚠️ 破坏性变化:项目的模型配置换形状
|
|
41
|
+
|
|
42
|
+
旧的 `TEAM_AGENT_MODELS`(按席位)与 `TEAM_DEFAULT_MODEL` **不再被接受**:旧项目在任何写入之前就被拒绝,
|
|
43
|
+
并指向升级命令。新形状是「**任务类别 → 模型**的映射 + PM 自己的模型」:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
team config upgrade-models --task-models 'code=provider/model verify=… analysis=…' --pm-model 'provider/model'
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
语义上也变了:**一个任务固定一个模型与会话**——续跑复用该任务记录里的模型与会话(不再回落到席位配置),
|
|
50
|
+
**换模型必须新会话**(因为闭源模型的推理状态不能跨模型接续;这条是 Pi 的边界,Teamsmith 只约束自己的调用)。
|
|
51
|
+
|
|
52
|
+
- **任务类别模型路由**(task-model-routing):派单按任务书的 `category:` 解析模型(`--model` 仍可显式覆盖);
|
|
53
|
+
类别词汇是**项目数据**(`routine/analysis/verify` 只是示例,不是引擎的固定集合,映射为空才非法);
|
|
54
|
+
派单预览与 `team ps` 显示类别、最终模型与来源;面板新增类别编辑与「策略 vs 实际」分离的读面。
|
|
55
|
+
- **Pulse 关键回复页**(pulse-key-replies):`team reply post` 显式发布一份要保留的正文(只从 stdin 读),
|
|
56
|
+
固定槽位索引 + 不可变原文 + 文件锁;面板第五页按时间列出并能看全文——**PM 的关键答复不再被聊天流埋掉**。
|
|
57
|
+
- **长作业车道:工人提示词侧**(long-job-suspend B 刀):开场简报把「挂起等作业」写成**第三种合法回合结束
|
|
58
|
+
状态**(交付 / 硬阻塞 / 挂起),并要求点名在等哪个作业;「必须回合结束前收割」的旧措辞清零。
|
|
59
|
+
配套:`state/bg.log` 的 `start`/`wait` 记录让「起了就等」可数,收件箱标签把挂起与中断分开(A 刀在 0.1.2)。
|
|
60
|
+
|
|
61
|
+
### 门禁与工具面
|
|
62
|
+
|
|
63
|
+
- **路由前门进闸门**(P238):13 组路由测试以前只能手工跑,现在 `§61`(FAST 12 组 / live 13 组)承接;
|
|
64
|
+
`§61b` 是 22 臂变异自检(live 专跑、FAST 里可见跳过);**每一组单独可跑**(此前 `pm` 组单独跑会因缺前置
|
|
65
|
+
连锁红 29 条);选段归属不再把新测试文件归到无关段。
|
|
66
|
+
- **账本禁令对报告类改动开火**(P239):账本文本的任何改动都会选中 `§60`,归属于承载检查的那一段;
|
|
67
|
+
扫描面从「只读 `.md`」扩到 `docs/team` 下**每个会被提交的文件**(`ledger/*.tsv` 从前是盲区,植入泄漏会假绿)。
|
|
68
|
+
- **归档前置判据认 squash 合并**(P244):`team change status` 的「分支是否已并入」改用内容等价判定
|
|
69
|
+
(`-z` 逐字节读路径,非 ASCII / 含引号 / 含反斜杠的路径名不再造成**假阳**)。
|
|
70
|
+
- **发布检查跟上改写后的形状**(P247):取「HEAD 可达的最新 tag」并提示不在历史里的旧 tag
|
|
71
|
+
(本仓那 29 个已删);`team init` 路线按新配置合同传参。
|
|
72
|
+
- **临时根与容量**(P141/P144):派单前的容量地板增加磁盘/inode 两腿;陈旧夹具根的清扫有安全下限。
|
|
73
|
+
- 本版另修了预算表两行的 band 规则、以及 PM 记错合并选段的流程问题(见 `docs/team/DECISIONS.md`)。
|
|
74
|
+
|
|
8
75
|
## v0.1.2 · 2026-10-13
|
|
9
76
|
|
|
10
77
|
补丁版:把「长作业车道」的工具侧修复和发布机器一起发出去。
|
|
@@ -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.
|
|
6
|
+
version: "0.3.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# teamsmith · one agent that actually owns the project
|
|
@@ -48,24 +48,25 @@ everything below is the daily loop, which starts once the project is up.
|
|
|
48
48
|
|
|
49
49
|
| Goal | Command |
|
|
50
50
|
|---|---|
|
|
51
|
-
| Init / self-check | `team init [--session s] [--agents "a b"] [--vcs local\|remote] [--copy\|--no-skills]` (installs both skills into the project's `.pi/skills
|
|
51
|
+
| Init / self-check | `team init [--session s] [--agents "a b"] [--vcs local\|remote] --task-models '<category=provider/model …>' --pm-model '<provider/model>' [--copy\|--no-skills]` (fresh projects must pass both model inputs; installs both skills into the project's `.pi/skills/`), `team doctor` (reports that install, warns on drift) |
|
|
52
52
|
| Observe | `team roster` (windows/branch/dirty/ahead), `team status [ID]`, `team ps` (capacity + model limits + PM/pulse liveness), `team digest` (PM's pending work) |
|
|
53
53
|
| Inbox | `team inbox [agent] [--ack] [--all]` |
|
|
54
|
+
| Key replies | **The outlet for replies written for the user** (a landed milestone, a ruling, a conclusion, an answer, a status or progress report, a decision you ask the user for, a delivery or verification summary — however short, and never held back because it reads like process rather than like a conclusion): publish the complete reply — the substance the user needs to read, not a play-by-play — with `team reply post --from <seat> --title "<short>" --stdin`, then send that same body; a batch of user-facing replies may be one reply. A reply written to the patrol, to another seat or to another project's PM, and a tool receipt, are not for the user and stay out. Distinct from the internal channels: `say`/`notify` carry one-line coordination to a seat or the PM, not the reply itself. A saved receipt means project-local durable publication only — never user delivery, approval, read status or a refreshed console. `team reply list [--before <no>] [--json]`, `team reply show <no> [--json\|--raw]` (readers are observation-only: no mkdir, no writes, no lock; `--raw` exports the original bytes and refuses a TTY). The console's page 5 shows the latest reply plus the numbered history. See `references/protocol.md` §4b |
|
|
54
55
|
| Document contracts | `team task <ID> --title ... --agent a`, `team board add\|assign\|set\|ls`, `team change status <id> [--json]` (readiness view: tasks/evidence, declared vs touched delta files, blockers; exit 0 iff every mapped task is finished), `team thread <a> "..." --from pm --re <ID>`, `team report <ID> <a>` |
|
|
55
|
-
| Dispatch | `team add-agent <a> [--register] [--
|
|
56
|
+
| Dispatch | `team add-agent <a> [--register] [--create] [--no-install] [--print]`, `team dispatch <a> <ID> <taskfile> [--model m] [--branch <name>] [--fresh] [--allow-overflow] [--force] [--print]` (a new dispatch selects the brief's `category:` model from `TEAM_TASK_MODELS` unless `--model` overrides; same-task recovery keeps the committed model/SID; all pre-launch guards are judged in **one pass**: one refusal lists every blocker, each with a paste-able `修法:<command>` or `改行:<exact line>` and a final count line; `--force` overrides only the guards that carry an override, printed as a warning and logged after a real launch) |
|
|
56
57
|
| Collaborate | `team say <a> "<one-line message>" [--no-verify]` (verifies delivery; falls back to the inbox when the agent is not running), `team notify <a> "<one line>" [--from <sender>]` (agent → PM; the sender comes from the runtime directory — an unresolved sender is refused, never recorded as `pm`) |
|
|
57
58
|
| Draft / deferred delivery | `team draft [pm]` opens an editor window on `state/draft-pm.md` (nothing automated ever types into it; save+quit enqueues through the guarded path and prints the ack there), `team draft send [<file>] [--now]` (headless form), `team outbox [list]` (what is waiting, with `held` reasons), `team outbox flush [--now]`, `team outbox drop <n\|all>`. Every automated sender refuses to type into an input box that already holds a draft: the message is queued in `state/outbox/` and reported as `queued`; a `geometry-untrusted` read (the supported Pi layout cannot be established) or three trusted-empty drains with no progress (`queue-stalled`) hold the entry durably with its reason and **exit non-zero**, never promising an automatic delivery. `--now` is the audited override that types anyway (`state/outbox/forced.log`). See `references/troubleshooting.md` §3 |
|
|
58
59
|
| Long gate (background job) | **tool calls in the session** (not `team` subcommands): `team_bg_run` starts a detached job (id + pid at once, `state/bg/<id>.log`), `team_bg_wait <id>` harvests it (exit code + log tail inline). One merged wake-up per finished batch, silence once harvested, one `settled-with-unharvested=<n>` line per turn end in `state/bg.log`. Injected on both built-in Pi paths; a custom template opts in with `{bg_ext}`. The lane's records are readable and stoppable from the CLI: `team bg list` (one row per record, signals nothing), `team bg stop <id>` (signals only the recorded job — the `(pid, start-time)` pair is the identity, a reused pid is refused). Inside a window `pkill`/`killall` are the signal gate and refuse every name/pattern selection with exit 64. See `references/workflows.md` §E2 |
|
|
59
60
|
| Verify | `team review <ID> --dir <PM-prepared independent checkout> [--no-gates] [--strong] [--allow-unresolved-branch]` → `reviews/<ID>.md` (runs gates + writes evidence; refuses a dirty or `.gitignore`d checkout / an unresolvable `--branch` unless the matching `TEAM_REVIEW_ALLOW_*` override is used and recorded; `--strong` structurally checks flip evidence + a path to an independent package) |
|
|
60
61
|
| Wrap up | `team close <ID> [--keep-window]` (BOARD/state/window only, never git), `team teardown --agent a [--purge] [--register]` (explicit cleanup; `--register` removes the seat from the roster through the audited writer first) |
|
|
61
|
-
| Bootstrap | `team bootstrap [--agents "dev verify"] [--print]` (recommended), `team init`, `team doctor` |
|
|
62
|
+
| Bootstrap | `team bootstrap [--agents "dev verify"] --task-models '<map>' --pm-model '<model>' [--print]` (recommended; both model inputs are required on a fresh project, a valid policy is kept on re-entry, a legacy config is refused before any side effect and points at `team config upgrade-models`), `team init`, `team doctor` |
|
|
62
63
|
| Patrol (pulse) | `team pulse up\|down\|restart\|status\|logs` (a `pulse` window in the same session runs the monitor + periodic patrol; single backend). Renamed from `watchdog` in v1.36.0: `team watchdog …`, `watchdog-status`, `install-watchdog`, `uninstall-watchdog` still work as aliases until v2.0.0 (they print a one-line deprecation notice first). `team watch [--once]` (foreground patrol) |
|
|
63
64
|
| Monitor | `team monitor [--once] [--activity]` (**serves the current tmux session only**: who is running / tasks / pending / capacity; `--activity` adds per-agent activity streams, off by default), `team panel` reuses it. The TUI's own preferences live in `state/panel.conf` (language, page, activity, mouse, density, theme) — runtime state, not project config, and `--print`/`--json` never read it |
|
|
64
|
-
| Project settings | `team config list [--json]` / `team config set <KEY> <VALUE> [--dry-run] [--fingerprint <sha256>] [--actor <name>] [--allow-danger]` / `team config log [N]` / `team config set-
|
|
65
|
+
| Project settings | `team config list [--json]` / `team config set <KEY> <VALUE> [--dry-run] [--fingerprint <sha256>] [--actor <name>] [--allow-danger]` / `team config log [N]` / `team config set-task-model <category> <model>` / `team config upgrade-models --task-models '<map>' --pm-model '<model>' [--dry-run\|--yes]`: the only writer of `.pi/team/config.sh` (comment/order preserving, single-quote form, value validation, danger list, sha256 CAS, one audit line per attempt in `state/config.log`). Model policy is the task-category map plus the independent PM model; the retired seat front doors (`set-agent-model`, `add-agent --model`) refuse and point here. The console's project-settings view (settings overlay → `项目设置`) lists every key with its effect class (`apply`/`restart`/`refuse`) and edits through this command; see `references/config.md` §5 |
|
|
65
66
|
| PM/agent lifecycle | `team up [--agents]` (recover the PM), `team resume` (PM's tool: continue stopped agents), `team standby on\|off` (PM deliberately stands down) |
|
|
66
67
|
| Cross-project meetings | `team meeting open/say/read/list/inbox/propose/agree/close` (PM-to-PM peer exchange: interface work, advice, problem reports; **not a command channel** — consensus needs both sides) |
|
|
67
68
|
| Updates | `team mark-loaded` (record the version at session start), `team version --check` (should I reload?), `team changelog [--since X]`, `team reload` |
|
|
68
|
-
| Diagnostics | `team paths` (resolved paths/session), `team smoke` (end-to-end self-test; `TEAM_SMOKE_FAST=1 team smoke` = **fast mode**, pure-logic sections only, ~10s, skipped process sections print `SKIP (FAST mode)`; the **full** run is for delivery/review and queues on the gate lock — `TEAM_SMOKE_LOCK` / `TEAM_SMOKE_LOCK_WAIT`, holder in `<
|
|
69
|
+
| Diagnostics | `team paths` (resolved paths/session), `team smoke` (end-to-end self-test; `TEAM_SMOKE_FAST=1 team smoke` = **fast mode**, pure-logic sections only, ~10s, skipped process sections print `SKIP (FAST mode)`; the **full** run is for delivery/review and queues on the gate lock — `TEAM_SMOKE_LOCK` / `TEAM_SMOKE_LOCK_WAIT`, the mutex is a pair (published `<lock>` + dot-prefixed companion `<lock>.machine`, the holder recorded in `<companion>.holder`; neither file is ever unlinked, and losing the companion mid-run stops the run loudly), and `team review` takes the same pair before its timeout so the record's `queued`/`ran` are separate; the gate judges **correctness only** — its panel section keeps the time-independent knob check), `team version` |
|
|
69
70
|
| Performance | `team perf [--host \| --container]` (**separate from correctness**: the wall-clock/CPU red lines — interactive first frame, frame assembly, steady-state pane CPU — with the unchanged thresholds (2000 ms / 2000 ms / < 1 %), premise factors (`0.75` / `0.25`), medians, visible `SKIP` and exit codes `0`/`2`/`4`/`3`; its own lock `TEAM_PERF_LOCK`, never the gate lock; default = the pinned `ci/Containerfile` image, `--host` is labelled **not the reference**) |
|
|
70
71
|
|
|
71
72
|
The two gates answer different questions and are run at different times. **Correctness, on every change:**
|
|
@@ -95,8 +96,12 @@ when they conflict, the creed wins and the process gets fixed.
|
|
|
95
96
|
|
|
96
97
|
1. **Model the work**: `team doctor`, `init` if needed; break the user's request into milestones in `ROADMAP.md`
|
|
97
98
|
and write each task as a **self-contained brief** (context / deliverables / boundaries / copy-pasteable
|
|
98
|
-
acceptance commands / report requirements) —
|
|
99
|
-
|
|
99
|
+
acceptance commands / report requirements) — a routine category usually runs a fast model that will not fix
|
|
100
|
+
vague requests, so the brief carries the whole context.
|
|
101
|
+
2. **Dispatch**: `team dispatch <a> <ID> <taskfile>`. Check `team ps` (memory / model concurrency) first. The
|
|
102
|
+
brief's `category:` picks the model from `TEAM_TASK_MODELS` (routine for bounded work, analysis for complex
|
|
103
|
+
planning/judgment, verify for independent adversarial review — the project may use other category names);
|
|
104
|
+
record the rationale in the brief prose when the choice is not obvious.
|
|
100
105
|
One long-lived worktree per agent; dispatching again to the same agent resumes its session, use `--fresh` for a
|
|
101
106
|
new one. The brief's `change:`/`specs:`/`anchor:`/`deltas:` lines are checked **before the window opens**: one
|
|
102
107
|
change id per task (no override), a change-less brief must declare a resolvable anchor, two unfinished tasks of
|
|
@@ -159,6 +164,7 @@ bash <skill>/scripts/team changelog # change history (--since v1.8.0 for
|
|
|
159
164
|
| `scripts/**` (CLI) | **Nothing to do**: every call reads from disk |
|
|
160
165
|
| `SKILL.md` / `references/**` / `templates/**` | Type **`/reload`** in Pi (or `/teamsmith-reload`, or let the model call the `reload_skills` tool). **Note**: `/reload` refreshes the skill list/descriptions (system prompt) and extensions; **text already read into the conversation history does not change**, so after reloading you must `read <skill>/SKILL.md` again (the extension sends a follow-up prompt that triggers that re-read) |
|
|
161
166
|
| `extension/team-notify.ts`, `extension/team-bg.ts`, `extension/team-inbox-watch.ts` | **Restart the process** — the launch paths pass the extensions with `pi -e`, and `-e` modules are read at process start (`/reload` hot-reloads only extensions from Pi's auto-discovery locations, `~/.pi/agent/extensions/` and `.pi/extensions/`). PM: `team up`; worker: `team resume <agent>`. `team version --check` fingerprints them |
|
|
167
|
+
| `extension/team.ts` (the `/team` slash command) | **`/reload`** — `team init` installs it into the project's `.pi/extensions/team.ts`, which Pi discovers from the working directory; it is deliberately **not** injected with `-e` (that needs a process restart, and `/reload` is the point) and it is installed only in the main worktree — a worker worktree has no `/team` (seats call the CLI from bash). `team doctor` reports its install state; it is **not** part of the session fingerprint |
|
|
162
168
|
|
|
163
169
|
Rationale: Pi's `/reload` rediscovers skills, rebuilds the system prompt and re-imports extensions from its
|
|
164
170
|
auto-discovery locations; extensions passed with `-e` (which is how the team launch paths load them) are a
|
|
@@ -241,6 +247,18 @@ about them). They stay writable so the seam can be maintained and diagnosed; to
|
|
|
241
247
|
## Non-negotiable rules (verified during review)
|
|
242
248
|
- **Never claim something passed without having run it.** Reports must include commands and output tails; the PM
|
|
243
249
|
re-runs independently.
|
|
250
|
+
- **Publish the body before you answer — it is a standing duty.** Whenever the reply is written for the user — an
|
|
251
|
+
answer, a status or progress report, a conclusion or a ruling, a delivery or verification summary, a decision you
|
|
252
|
+
ask the user for, however short, and never held back because it reads like process rather than like a conclusion —
|
|
253
|
+
publish the complete reply (the substance the user needs to read, not a play-by-play) with
|
|
254
|
+
`team reply post --from <seat> --title "<short>" --stdin`, then send that same body normally — saved, input error,
|
|
255
|
+
storage error, busy or unconfirmed never changes what you send (the failure notice goes to stderr, never into the
|
|
256
|
+
answer). A batch of user-facing replies may be one reply. A reply written to the patrol, to another seat or to
|
|
257
|
+
another project's PM, and a tool receipt, are not for the user and stay out; when the reader is unclear, ask who
|
|
258
|
+
the reply is written for and treat an unsettled case as written for the user. A saved
|
|
259
|
+
receipt means project-local durable publication only: not user delivery, not approval, not read status, not a
|
|
260
|
+
refreshed console, and it creates no pending work, no outbox/inbox entry and no wake-up. See
|
|
261
|
+
`references/protocol.md` §4b.
|
|
244
262
|
- Agents only touch directories they own (`OWNERSHIP.md`); cross-directory needs → write `BLOCKED:` in the report.
|
|
245
263
|
- Agents must not push the protected branch, force-push, merge PR/MRs, or rebase/delete other people's branches.
|
|
246
264
|
- Tokens live in project token files (`TEAM_TOKEN_FILE` / `TEAM_GITLAB_TOKEN_FILE`, gitignored) and are injected by
|
|
@@ -528,15 +528,47 @@ export default function (pi: ExtensionAPI) {
|
|
|
528
528
|
}
|
|
529
529
|
|
|
530
530
|
const line = `${new Date().toISOString()} ${dirtyFlag}${tag} ${summary}${revStamp}${completed && last ? ` :: ${last}` : ''}`
|
|
531
|
+
// turn-notice-merge(写入侧合并 + 明细):判定「扩展末尾的同类 run 还是新起一行」在 CLI 的收件箱
|
|
532
|
+
// 写入口里(每收件人一把锁 + 先明细后合并),扩展只消费写入结果 —— 只有写下**新行**才入队 knock。
|
|
533
|
+
const cli = join(skillDir(), 'scripts/team')
|
|
534
|
+
const lineFile = join(stateDir, `notify-line-${process.pid}-${Date.now()}.txt`)
|
|
535
|
+
let writeOut = ''
|
|
531
536
|
try {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
537
|
+
writeFileSync(lineFile, line)
|
|
538
|
+
writeOut = execFileSync(
|
|
539
|
+
'bash',
|
|
540
|
+
[cli, '--root', root, '__inbox-write', '--agent', agent, '--from-file', lineFile],
|
|
541
|
+
{ encoding: 'utf8', timeout: 5000 },
|
|
542
|
+
)
|
|
535
543
|
log(`inbox ${tag} ${summary}`, cfg)
|
|
536
544
|
} catch (error) {
|
|
545
|
+
writeOut = ''
|
|
537
546
|
log(`inbox write failed: ${String(error)}`, cfg)
|
|
547
|
+
} finally {
|
|
548
|
+
try { rmSync(lineFile, { force: true }) } catch { /* ignore */ }
|
|
549
|
+
}
|
|
550
|
+
const writeState = /^state=([a-z]+)/m.exec(writeOut)?.[1] ?? ''
|
|
551
|
+
if (writeState !== 'new') {
|
|
552
|
+
// 扩展既有 run(state=extended)的 settle 不入队、不敲字:计数抖动看得见但不叫醒。
|
|
553
|
+
// 写盘失败(异常 / state=failed)也不叫醒 —— 与手工路径的「写失败不得授权唤醒」同一条规则。
|
|
554
|
+
log(`no knock (inbox write state=${writeState || 'failed'})`, cfg)
|
|
555
|
+
return
|
|
538
556
|
}
|
|
539
557
|
|
|
558
|
+
// 挂起只记录、不叫醒(用户裁定 2026-10-14):`[auto·suspended]` 是设计好的状态(席位起了长任务并
|
|
559
|
+
// 正确地结束回合等叫醒),PM 没有可行动的事 —— 行、明细、面板、digest 照旧,但不入队 knock。交付
|
|
560
|
+
// (要复验/合并)与中断(要诊断)照旧敲门;挂起中的失败面(席位死去、任务永不完)归巡检的
|
|
561
|
+
// 「任务未完成 + 窗口不在」那一档,不由这条通知兜。
|
|
562
|
+
if (suspended) {
|
|
563
|
+
log('no knock (suspended records only)', cfg)
|
|
564
|
+
return
|
|
565
|
+
}
|
|
566
|
+
const firstEvent = /^first=(\S+)/m.exec(writeOut)?.[1] ?? ''
|
|
567
|
+
const mergeKey = /^key=(\S*)/m.exec(writeOut)?.[1] ?? ''
|
|
568
|
+
// knock 的去重身份 = **行身份**(席位 + 合并键 + 首事件时间):两条文本逐字相同但不同的行不会互吞,
|
|
569
|
+
// 同一 run 的重复 settle 也绝不会二次敲门(此时它连条目都不入队)。席位是 mergeKey 的第一个分量。
|
|
570
|
+
const lineIdentity = `line|${mergeKey}|${firstEvent}`
|
|
571
|
+
|
|
540
572
|
if (!cfg.notifyTmux || !window) return
|
|
541
573
|
const target = `${cfg.session}:${cfg.pmWindow}`
|
|
542
574
|
try {
|
|
@@ -553,17 +585,16 @@ export default function (pi: ExtensionAPI) {
|
|
|
553
585
|
}
|
|
554
586
|
// 敲门不再自己 send-keys:交给 teamsmith 的投递守卫 + 延后队列(delivery-guard)。
|
|
555
587
|
// 为什么:扩展原来直接 `send-keys -l` + Enter,人正在 PM 输入框里写草稿时会把草稿粘走
|
|
556
|
-
// (D20
|
|
588
|
+
// (D20 的原始事故)。入队时带上 knock 自己的**行身份**(lineIdentity),两层抑制不会打架。
|
|
557
589
|
// 失败只记日志:绝不回退到打字(那会悄悄重建同一个 bug)。
|
|
558
590
|
const notice = `${dirtyFlag}${tag} ${summary}${revStamp}${completed && last ? `\n> ${last}` : ''}`
|
|
559
|
-
const cli = join(skillDir(), 'scripts/team')
|
|
560
591
|
const tmp = join(stateDir, `knock-${process.pid}-${Date.now()}.txt`)
|
|
561
592
|
try {
|
|
562
593
|
writeFileSync(tmp, notice)
|
|
563
594
|
const out = execFileSync(
|
|
564
595
|
'bash',
|
|
565
596
|
[cli, '--root', root, 'outbox', 'enqueue', '--kind', 'knock', '--target', target,
|
|
566
|
-
'--from', agent, '--dedup',
|
|
597
|
+
'--from', agent, '--dedup', lineIdentity, '--from-file', tmp],
|
|
567
598
|
{ encoding: 'utf8', timeout: 5000 },
|
|
568
599
|
)
|
|
569
600
|
log(`knock queued (${String(out).trim() || 'entry written'})`, cfg)
|