teamsmith 0.1.2 → 0.2.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 +39 -0
- package/skills/teamsmith/SKILL.md +18 -7
- package/skills/teamsmith/references/agent-adapters.md +7 -7
- package/skills/teamsmith/references/config.md +29 -15
- package/skills/teamsmith/references/migration.md +38 -2
- package/skills/teamsmith/references/protocol.md +81 -13
- package/skills/teamsmith/references/workflows.md +31 -19
- package/skills/teamsmith/scripts/lib/cmd-agents.sh +210 -70
- package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +70 -9
- package/skills/teamsmith/scripts/lib/cmd-config.sh +222 -70
- 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-project.sh +134 -17
- package/skills/teamsmith/scripts/lib/cmd-reply.sh +96 -0
- package/skills/teamsmith/scripts/lib/cmd-review.sh +13 -10
- package/skills/teamsmith/scripts/lib/cmd-status.sh +42 -13
- package/skills/teamsmith/scripts/lib/cmd-watch.sh +75 -13
- package/skills/teamsmith/scripts/lib/common.sh +797 -71
- package/skills/teamsmith/scripts/monitor.mjs +34 -3
- package/skills/teamsmith/scripts/panel/README.md +22 -11
- package/skills/teamsmith/scripts/panel/panel.js +217 -215
- package/skills/teamsmith/scripts/panel/src/App.tsx +421 -164
- package/skills/teamsmith/scripts/panel/src/data.ts +84 -4
- package/skills/teamsmith/scripts/panel/src/layout.ts +502 -91
- package/skills/teamsmith/scripts/panel/src/main.tsx +97 -12
- package/skills/teamsmith/scripts/panel/src/settings.ts +1 -1
- package/skills/teamsmith/scripts/panel/src/strings/en.ts +56 -21
- package/skills/teamsmith/scripts/panel/src/strings/zh.ts +56 -21
- package/skills/teamsmith/scripts/panel/src/types.ts +178 -16
- package/skills/teamsmith/scripts/replies.mjs +893 -0
- package/skills/teamsmith/scripts/team +1 -0
- package/skills/teamsmith/templates/AGENTS.section.md.tmpl +15 -2
- 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 +10 -5
- package/skills/teamsmith/templates/memory-seed.md.tmpl +3 -0
- package/skills/teamsmith/templates/pm-prompt.md.tmpl +20 -1
- package/skills/teamsmith/templates/report.md.tmpl +12 -0
- package/skills/teamsmith/templates/task.md.tmpl +4 -0
- package/skills/teamsmith/tests/config-cli.sh +162 -288
- package/skills/teamsmith/tests/death-cause.sh +5 -2
- package/skills/teamsmith/tests/install-shape.sh +4 -2
- package/skills/teamsmith/tests/key-replies-pty.sh +375 -0
- package/skills/teamsmith/tests/key-replies-ui.sh +332 -0
- package/skills/teamsmith/tests/key-replies.sh +1075 -0
- package/skills/teamsmith/tests/ledger-ban.sh +4 -4
- package/skills/teamsmith/tests/ledger-claim.sh +247 -0
- package/skills/teamsmith/tests/lib/model-policy.sh +26 -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 +136 -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 +372 -0
- package/skills/teamsmith/tests/lib/tmux-iso.sh +8 -0
- package/skills/teamsmith/tests/panel-b2.sh +1 -1
- package/skills/teamsmith/tests/panel-b3-stub.sh +27 -0
- package/skills/teamsmith/tests/panel-b3.sh +14 -10
- package/skills/teamsmith/tests/panel-choices.sh +74 -61
- package/skills/teamsmith/tests/panel-cpu.sh +1 -1
- package/skills/teamsmith/tests/panel-p21.sh +311 -190
- package/skills/teamsmith/tests/perf.sh +1 -1
- 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 +43 -22
- package/skills/teamsmith/tests/section-budgets.tsv +8 -4
- package/skills/teamsmith/tests/section-paths.tsv +26 -16
- package/skills/teamsmith/tests/section-select.sh +82 -6
- package/skills/teamsmith/tests/smoke.sh +782 -180
- 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 +1014 -0
- package/skills/teamsmith-init/SKILL.md +38 -38
- package/skills/teamsmith-init/references/bootstrap.md +6 -4
- 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.2.0 # user level: every project
|
|
60
|
+
pi install -l git:git@github.com:Track07-cda/teamsmith@v0.2.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.2.0`) uses your SSH key and works
|
|
66
|
+
whether or not you have a token; the shorthand `git:github.com/Track07-cda/teamsmith@v0.2.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.2.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,45 @@
|
|
|
5
5
|
> `SKILL.md`/`references/**`/`templates/**`/`extension/**` 在 Pi 里输入 `/reload`(或 `/pi-team-reload`)即生效;
|
|
6
6
|
> 判断自己是不是旧的:`team mark-loaded`(开局记一次)→ `team version --check`。
|
|
7
7
|
|
|
8
|
+
## v0.2.0 · 2026-10-14
|
|
9
|
+
|
|
10
|
+
功能版:**按任务类别分配模型**(含破坏式配置迁移)、**Pulse 关键回复页**,以及长作业车道的提示词侧。
|
|
11
|
+
|
|
12
|
+
### ⚠️ 破坏性变化:项目的模型配置换形状
|
|
13
|
+
|
|
14
|
+
旧的 `TEAM_AGENT_MODELS`(按席位)与 `TEAM_DEFAULT_MODEL` **不再被接受**:旧项目在任何写入之前就被拒绝,
|
|
15
|
+
并指向升级命令。新形状是「**任务类别 → 模型**的映射 + PM 自己的模型」:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
team config upgrade-models --task-models 'code=provider/model verify=… analysis=…' --pm-model 'provider/model'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
语义上也变了:**一个任务固定一个模型与会话**——续跑复用该任务记录里的模型与会话(不再回落到席位配置),
|
|
22
|
+
**换模型必须新会话**(因为闭源模型的推理状态不能跨模型接续;这条是 Pi 的边界,Teamsmith 只约束自己的调用)。
|
|
23
|
+
|
|
24
|
+
- **任务类别模型路由**(task-model-routing):派单按任务书的 `category:` 解析模型(`--model` 仍可显式覆盖);
|
|
25
|
+
类别词汇是**项目数据**(`routine/analysis/verify` 只是示例,不是引擎的固定集合,映射为空才非法);
|
|
26
|
+
派单预览与 `team ps` 显示类别、最终模型与来源;面板新增类别编辑与「策略 vs 实际」分离的读面。
|
|
27
|
+
- **Pulse 关键回复页**(pulse-key-replies):`team reply post` 显式发布一份要保留的正文(只从 stdin 读),
|
|
28
|
+
固定槽位索引 + 不可变原文 + 文件锁;面板第五页按时间列出并能看全文——**PM 的关键答复不再被聊天流埋掉**。
|
|
29
|
+
- **长作业车道:工人提示词侧**(long-job-suspend B 刀):开场简报把「挂起等作业」写成**第三种合法回合结束
|
|
30
|
+
状态**(交付 / 硬阻塞 / 挂起),并要求点名在等哪个作业;「必须回合结束前收割」的旧措辞清零。
|
|
31
|
+
配套:`state/bg.log` 的 `start`/`wait` 记录让「起了就等」可数,收件箱标签把挂起与中断分开(A 刀在 0.1.2)。
|
|
32
|
+
|
|
33
|
+
### 门禁与工具面
|
|
34
|
+
|
|
35
|
+
- **路由前门进闸门**(P238):13 组路由测试以前只能手工跑,现在 `§61`(FAST 12 组 / live 13 组)承接;
|
|
36
|
+
`§61b` 是 22 臂变异自检(live 专跑、FAST 里可见跳过);**每一组单独可跑**(此前 `pm` 组单独跑会因缺前置
|
|
37
|
+
连锁红 29 条);选段归属不再把新测试文件归到无关段。
|
|
38
|
+
- **账本禁令对报告类改动开火**(P239):账本文本的任何改动都会选中 `§60`,归属于承载检查的那一段;
|
|
39
|
+
扫描面从「只读 `.md`」扩到 `docs/team` 下**每个会被提交的文件**(`ledger/*.tsv` 从前是盲区,植入泄漏会假绿)。
|
|
40
|
+
- **归档前置判据认 squash 合并**(P244):`team change status` 的「分支是否已并入」改用内容等价判定
|
|
41
|
+
(`-z` 逐字节读路径,非 ASCII / 含引号 / 含反斜杠的路径名不再造成**假阳**)。
|
|
42
|
+
- **发布检查跟上改写后的形状**(P247):取「HEAD 可达的最新 tag」并提示不在历史里的旧 tag
|
|
43
|
+
(本仓那 29 个已删);`team init` 路线按新配置合同传参。
|
|
44
|
+
- **临时根与容量**(P141/P144):派单前的容量地板增加磁盘/inode 两腿;陈旧夹具根的清扫有安全下限。
|
|
45
|
+
- 本版另修了预算表两行的 band 规则、以及 PM 记错合并选段的流程问题(见 `docs/team/DECISIONS.md`)。
|
|
46
|
+
|
|
8
47
|
## v0.1.2 · 2026-10-13
|
|
9
48
|
|
|
10
49
|
补丁版:把「长作业车道」的工具侧修复和发布机器一起发出去。
|
|
@@ -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.2.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# teamsmith · one agent that actually owns the project
|
|
@@ -48,20 +48,21 @@ 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 | `team reply post --from <seat> --title "<short>" --stdin` (publish the body you are about to send; 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` |
|
|
@@ -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
|
|
@@ -241,6 +246,12 @@ about them). They stay writable so the seam can be maintained and diagnosed; to
|
|
|
241
246
|
## Non-negotiable rules (verified during review)
|
|
242
247
|
- **Never claim something passed without having run it.** Reports must include commands and output tails; the PM
|
|
243
248
|
re-runs independently.
|
|
249
|
+
- **Publish the body before you answer.** Before sending a substantive answer, publish that same body with
|
|
250
|
+
`team reply post --from <seat> --title "<short>" --stdin`, then send the answer normally — saved, input error,
|
|
251
|
+
storage error, busy or unconfirmed never changes what you send (the failure notice goes to stderr, never into the
|
|
252
|
+
answer). A saved receipt means project-local durable publication only: not user delivery, not approval, not read
|
|
253
|
+
status, not a refreshed console, and it creates no pending work, no outbox/inbox entry and no wake-up. See
|
|
254
|
+
`references/protocol.md` §4b.
|
|
244
255
|
- Agents only touch directories they own (`OWNERSHIP.md`); cross-directory needs → write `BLOCKED:` in the report.
|
|
245
256
|
- Agents must not push the protected branch, force-push, merge PR/MRs, or rebase/delete other people's branches.
|
|
246
257
|
- Tokens live in project token files (`TEAM_TOKEN_FILE` / `TEAM_GITLAB_TOKEN_FILE`, gitignored) and are injected by
|
|
@@ -59,7 +59,7 @@ malformed one such as `{ cwd }` all fail loudly, and the error names `TEAM_PM_CM
|
|
|
59
59
|
|
|
60
60
|
- `{cwd}` — the project's **main worktree** (the PM's working directory)
|
|
61
61
|
- `{session_id}` — `TEAM_PM_SESSION_ID`, empty by default (only meaningful if your CLI has its own session ids)
|
|
62
|
-
- `{model}` — the model-name part of `TEAM_PM_MODEL` (
|
|
62
|
+
- `{model}` — the model-name part of the independent `TEAM_PM_MODEL` (required; the PM has no worker fallback)
|
|
63
63
|
- `{provider}` — the provider part
|
|
64
64
|
- `{prompt_file}` — path of `state/pm-prompt.md`, the PM briefing (`team up --print` prints the same text)
|
|
65
65
|
- `{prompt}` — `"$0"`: the briefing as a single argv token handed over by the window harness (keep the quotes)
|
|
@@ -171,10 +171,10 @@ Rules:
|
|
|
171
171
|
- The template's first word must be a **bare executable name** (no quotes): `TEAM_AGENT_BIN`, `team doctor` and the
|
|
172
172
|
window-readiness wait resolve it with `command -v`, which cannot see `"my agent"`. If your CLI really has a space
|
|
173
173
|
in its name, set `TEAM_AGENT_BIN` to its absolute path.
|
|
174
|
-
- `{model}`/`{provider}` come from
|
|
175
|
-
`
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
- `{model}`/`{provider}` come from the dispatch's **selected launch identity** — the brief's task category
|
|
175
|
+
resolved through `TEAM_TASK_MODELS`, or an explicit `team dispatch --model` override — not from the CLI and not
|
|
176
|
+
from a per-seat key. Set the category mapping so `{model}` matches what the CLI really uses; that also keeps
|
|
177
|
+
`TEAM_MODEL_LIMITS` (model concurrency) meaningful.
|
|
178
178
|
- The rendered command is executed by `bash -lc` in the window; the usual quoting rules of your shell
|
|
179
179
|
apply, and nothing is `eval`-ed twice.
|
|
180
180
|
- **The first word is resolved, not guessed** (the same rule as the PM side, §2): the window shell is
|
|
@@ -566,7 +566,7 @@ TEAM_AGENT_CMD='codex exec -C {cwd} -m {model} -s workspace-write "$(cat {prompt
|
|
|
566
566
|
TEAM_AGENT_BIN="$HOME/.bun/bin/codex"
|
|
567
567
|
TEAM_AGENT_NOTIFY_CMD='bash {skill_dir}/scripts/team notify pm --from {agent} --from-file {summary_file}'
|
|
568
568
|
TEAM_AGENT_LOG_GLOB='~/.codex/sessions/**/*.jsonl'
|
|
569
|
-
|
|
569
|
+
TEAM_TASK_MODELS="routine=openai/gpt-5.6-terra analysis=openai/gpt-5.6-terra" # {model} → the category's model (here gpt-5.6-terra)
|
|
570
570
|
```
|
|
571
571
|
|
|
572
572
|
Notes:
|
|
@@ -592,7 +592,7 @@ TEAM_AGENT_CMD='opencode run --model {provider}/{model} --dir {cwd} "$(cat {prom
|
|
|
592
592
|
TEAM_AGENT_BIN="$HOME/.opencode/bin/opencode"
|
|
593
593
|
TEAM_AGENT_NOTIFY_CMD='bash {skill_dir}/scripts/team notify pm --from {agent} --from-file {summary_file}'
|
|
594
594
|
TEAM_AGENT_LOG_GLOB='~/.local/share/opencode/log/*.log'
|
|
595
|
-
|
|
595
|
+
TEAM_TASK_MODELS="routine=google/gemini-3-flash-preview"
|
|
596
596
|
```
|
|
597
597
|
|
|
598
598
|
**Verified end-to-end on this machine** (no Pi involved): `team dispatch` started opencode in the agent
|
|
@@ -40,10 +40,10 @@ literals or simple `$VAR`.
|
|
|
40
40
|
| `TEAM_SESSION` | `$TEAM_PROJECT` | tmux session (shared by the PM and every agent) |
|
|
41
41
|
| `TEAM_PM_WINDOW` | `pm` | the window the PM session lives in; notifications are typed there |
|
|
42
42
|
| `TEAM_AGENTS` | empty (`init` sets `dev verify`) | roster, space separated; grows only through `team add-agent <a> --register` and shrinks only through `team teardown --agent <a> --register` (both audited; a bare `team add-agent <a>` refuses a seat the roster does not carry and names both routes) |
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
43
|
+
| `TEAM_TASK_MODELS` | empty (required) | the project's task-category → model map: `routine=provider/light analysis=provider/strong verify=provider/strong`. A **new** dispatch selects the model of the brief's `category:` from it; a complete same-task recovery keeps the model/SID it was already assigned, even after the category leaves the map. One category: `team config set-task-model <category> <model>`; the whole map: `team config set TEAM_TASK_MODELS '<map>' --yes`; breaking migration: `team config upgrade-models` |
|
|
44
|
+
| `TEAM_PM_MODEL` | empty (required) | the **independent PM model** — never a fallback to a task model or a worker default. `team up` guards it (a running PM with a different model needs an explicit `--fresh-pm`) |
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Categories are the project's own vocabulary (`[a-z][a-z0-9-]*`, unique): routine/analysis/verify are the initial example, not an engine list, and `phase:`/seat never selects a model automatically. The initial suggestion is `routine=opencode-go/deepseek-v4.1-flash`, `analysis`/`verify=openai-codex/gpt-6.1-sol:high`, independent PM the same strong model — examples, not defaults or a provider-availability claim. The retired keys TEAM_AGENT_MODELS / TEAM_DEFAULT_MODEL are no longer read: a project that still carries them is refused by the loader and by init/bootstrap, and migrates through the explicit `team config upgrade-models --task-models '<map>' --pm-model '<model>'` transaction (preview first, then `--yes`) — never through `team init --force`, bootstrap or an inference.
|
|
47
47
|
| `TEAM_MODEL_LIMITS` | `kimi-coding/k3=2` | concurrency limits, `provider/model=N` space separated; `0` = unlimited |
|
|
48
48
|
| `TEAM_EXTRA_PI_ARGS` | empty | extra arguments passed to pi (space separated, values with spaces are unsupported) |
|
|
49
49
|
|
|
@@ -135,7 +135,6 @@ long-running TUI keep today's tick semantics (one patrol tick per `TEAM_PULSE_IN
|
|
|
135
135
|
`--no-watchdog`, keeps the panel and stops the ticks). A missing runtime is a loud failure in every mode, never an
|
|
136
136
|
empty panel reported as success.
|
|
137
137
|
|
|
138
|
-
| `TEAM_PM_MODEL` | empty | the PM's own model; empty = `TEAM_DEFAULT_MODEL` |
|
|
139
138
|
| `TEAM_PM_SESSION_ID` | empty | empty = `pi -c` (continue the previous session in this directory, keeping the PM's history). Explicit session id for a CLI whose session concept you control (`{session_id}` in `TEAM_PM_CMD`); on the built-in Pi path it still becomes `--session-id <id>` |
|
|
140
139
|
| `TEAM_PM_EXTRA_PI_ARGS` | empty | extra pi arguments for the PM (`{extra_args}` in a `TEAM_PM_CMD` template) |
|
|
141
140
|
| `TEAM_PM_CMD` | empty | **launch template for the PM's own CLI** (the PM side of the adapter, M8.1). Placeholders: `{cwd}` `{session_id}` `{model}` `{provider}` `{prompt_file}` `{prompt}` `{skill_dir}` `{extra_args}` `{resume_args}`. Empty = the built-in Pi command, byte-for-byte the pre-M8.1 behaviour; the rules (unknown/malformed placeholder, blank or multi-line template) are shared with `TEAM_AGENT_CMD` and fail loudly. See [agent-adapters.md](agent-adapters.md) §2. A start that fails leaves a diagnosis (window output, the rendered command, the CLI's exit code) in `state/pm-launch-failed.log`, and `team up` exits non-zero |
|
|
@@ -340,7 +339,7 @@ second source of truth: the value lives in the contract, the class table lives i
|
|
|
340
339
|
| class | meaning | examples |
|
|
341
340
|
|---|---|---|
|
|
342
341
|
| `apply` | the next process that reads the contract sees the new value | `TEAM_GATES`, the capacity floors, the review escape hatches, the patrol policy |
|
|
343
|
-
| `restart` | a running process holds the value it started with; the receipt names the target and the command | the pulse (`TEAM_PULSE_INTERVAL`, `TEAM_MONITOR_REFRESH`),
|
|
342
|
+
| `restart` | a running process holds the value it started with; the receipt names the target and the command | the pulse (`TEAM_PULSE_INTERVAL`, `TEAM_MONITOR_REFRESH`), the PM's model (`TEAM_PM_MODEL` — a running PM keeps it until an explicit `--fresh-pm` restart), a live session (`TEAM_INBOX_WATCH_*`) |
|
|
344
343
|
| `refuse` | not the console's to change: the project's identity, the roster, the ledger's layout, the branch/forge definitions, the authority guards, the dependency policy and the machine paths Pi's own state is read from — the console may not widen its own authority and may not move the ledger it is reading | `TEAM_PROJECT`, `TEAM_AGENTS` (route: `team add-agent <a> --register` / `team teardown --agent <a> --register`), `TEAM_STATE_DIR`, `TEAM_PROTECTED_BRANCH`, `TEAM_ALLOW_FOREIGN_IDENTITY` … |
|
|
345
344
|
|
|
346
345
|
A key the schema does not know is listed read-only ("not a known project setting", pointing at this file) and is
|
|
@@ -366,7 +365,7 @@ The vocabulary is exactly these twelve tokens; the visible heading is the table
|
|
|
366
365
|
| `branch` | branch semantics and forge | `TEAM_BRANCH_MODE`, `TEAM_GITLAB_HOST` |
|
|
367
366
|
| `policy` | permission and dependency policy | `TEAM_ALLOW_FOREIGN_IDENTITY`, `TEAM_REQUIRE_JS` |
|
|
368
367
|
| `roster` | roster, model resolution and adapters | `TEAM_AGENT_CMD`, `TEAM_AGENT_BIN`, `TEAM_MODEL_LIMITS` |
|
|
369
|
-
| `
|
|
368
|
+
| `task-model` | task category policy and the independent PM model | `TEAM_TASK_MODELS`, `TEAM_PM_MODEL` |
|
|
370
369
|
| `workflow` | workflow and gates | `TEAM_GATES`, `TEAM_REVIEW_TIMEOUT` |
|
|
371
370
|
| `delivery` | capacity and delivery notices | `TEAM_MIN_AVAIL_MB`, `TEAM_TMP_MIN_FREE_MB`, `TEAM_DEFER_TTL` |
|
|
372
371
|
| `panel` | pulse and console | `TEAM_PULSE_INTERVAL`, `TEAM_MONITOR_REFRESH` |
|
|
@@ -413,17 +412,33 @@ name. Danger never makes an invalid value legal.
|
|
|
413
412
|
```sh
|
|
414
413
|
team config list --json
|
|
415
414
|
team config set TEAM_PULSE_NUDGE_GAP 1200 --dry-run
|
|
416
|
-
team config set-
|
|
415
|
+
team config set-task-model routine deepseek/deepseek-flash --dry-run
|
|
416
|
+
team config set TEAM_PM_MODEL deepseek/deepseek-flash --dry-run
|
|
417
|
+
team config upgrade-models --task-models 'routine=deepseek/deepseek-flash analysis=xai/grok-4.6' --pm-model deepseek/deepseek-flash --dry-run
|
|
417
418
|
team config log 5
|
|
418
419
|
```
|
|
419
420
|
|
|
420
421
|
`0` written/valid · `3` fingerprint conflict (nothing written) · `4` invalid value · `5` key not editable ·
|
|
421
422
|
`6` write error (file unchanged) · `7` dangerous (a `--dry-run` reports it too). `team config set … --fingerprint
|
|
422
423
|
<sha256>` is a compare-and-swap: any byte change since the read refuses it, and a write without the flag is the
|
|
423
|
-
caller's explicit "use the file as it is now".
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
caller's explicit "use the file as it is now".
|
|
425
|
+
|
|
426
|
+
**The three model front doors.** `team config set-task-model <category> <model>` upserts exactly one category in
|
|
427
|
+
TEAM_TASK_MODELS (through the same checked writer, so category values are validated and the rest of the map is
|
|
428
|
+
preserved byte for byte); a new category is legal, an empty map is not, and removing a category is done by setting
|
|
429
|
+
the whole map (`team config set TEAM_TASK_MODELS '<remaining map>' --yes`) — which limits future selection but does
|
|
430
|
+
not invalidate a complete same-task assignment. `team config set TEAM_PM_MODEL <model>` writes the independent PM
|
|
431
|
+
model. `team config upgrade-models --task-models '<map>' --pm-model '<model>'` is the one **breaking migration**
|
|
432
|
+
transaction: it previews with `--dry-run`, writes only with `--yes`, replaces the four model keys (the two retired
|
|
433
|
+
worker keys are removed, the two new keys upserted) and keeps every other byte; its relevant-line grammar
|
|
434
|
+
(top-level unique literal assignments, optional inline comments) refuses export/duplicate/multiline/dynamic shapes
|
|
435
|
+
with the file and line named, and the repair is a hand-normalized literal line. The retired `set-agent-model`
|
|
436
|
+
route exits 5 pointing at these; `team add-agent --model` is retired too (a seat is a name in the roster, not a
|
|
437
|
+
model identity).
|
|
438
|
+
|
|
439
|
+
`team task --category` is only the **brief generator**: it writes the brief's `category:` header and nothing else —
|
|
440
|
+
it never selects or overrides a dispatch's model, and `team task` takes no model flag. The header is read by
|
|
441
|
+
`team dispatch` (which resolves it through the map), and only `team dispatch --model` overrides one launch.
|
|
427
442
|
|
|
428
443
|
**The roster's two authorized entries.** `TEAM_AGENTS` keeps class `refuse` — `team config set TEAM_AGENTS …`
|
|
429
444
|
still exits 5 and points at these entries instead. `team add-agent <a> --register` and `team teardown --agent <a>
|
|
@@ -433,10 +448,9 @@ still exits 5 and points at these entries instead. `team add-agent <a> --registe
|
|
|
433
448
|
semantics (documented here, not printed in `team help`); a stale fingerprint exits 3 with one `result=conflict`
|
|
434
449
|
line and nothing written. `--register` on a seat already in the roster is a visible no-op (exit 0, no write, no
|
|
435
450
|
audit line); `team teardown --agent <a>` without the flag leaves the roster byte-identical (today's default).
|
|
436
|
-
`team add-agent <a>` for a seat outside the roster
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
pairlist serializer as `set-agent-model` (`-` removes the override). Every attempt that passes argument parsing appends one line to `<state>/config.log`
|
|
451
|
+
`team add-agent <a>` for a seat outside the roster exits 5 naming both routes (hand-edit `.pi/team/config.sh`, or
|
|
452
|
+
add `--register`) and touches nothing else; the retired `--model` flag is refused with a pointer at the task-
|
|
453
|
+
category writers. Every attempt that passes argument parsing appends one line to `<state>/config.log`
|
|
440
454
|
(`<UTC ISO-8601> result=<ok|refused|invalid|conflict|danger-refused|write-error> actor=… key=… old='…' new='…'`,
|
|
441
455
|
plus `expected=`/`actual=` on a conflict); `team config log [N]` and `list --json`'s audit tail read at most the
|
|
442
456
|
file's last 16 KiB and print at most N lines (default 10).
|
|
@@ -14,7 +14,7 @@ session) and for anyone deciding whether upgrading is safe.
|
|
|
14
14
|
| Surface | Why it does not move |
|
|
15
15
|
|---|---|
|
|
16
16
|
| the `team` CLI | sub-commands are only ever **removed**, never renamed in place; everything that still exists keeps its name and flags |
|
|
17
|
-
| `.pi/team/config.sh` | sourced by bash, flat `TEAM_*` keys; new keys ship with a default, so a config written years ago keeps working |
|
|
17
|
+
| `.pi/team/config.sh` | sourced by bash, flat `TEAM_*` keys; new keys ship with a default, so a config written years ago keeps working (the one exception is the breaking model-policy upgrade — §5b) |
|
|
18
18
|
| `TEAM_*` environment variables | override the config file (env beats config) and are read that way in every version |
|
|
19
19
|
| the `docs/team/**` layout | `tasks/ reports/ reviews/ threads/ inbox/` plus `BOARD.md ROADMAP.md OWNERSHIP.md DECISIONS.md PROTOCOL.md` |
|
|
20
20
|
| `docs/team/BOARD.md` columns | `ID · task · agent · branch · deps · status`, with the status vocabulary `todo/wip/review/done/blocked/dropped` |
|
|
@@ -137,6 +137,40 @@ one-line reaction.
|
|
|
137
137
|
| the PM's own CLI is configurable (`TEAM_PM_CMD` / `TEAM_PM_BIN` / `TEAM_PM_RESUME_ARGS`) | M8.1 | nothing to do — all three keys are empty by default and the built-in Pi command is byte-for-byte unchanged. They belong to the internal seam (frozen): reserved for a possible future non-Pi adapter, no compatibility promise — the PM side runs Pi (`references/agent-adapters.md` §2) |
|
|
138
138
|
| the console brings three state files and one changed default: `TEAM_MONITOR_REFRESH` drops `5` → `3` | v1.38.0 (pulse-console B3) | the TUI keeps its own preferences in `state/panel.conf` (`lang`, `page`, `activity`, `mouse`, `density` and an optional `theme`), remembers the last page in `state/panel-page`, and holds the PM's compose draft in `state/draft.md`. All three are runtime state: deleting them is safe and `--print`/`--json` never read them. Set `TEAM_MONITOR_REFRESH=5` to keep the old cadence (`references/config.md` lists the key) |
|
|
139
139
|
|
|
140
|
+
## 5b. The breaking model-policy upgrade (task categories)
|
|
141
|
+
|
|
142
|
+
This is the one upgrade that needs an explicit transaction instead of a re-render. The retired keys
|
|
143
|
+
TEAM_AGENT_MODELS and TEAM_DEFAULT_MODEL are no longer read (an old seat model is **not** reinterpreted as a task
|
|
144
|
+
model): a project that still carries them is refused by `team dispatch`/`team up` and by `team init`/
|
|
145
|
+
`team bootstrap` — before any install, ledger, worktree or pulse work — and the repair is the dedicated
|
|
146
|
+
four-key transaction:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
team config upgrade-models --task-models 'routine=<model> analysis=<model> verify=<model>' --pm-model '<model>' # preview: prints the diff, writes nothing
|
|
150
|
+
team config upgrade-models --task-models '…' --pm-model '<model>' --yes # the one write
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
It rewrites only those keys through the checked writer (temp file → `bash -n` → fingerprint CAS → atomic rename →
|
|
154
|
+
one audit line), turns a removed line's inline comment into a standalone one and leaves every other byte alone.
|
|
155
|
+
Shapes it cannot locate unambiguously (export/multiline/variable expansion/duplicate keys) are refused with the
|
|
156
|
+
file and line plus the manual-normalization route. `team init --force`, `bootstrap` and inference are **not**
|
|
157
|
+
migration routes; a fresh project passes `--task-models`/`--pm-model` to `init`/`bootstrap` instead.
|
|
158
|
+
|
|
159
|
+
After the policy is in place: a **new** dispatch takes the brief's `category:` model (routine for bounded ordinary
|
|
160
|
+
implementation, analysis for complex planning/judgment, verify for independent adversarial review — or the
|
|
161
|
+
project's own names), while a running/completed assignment keeps its recorded model/SID and is never rewritten by
|
|
162
|
+
the upgrade; a brief must carry a `category:` header before it can be dispatched again; the PM's own model is
|
|
163
|
+
`TEAM_PM_MODEL`, and a running PM on a different model is continued only with `team up --fresh-pm`.
|
|
164
|
+
|
|
165
|
+
The operations around a source upgrade are **separate recorded gates**, each previewed and authorized per command:
|
|
166
|
+
private source verification; landing validated source on a shared/protected tree; writing this project's
|
|
167
|
+
configuration (and the first fresh launch that reads it); and adopting a changed shared skill source. A shared
|
|
168
|
+
skill link (e.g. `~/.agents/skills/teamsmith` → this checkout's `skills/teamsmith`) reads its target's **current**
|
|
169
|
+
bytes, so changing that target affects later reads in other projects even without an installer; before landing,
|
|
170
|
+
either isolate the known shared consumers to preserved stable source and verify the isolation, or obtain explicit
|
|
171
|
+
approval of the identified shared impact. No partial slice should land on a shared main, and no zero-impact
|
|
172
|
+
promise is made for unknown consumers.
|
|
173
|
+
|
|
140
174
|
## 6. Upgrade recipe
|
|
141
175
|
|
|
142
176
|
Replace `<skill checkout>` with the git checkout the installed skill points at (`team paths` prints it).
|
|
@@ -154,7 +188,9 @@ team version --check
|
|
|
154
188
|
team doctor
|
|
155
189
|
|
|
156
190
|
# 4) re-render this project's contracts (idempotent: config is kept, the AGENTS.md
|
|
157
|
-
# section is refreshed in place, and a legacy marker is rewritten to the new one)
|
|
191
|
+
# section is refreshed in place, and a legacy marker is rewritten to the new one).
|
|
192
|
+
# A config still carrying the retired model keys is REFUSED here — run the explicit
|
|
193
|
+
# migration first: team config upgrade-models --task-models '…' --pm-model '…' [--yes]
|
|
158
194
|
team init
|
|
159
195
|
|
|
160
196
|
# 5) the spec layer, only when openspec/ is missing
|
|
@@ -84,6 +84,16 @@ Guards and limitations:
|
|
|
84
84
|
earlier than the automatic one. The **recipient** names the durable inbox file (`docs/team/inbox/<agent>.md`);
|
|
85
85
|
the PM is still the **knock destination** — the queue entry's declaration and the wake pointer both name that
|
|
86
86
|
same recipient file, and a durable append that fails exits non-zero without a wake.
|
|
87
|
+
- **The turn-end notice separates three endings**, the same three turn-end states the worker prompt names: a
|
|
88
|
+
**completed** turn with no job of that session still running is `[auto]`; the same turn with live jobs is
|
|
89
|
+
`[auto·suspended]`, carrying `awaiting=<id>[,<id>…]`; an **unfinished** turn stays `[auto·interrupted]` (with
|
|
90
|
+
`awaiting=` too when its jobs are alive). A suspension omits the `⚠ 未提交` prefix — it is not a delivery claim —
|
|
91
|
+
while `uncommitted=<n>` stays. The three states are **delivered**, **hard-blocked** and
|
|
92
|
+
**suspended on background jobs**, and the lane rule is the suspend default: `team_bg_run` starts a long job and
|
|
93
|
+
the turn ends; the completion wake-up is the normal harvest point; in-turn waiting is the bounded exception,
|
|
94
|
+
only inside the inline-wait budget (about 2 minutes), when the result blocks the next step and nothing else can
|
|
95
|
+
advance. A seat that suspended and then died needs no new patrol clause: an unfinished task with no live window
|
|
96
|
+
is already pending work (§8).
|
|
87
97
|
- The **other** injected extension is `extension/team-bg.ts` (M27) — not notification, but the team's own
|
|
88
98
|
background lane: `team_bg_run` starts a detached job (bounded `state/bg/<id>.log`), `team_bg_wait <id>` harvests
|
|
89
99
|
it, a harvested job stays silent, several finishing jobs arrive as one message, and every turn end appends
|
|
@@ -119,10 +129,44 @@ Guards and limitations:
|
|
|
119
129
|
call appends one line to `state/signal-calls.log` (`TEAM_SIGNAL_CALLS_LOG`), and a refusal is also copied byte
|
|
120
130
|
for byte into `<log>.forensics` so it outlives the call log's rotation.
|
|
121
131
|
|
|
132
|
+
## 4b. Key replies: publish the body before you answer
|
|
133
|
+
|
|
134
|
+
The wake-up loop carries a *pointer* (`inbox/<agent>.md` plus a knock), and the report carries the *process*. Neither
|
|
135
|
+
carries the **body** of a substantive answer, and both are transient or post-hoc: the inbox is gitignored, and a report
|
|
136
|
+
is written after the work. When an answer itself is the durable artefact — a decision, a trade-off, a root cause, a
|
|
137
|
+
finding someone will quote weeks later — publish that body explicitly before you send it:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
team reply post --from <seat> --title "<short single line>" --stdin <<'EOF'
|
|
141
|
+
… the exact body you are about to send …
|
|
142
|
+
EOF
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Then send the answer normally. Publication **never gates the answer**: the same body goes out whether the post
|
|
146
|
+
reported `saved` (0), an input error (2), storage unavailable (4), a busy writer (5, the lock wait is bounded) or
|
|
147
|
+
`unconfirmed` (6, the entry is visible but its durability could not be confirmed — never re-post it automatically).
|
|
148
|
+
Failures are diagnostics on stderr; they must not be concatenated into the answer, and they must not stop it.
|
|
149
|
+
|
|
150
|
+
What a receipt does and does not mean:
|
|
151
|
+
- **A saved receipt is project-local durable publication only.** It is not user delivery, not approval, not read
|
|
152
|
+
status, and not a refreshed console. Nothing else changes state: publishing creates no pending work, no BOARD row,
|
|
153
|
+
no outbox/inbox entry, no patrol wake-up, and no confirmation/reminder/approval lifecycle.
|
|
154
|
+
- **No new configuration key.** The capability is part of the tool, not a project setting.
|
|
155
|
+
- **Storage is project state, outside the published tree**: `<main_root>/.pi/team/state/key-replies/` holds a
|
|
156
|
+
fixed-size commit index plus the immutable originals (`team paths` resolves the root; the store never lands in
|
|
157
|
+
`docs/team/` or in a checkout). `list` / `show` / the console's summary are **observation-only**: they never
|
|
158
|
+
create, repair or lock anything, and a missing store stays missing.
|
|
159
|
+
- **Read it back with the tool, not by hand**: `team reply list [--before <no>] [--json]` pages the numbered slots
|
|
160
|
+
(newest first), `team reply show <no>` prints safe display text, `team reply show <no> --raw` exports the original
|
|
161
|
+
bytes to a non-TTY stdout, and the console's page 5 renders the latest reply plus the numbered history. Flags and
|
|
162
|
+
exit codes are in `team reply --help`.
|
|
163
|
+
- **The honest limit**: the fixtures can only prove that both exits carry the same body for a *fixture* agent. No tool
|
|
164
|
+
can verify that a real agent follows this guidance — so it is written here as a rule, not enforced by the store.
|
|
165
|
+
|
|
122
166
|
## 5. Task briefs: written for "a weak model without context"
|
|
123
167
|
|
|
124
|
-
The
|
|
125
|
-
ambiguous requirement on its own**, so a brief has to be self-contained:
|
|
168
|
+
The `routine` category usually runs a cheap, fast model (e.g. `opencode-go/deepseek-v4.1-flash`). It **will not
|
|
169
|
+
correct an ambiguous requirement on its own**, so a brief has to be self-contained:
|
|
126
170
|
|
|
127
171
|
- Background: why this is being done, where the relevant docs are (do not paste large chunks of code).
|
|
128
172
|
- Deliverables: file paths plus key signatures/behaviour, item by item.
|
|
@@ -180,14 +224,30 @@ exactly how a printed fix turned into `✗ dispatch: 未知参数 --force(…
|
|
|
180
224
|
with no override still refuses. A printed route is a promise, not decoration: `tests/routes.sh` applies every
|
|
181
225
|
`修法:`/`改行:` family in a fixture and reddens when a route stops clearing its blocker or is no longer honored.
|
|
182
226
|
|
|
183
|
-
## 6. Model strategy:
|
|
227
|
+
## 6. Model strategy: task categories; different families for verification
|
|
228
|
+
|
|
229
|
+
The contract maps **task categories** to models (`TEAM_TASK_MODELS`) and names one independent `TEAM_PM_MODEL`.
|
|
230
|
+
The brief's `category:` selects a new dispatch's model, `team dispatch --model` overrides one launch, and a
|
|
231
|
+
complete same-task recovery keeps the model/SID it was committed to (even if the category later leaves the map).
|
|
232
|
+
The engine never derives a model from a phase or a seat: "verify" is a project category name, not an automatic
|
|
233
|
+
phase→model mapping, so a project with other names says which one means independent review.
|
|
234
|
+
|
|
235
|
+
| Use | Category | Selection principle |
|
|
236
|
+
|---|---|---|
|
|
237
|
+
| Implementation/tests/docs | `routine` | a cheap model without concurrency limits; a good brief is enough |
|
|
238
|
+
| Complex planning / important architecture judgment | `analysis` | a strong model, with the reasoning recorded on disk (decision log/design), not only in a session |
|
|
239
|
+
| Independent verification/adversarial analysis | `verify` | switch model families (to avoid the same blind spots); a strong author model never waives independent review |
|
|
240
|
+
| Heavy concurrent work | any | the subscription token/quota is shared → cap concurrency with `TEAM_MODEL_LIMITS` and queue the rest; `team ps` shows occupancy |
|
|
241
|
+
|
|
242
|
+
Changing the policy changes **future** selections only. Redefining or dropping a category does not invalidate a
|
|
243
|
+
committed assignment: recovery uses the recorded model/SID, while a **new** task citing a dropped category is
|
|
244
|
+
refused. A running PM keeps its model until an explicit `team up --fresh-pm`, and a fresh takeover continues from
|
|
245
|
+
the files on disk (brief, report, thread, `state/`), never by replaying a conversation.
|
|
184
246
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
| Heavy review/hard problems | subscription quota is tight → cap concurrency with `TEAM_MODEL_LIMITS`, run one at a time |
|
|
190
|
-
| Long-context hard problems | slow and concurrency-limited; only when the PM explicitly asks |
|
|
247
|
+
Private source verification, protected-branch source landing, this project's configuration/fresh launch and shared
|
|
248
|
+
skill-source adoption are **four separate recorded gates**; each is previewed and authorized per operation. A
|
|
249
|
+
shared skill link reads its target's current bytes, so changing that target can affect other projects without an
|
|
250
|
+
installer.
|
|
191
251
|
|
|
192
252
|
`team dispatch` checks `TEAM_MODEL_LIMITS` and capacity before dispatching: the rules (from two OOM incidents on CEP,
|
|
193
253
|
one of which hit RAM and zram bottom at the same time):
|
|
@@ -456,7 +516,7 @@ unresolved `merge --squash` is caught by the next gate instead of reaching `main
|
|
|
456
516
|
A trap: an add/add conflict is often git's rename detection pairing two different paths (e.g. `reviews/<ID>.md` and
|
|
457
517
|
`reports/<ID>-<agent>.md`). Retry with `git -c merge.renames=false merge --squash <branch>` and it goes away.
|
|
458
518
|
|
|
459
|
-
## 8f. Template rendering and dispatch traps (measured on
|
|
519
|
+
## 8f. Template rendering and dispatch traps (measured on an external project)
|
|
460
520
|
|
|
461
521
|
- **Rendering must not go through sed**: `&` inside the replacement string means "the matched text", so
|
|
462
522
|
`TEAM_GATES="pnpm test && pnpm lint"` was written out as `pnpm test {{GATES}}{{GATES}} pnpm lint`. `team_render` now
|
|
@@ -465,7 +525,7 @@ A trap: an add/add conflict is often git's rename detection pairing two differen
|
|
|
465
525
|
`init` also escapes gate values containing `$ \` \ "` before writing them into the config, so sourcing it back
|
|
466
526
|
yields the same value as the input (and is never executed).
|
|
467
527
|
- **Dispatch writes absolute paths**: the window shell's PATH/rc may not be ready yet, so exec'ing `pi` directly ends
|
|
468
|
-
in `command not found` (reproduced twice on
|
|
528
|
+
in `command not found` (reproduced twice on an external project). Dispatch now resolves pi's absolute path first, writes it into the
|
|
469
529
|
window command, and checks that it exists before dispatching (a missing binary fails immediately instead of being
|
|
470
530
|
discovered inside the window).
|
|
471
531
|
- **GitLab API headers and bodies must match**: if `--data-urlencode` is the form body, then
|
|
@@ -628,7 +688,10 @@ turns into a red a fixture cannot explain.
|
|
|
628
688
|
Since 2026-10-04 the readable ledger — board, decisions, roadmap, ownership, briefs, the text of reports and
|
|
629
689
|
verification records, threads — is committed to the repository (D94). A brief or a report is therefore public the
|
|
630
690
|
moment it is written, and the one mechanical redaction pass that produced the first batch has no net behind it.
|
|
631
|
-
So the ban is a check in the gate: suite section `60` runs `tests/ledger-ban.sh`, which scans
|
|
691
|
+
So the ban is a check in the gate: suite section `60` runs `tests/ledger-ban.sh`, which scans every file under
|
|
692
|
+
`docs/team` that would be committed (`git ls-files -c -o --exclude-standard`; P231 widened this from `**/*.md`,
|
|
693
|
+
because the `.tsv` ledgers — precisely where branch and project names get written — were a blind spot: a planted
|
|
694
|
+
leak there came back green)
|
|
632
695
|
and fails, naming file and line, on
|
|
633
696
|
|
|
634
697
|
- a home directory (`/home/<name>…` or `/Users/<name>…`; the ellipsis placeholders `/home/.../` and `/home/…/` pass);
|
|
@@ -656,7 +719,12 @@ itself failed. Falsifiability lives in the fixture self-test (`bash tests/ledger
|
|
|
656
719
|
path and a planted forbidden name must come back red with file:line, a missing list must show the visible skip, a
|
|
657
720
|
shadow scanner whose hit counter is broken must make the two red cases fail, and a second shadow whose masking is
|
|
658
721
|
turned off must make the “no raw text in the output” cases fail — a mixed line, twenty-five occurrences on one line,
|
|
659
|
-
a placeholder standing before the hit (the offset must survive the blanking), and an over-long line.
|
|
722
|
+
a placeholder standing before the hit (the offset must survive the blanking), and an over-long line. P231 extends
|
|
723
|
+
both ends: the face itself is pinned by the ownership fixture (`tests/ledger-claim.sh`) — a planted name in a
|
|
724
|
+
`docs/team/ledger/*.tsv` must come back red naming that file and line, while a copy of the scanner whose face is
|
|
725
|
+
narrowed back to `*.md` must return `hits=0` on the same tree (the false green, reproduced) — and the header rules
|
|
726
|
+
(`# ledger-scan:` must be a single line and must point at the section that carries this check) are refused at load
|
|
727
|
+
time instead of at check time.
|
|
660
728
|
|
|
661
729
|
## 9c. Strong verification (adversarial package + finding flips, for milestones)
|
|
662
730
|
|