teamsmith 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/README.md +4 -4
  2. package/package.json +1 -1
  3. package/skills/teamsmith/CHANGELOG.md +69 -0
  4. package/skills/teamsmith/SKILL.md +20 -13
  5. package/skills/teamsmith/extension/team-inbox-watch.ts +5 -3
  6. package/skills/teamsmith/extension/team-notify.ts +37 -6
  7. package/skills/teamsmith/extension/team.ts +438 -0
  8. package/skills/teamsmith/references/config.md +39 -6
  9. package/skills/teamsmith/references/migration.md +197 -47
  10. package/skills/teamsmith/references/protocol.md +201 -30
  11. package/skills/teamsmith/references/troubleshooting.md +130 -10
  12. package/skills/teamsmith/references/workflows.md +36 -2
  13. package/skills/teamsmith/scripts/lib/cmd-agents.sh +318 -23
  14. package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +2 -2
  15. package/skills/teamsmith/scripts/lib/cmd-config.sh +349 -67
  16. package/skills/teamsmith/scripts/lib/cmd-draft.sh +4 -4
  17. package/skills/teamsmith/scripts/lib/cmd-help.sh +677 -0
  18. package/skills/teamsmith/scripts/lib/cmd-init.sh +157 -5
  19. package/skills/teamsmith/scripts/lib/cmd-interrupt.sh +461 -0
  20. package/skills/teamsmith/scripts/lib/cmd-meeting.sh +2 -25
  21. package/skills/teamsmith/scripts/lib/cmd-project.sh +30 -103
  22. package/skills/teamsmith/scripts/lib/cmd-reap.sh +277 -0
  23. package/skills/teamsmith/scripts/lib/cmd-reply.sh +3 -3
  24. package/skills/teamsmith/scripts/lib/cmd-review.sh +182 -32
  25. package/skills/teamsmith/scripts/lib/cmd-status.sh +234 -21
  26. package/skills/teamsmith/scripts/lib/cmd-update.sh +36 -7
  27. package/skills/teamsmith/scripts/lib/cmd-watch.sh +564 -46
  28. package/skills/teamsmith/scripts/lib/common.sh +1004 -245
  29. package/skills/teamsmith/scripts/lib/gate-lock.sh +582 -0
  30. package/skills/teamsmith/scripts/panel/draft-send.sh +11 -1
  31. package/skills/teamsmith/scripts/panel/panel.js +211 -211
  32. package/skills/teamsmith/scripts/panel/src/App.tsx +58 -21
  33. package/skills/teamsmith/scripts/panel/src/clipboard.ts +12 -5
  34. package/skills/teamsmith/scripts/panel/src/compose.ts +6 -3
  35. package/skills/teamsmith/scripts/panel/src/data.ts +51 -5
  36. package/skills/teamsmith/scripts/panel/src/layout.ts +209 -69
  37. package/skills/teamsmith/scripts/panel/src/main.tsx +37 -8
  38. package/skills/teamsmith/scripts/panel/src/strings/en.ts +39 -29
  39. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +41 -31
  40. package/skills/teamsmith/scripts/panel/src/types.ts +28 -3
  41. package/skills/teamsmith/scripts/replies.mjs +4 -1
  42. package/skills/teamsmith/scripts/shim/killall +10 -0
  43. package/skills/teamsmith/scripts/shim/pgrep +10 -0
  44. package/skills/teamsmith/scripts/shim/pidof +10 -0
  45. package/skills/teamsmith/scripts/shim/pkill +10 -0
  46. package/skills/teamsmith/scripts/shim/signal-gate +108 -31
  47. package/skills/teamsmith/scripts/shim/tmux +18 -0
  48. package/skills/teamsmith/scripts/strings/commands.tsv +86 -0
  49. package/skills/teamsmith/scripts/strings/help.en.tsv +503 -0
  50. package/skills/teamsmith/scripts/strings/help.zh.tsv +489 -0
  51. package/skills/teamsmith/scripts/team +19 -6
  52. package/skills/teamsmith/templates/AGENTS.section.md.tmpl +8 -1
  53. package/skills/teamsmith/templates/config.sh.tmpl +20 -1
  54. package/skills/teamsmith/templates/pm-prompt.md.tmpl +21 -0
  55. package/skills/teamsmith/tests/README.md +31 -0
  56. package/skills/teamsmith/tests/bg-ledger-harness.mjs +464 -40
  57. package/skills/teamsmith/tests/bg-ledger.sh +168 -10
  58. package/skills/teamsmith/tests/checkout-shape-probe.sh +83 -54
  59. package/skills/teamsmith/tests/config-cli.sh +184 -32
  60. package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +7 -1
  61. package/skills/teamsmith/tests/fixtures/p287/lint-good.sh.in +3 -0
  62. package/skills/teamsmith/tests/fixtures/p287/lint-hardcoded.sh.in +3 -0
  63. package/skills/teamsmith/tests/fixtures/p287/lint-no-ns.sh.in +3 -0
  64. package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +18 -6
  65. package/skills/teamsmith/tests/flip-m33.sh +5 -3
  66. package/skills/teamsmith/tests/flip-p158.sh +2 -1
  67. package/skills/teamsmith/tests/flip-p308-skip-not-pass.sh +151 -0
  68. package/skills/teamsmith/tests/flip-p310-lock.sh +210 -0
  69. package/skills/teamsmith/tests/flip-p310-socket.sh +125 -0
  70. package/skills/teamsmith/tests/gate-guard.sh +52 -79
  71. package/skills/teamsmith/tests/help-surface.sh +1664 -0
  72. package/skills/teamsmith/tests/install-shape.sh +359 -22
  73. package/skills/teamsmith/tests/key-replies-pty.sh +9 -10
  74. package/skills/teamsmith/tests/key-replies-ui.sh +2 -8
  75. package/skills/teamsmith/tests/key-replies.sh +281 -28
  76. package/skills/teamsmith/tests/ledger-ban.sh +5 -4
  77. package/skills/teamsmith/tests/ledger-claim.sh +2 -1
  78. package/skills/teamsmith/tests/lib/bounded-spin.sh +90 -0
  79. package/skills/teamsmith/tests/lib/model-policy.sh +4 -0
  80. package/skills/teamsmith/tests/lib/model-routing-flips.py +51 -0
  81. package/skills/teamsmith/tests/lib/pty-wait.sh +21 -111
  82. package/skills/teamsmith/tests/lib/reply-fixture.sh +4 -9
  83. package/skills/teamsmith/tests/lib/section-guard.sh +316 -164
  84. package/skills/teamsmith/tests/lib/tmp-root.sh +139 -27
  85. package/skills/teamsmith/tests/lib/tmux-cap.sh +10 -1
  86. package/skills/teamsmith/tests/lib/tmux-iso.sh +31 -13
  87. package/skills/teamsmith/tests/loop-inventory.tsv +83 -77
  88. package/skills/teamsmith/tests/panel-b2.sh +430 -352
  89. package/skills/teamsmith/tests/panel-b3-stub.sh +112 -4
  90. package/skills/teamsmith/tests/panel-b3.sh +314 -62
  91. package/skills/teamsmith/tests/panel-choices.sh +11 -6
  92. package/skills/teamsmith/tests/panel-cpu.sh +43 -130
  93. package/skills/teamsmith/tests/panel-p21.sh +251 -265
  94. package/skills/teamsmith/tests/panel-snapshots.sh +41 -225
  95. package/skills/teamsmith/tests/panel-strings.mjs +33 -18
  96. package/skills/teamsmith/tests/perf.sh +187 -396
  97. package/skills/teamsmith/tests/routes.sh +440 -117
  98. package/skills/teamsmith/tests/seat-interrupt.sh +1012 -0
  99. package/skills/teamsmith/tests/seat-visibility.sh +675 -0
  100. package/skills/teamsmith/tests/section-guard.sh +13 -102
  101. package/skills/teamsmith/tests/section-needs-audit.sh +24 -7
  102. package/skills/teamsmith/tests/section-paths.tsv +32 -18
  103. package/skills/teamsmith/tests/section-select.sh +371 -19
  104. package/skills/teamsmith/tests/signal-gate.sh +249 -27
  105. package/skills/teamsmith/tests/signal-lint-legacy.txt +4 -1
  106. package/skills/teamsmith/tests/slash-team-e2e.sh +323 -0
  107. package/skills/teamsmith/tests/slash-team.sh +617 -0
  108. package/skills/teamsmith/tests/slice-coverage.sh +206 -0
  109. package/skills/teamsmith/tests/smoke.sh +3595 -788
  110. package/skills/teamsmith/tests/task-model-routing.sh +530 -15
  111. package/skills/teamsmith/tests/team-bg-stop.sh +18 -10
  112. package/skills/teamsmith/tests/tmp-hygiene.sh +782 -45
  113. package/skills/teamsmith/tests/tmux-identity-leak.sh +773 -0
  114. package/skills/teamsmith/tests/tmux-lint-legacy.txt +12 -18
  115. package/skills/teamsmith/tests/upgrade-recipe.sh +537 -0
  116. package/skills/teamsmith/tests/workflow-entry.sh +207 -0
  117. package/skills/teamsmith-init/SKILL.md +12 -12
  118. package/skills/teamsmith-init/references/bootstrap.md +3 -3
  119. package/skills/teamsmith/tests/flip-glue.sh +0 -162
  120. package/skills/teamsmith/tests/flip-m12-26c.sh +0 -129
  121. package/skills/teamsmith/tests/flip-m12.sh +0 -185
  122. package/skills/teamsmith/tests/flip-m16.sh +0 -166
  123. package/skills/teamsmith/tests/flip-m17.sh +0 -204
  124. package/skills/teamsmith/tests/flip-m34.sh +0 -96
  125. package/skills/teamsmith/tests/flip-m37.sh +0 -185
  126. package/skills/teamsmith/tests/flip-m4.3.sh +0 -375
  127. package/skills/teamsmith/tests/flip-m43.sh +0 -128
  128. package/skills/teamsmith/tests/flip-m45.sh +0 -244
  129. package/skills/teamsmith/tests/flip-m46.sh +0 -238
  130. package/skills/teamsmith/tests/flip-m48.sh +0 -304
  131. package/skills/teamsmith/tests/flip-m6.2.sh +0 -205
  132. package/skills/teamsmith/tests/flip-m6.3.sh +0 -283
  133. package/skills/teamsmith/tests/flip-m6.4.sh +0 -267
  134. package/skills/teamsmith/tests/flip-m6.5.sh +0 -113
  135. package/skills/teamsmith/tests/flip-m7.1.sh +0 -135
  136. package/skills/teamsmith/tests/flip-m7.2.sh +0 -321
  137. package/skills/teamsmith/tests/flip-p144.sh +0 -112
  138. package/skills/teamsmith/tests/flip-p156.sh +0 -133
  139. package/skills/teamsmith/tests/flip-p160.sh +0 -182
  140. package/skills/teamsmith/tests/flip-p171.sh +0 -249
  141. package/skills/teamsmith/tests/flip-p18.1.sh +0 -95
  142. package/skills/teamsmith/tests/flip-p20.sh +0 -286
  143. package/skills/teamsmith/tests/flip-p201.sh +0 -249
  144. package/skills/teamsmith/tests/flip-p210.sh +0 -239
  145. package/skills/teamsmith/tests/flip-p211.sh +0 -152
  146. package/skills/teamsmith/tests/flip-p217.sh +0 -288
  147. package/skills/teamsmith/tests/flip-p22.sh +0 -123
  148. package/skills/teamsmith/tests/flip-p23.sh +0 -239
  149. package/skills/teamsmith/tests/flip-p25.sh +0 -165
  150. package/skills/teamsmith/tests/flip-p71.sh +0 -184
  151. package/skills/teamsmith/tests/flip-p72.sh +0 -202
  152. package/skills/teamsmith/tests/load-experiment.sh +0 -290
  153. package/skills/teamsmith/tests/panel-cpu-premise.sh +0 -173
  154. package/skills/teamsmith/tests/panel-flip-m54.sh +0 -207
  155. package/skills/teamsmith/tests/panel-flip-p123.sh +0 -278
  156. package/skills/teamsmith/tests/panel-flip-p125.sh +0 -318
  157. package/skills/teamsmith/tests/panel-flip-p128.sh +0 -259
  158. package/skills/teamsmith/tests/panel-keyprobe-stub.sh +0 -41
  159. package/skills/teamsmith/tests/panel-keyprobe.sh +0 -82
  160. package/skills/teamsmith/tests/panel-knobs.sh +0 -83
  161. package/skills/teamsmith/tests/section-budgets.tsv +0 -154
  162. package/skills/teamsmith/tests/team-bg-flip.sh +0 -239
  163. package/skills/teamsmith/tests/team-inbox-watch-flip.sh +0 -191
@@ -646,6 +646,10 @@ seat's last screen and tmux's exit evidence survive the death. Reading such a se
646
646
  - A long task with no progress: have the agent drop a status line into the report every 30 minutes, or ask for
647
647
  progress with `team say`.
648
648
  - Strong models are slow and quota-limited: run one at a time (`TEAM_MODEL_LIMITS`), and do not dispatch two at once.
649
+ - **The `/team` slash command does not appear** (the project-local `/team` extension): run `team doctor` and read its
650
+ `/team 扩展安装` row — `team init` repairs a missing entry, `team init --force` a drifted one (a symlink to another
651
+ source, or a copy whose bytes differ) — then type `/reload` in Pi. It is installed in the main worktree only, so a
652
+ worker worktree legitimately has no `/team`; `--no-skills` also leaves it out on purpose.
649
653
 
650
654
  ## 13. team doctor fails on a required dependency
651
655
 
@@ -1116,9 +1120,12 @@ second time).
1116
1120
  pass `--allow-dup` for new rows; remember that `reviews/<ID>.md` and the pending-report heuristic are keyed by
1117
1121
  the id too, so both rows share one review namespace, and the detail view opens the same document for both.
1118
1122
 
1119
- The fixtures that pin this are `tests/panel-b3.sh board` (two rows with one id: one cursor, both reachable,
1120
- both walks) and `tests/smoke.sh` §4c (refusal, `--allow-dup`, the three visible reports); `tests/flip-m48.sh`
1121
- proves both go red when the row identity / the check is removed.
1123
+ The gate pins this in `tests/smoke.sh` §4c (`bash skills/teamsmith/tests/smoke.sh --select 4c`):
1124
+ `M48:重复 ID 被拒(非 0)`, `M48:被拒时 BOARD 逐字节未变`, `M48:--allow-dup 显式允许写入`,
1125
+ `M48:assign 后行数不变(不是又加一行)`, `M48:assign 后 T1.1 仍是两行(没有顺手改历史数据)`, and the three visible
1126
+ reports (`board ls`, `team digest`, `team doctor`); each goes red when the row identity or the check is
1127
+ removed. The console half — two rows with one id sharing one cursor, both reachable, both walks — is pinned
1128
+ only by `tests/panel-b3.sh board`, which the gate does not run: no gate section carries it.
1122
1129
 
1123
1130
  ## 24. The performance suite refuses to call itself the "reference environment" — the trust boundary (M66 → M69 → M73)
1124
1131
 
@@ -1159,8 +1166,15 @@ never recorded under the reference name.
1159
1166
 
1160
1167
  ## 25. The gate goes red for a reason that is not the code: the temp root is full
1161
1168
 
1162
- The fixtures' temp root is a **shared** filesystem — `${TMPDIR:-/tmp}`, a 15 GB tmpfs on this host, used by every
1163
- agent's gate run. On 2026-09-22 09:50 it was 100 % full (0 bytes free **and** the inode table full), and
1169
+ The fixtures' or gates' temp root is a **shared** directory per project, and it is a *resolved* one: exactly one
1170
+ resolver decides it (`team_tmp_root`: a non-empty `TMPDIR`, else the project's `TEAM_TMP_ROOT`, else the platform
1171
+ default `/var/tmp/teamsmith-<project-ns>`), and every surface that names a root also prints how it decided —
1172
+ `source=tmpdir|config|default`, plus the value that lost when `TMPDIR` overrode it (`team status`, the dispatch
1173
+ capacity line, the gate's start line and `tmp-hygiene.sh --status` all read the same resolver). The default is on
1174
+ **disk**, not on the memory-backed `/tmp`, so a fixture's writes do not compete with the OOM killer for RAM;
1175
+ `/var/tmp` not being writable falls back to `/tmp`, and `TEAM_TMP_ROOT=/tmp` is the working rollback to the old
1176
+ behaviour. On 2026-09-22 09:50 the old default (`/tmp`, a memory-backed tmpfs on this host) was 100 % full (0 bytes
1177
+ free **and** the inode table full), and
1164
1178
  `tests/panel-p21.sh choices` produced an ENOSPC red whose verdict was about the code while the cause was the
1165
1179
  filesystem. Measure before believing a red whose failure text mentions "No space left on device",
1166
1180
  `mktemp: failed to create directory`, or a fixture dying while writing its own scene.
@@ -1185,13 +1199,16 @@ verification record is missing or uncommitted) while reclaiming the rest, and pr
1185
1199
  first deletion (exit 0 when something was done — skips are listed; exit 3 when every candidate was blocked and
1186
1200
  nothing was done). `--status` also counts tmux-side residue — orphan private servers whose socket is gone and stale
1187
1201
  non-`default` sockets with no listener older than the age threshold; `--sweep --tmux-sockets` clears them, the
1188
- default never touches them, and `default` is never a candidate. `team doctor` carries the same headroom as one row per judged filesystem (the temp root and the worktrees root — one row when they share a filesystem; free/total bytes and inodes, warning only, thresholds `TEAM_TMP_MIN_FREE_MB` / `TEAM_TMP_MIN_FREE_INODES`), so a filling tmpfs is visible *before* it turns into a red. The same floor is a **dispatch refusal** (P144): the refusal names the path, the figures, the threshold, the `tmp-hygiene.sh` remedy and the explicit override, and `TEAM_TMP_MIN_FREE_MB=0` / `TEAM_TMP_MIN_FREE_INODES=0` (or the audited `team config set <KEY> 0 --allow-danger --yes`) turn that leg off while the other keeps judging.
1202
+ default never touches them, and `default` is never a candidate. `team doctor` carries the same headroom as one row per judged filesystem (the temp root and the worktrees root — one row when they share a filesystem; free/total bytes and inodes, warning only, thresholds `TEAM_TMP_MIN_FREE_MB` / `TEAM_TMP_MIN_FREE_INODES`), so a filling filesystem is visible *before* it turns into a red. The same floor is a **dispatch refusal** (P144): the refusal names the path, the figures, the threshold, the `tmp-hygiene.sh` remedy and the explicit override, and `TEAM_TMP_MIN_FREE_MB=0` / `TEAM_TMP_MIN_FREE_INODES=0` (or the audited `team config set <KEY> 0 --allow-danger --yes`) turn that leg off while the other keeps judging.
1189
1203
 
1190
1204
  **Why the roots exist at all**: every fixture creates its temp root through the single owner helper
1191
- `tests/lib/tmp-root.sh` (`${TMPDIR:-/tmp}/teamsmith-<kind>.XXXXXX`), which writes an owner marker inside and a run
1192
- ledger outside, reclaims on normal exit **and** `INT`/`TERM`, and keeps only when asked (`TEAM_TMP_KEEP=1`, which
1193
- prints the path). Pointing a fixture elsewhere is `TMPDIR=/var/tmp bash tests/config-cli.sh`; a fixture template
1194
- that hardcodes `/tmp` is a gate finding (`tests/tmp-hygiene.sh --lint` runs inside the gate), and the gate itself
1205
+ `tests/lib/tmp-root.sh` (`<the resolved root>/teamsmith-<kind>-<ns>.XXXXXX`; the resolver is called, never
1206
+ re-implemented), which writes an owner marker inside and a run ledger outside, reclaims on normal exit **and**
1207
+ `INT`/`TERM`, and keeps only when asked (`TEAM_TMP_KEEP=1`, which prints the path). Pointing a fixture elsewhere is
1208
+ `TMPDIR=/var/tmp bash tests/config-cli.sh` (an explicit root must already exist and be writable — it is never
1209
+ created for you; only the default leg is created, 0700, on the first write); a fixture template
1210
+ that hardcodes `/tmp` is a gate finding (`tests/tmp-hygiene.sh --lint` runs inside the gate), the docs that still
1211
+ teach the old default are a gate finding too (`tests/tmp-hygiene.sh --docs-check`), and the gate itself
1195
1212
  asserts that no root its run created survives it.
1196
1213
 
1197
1214
  **What to do when a gate dies mid-run** (`SIGKILL` cannot be caught, so a root survives): run the sweep above; the
@@ -1382,3 +1399,106 @@ record that `team board set <ID> done` and the merge step read. The details that
1382
1399
  - A container run cannot mount a `git worktree` — its `.git` is a pointer file to the main checkout, so every
1383
1400
  git-dependent fixture fails. Check the branch out with `git clone -b <task-branch> <root> /tmp/review-<ID>`
1384
1401
  instead and pass that clone's root to `--dir` (see the note at the end of §26; give the run `--pid=host`).
1402
+
1403
+ ## 28. Orphan seat processes: the agent still runs, its pane is gone
1404
+
1405
+ **Symptom**: `team ps` and `team status` end with a block that starts `孤儿席位进程(主机侧 /proc 普查;…)` and
1406
+ names pids, each with a `team reap <pid> --yes` command; `team digest`'s capacity line carries a
1407
+ `| 孤儿席位进程合计 ≥ …` hint once the host-wide total reaches `TEAM_ORPHAN_WARN_MB`; `team up` prints one line
1408
+ `孤儿席位进程:N 个本项目孤儿(合计 XMB)→ team reap --orphans --yes`.
1409
+
1410
+ **What it is**: a process whose command line names this project's configured agent (or PM) executable *and* whose own
1411
+ environment carries this project's identity (`TEAM_MAIN_ROOT` / `TEAM_ROOT`), but whose pane is gone. It appears when
1412
+ the tmux server — or just that window — died while the agent process kept running: a tmux crash, a killed session, or
1413
+ a corpse window whose pane died under a live process (§11b). The process keeps holding its memory and its model
1414
+ session, which is why it is worth cleaning up.
1415
+
1416
+ The judgement is made on the process's **own** tmux server (the socket named in its `TMUX`) — never on the default
1417
+ server, never on "is this the current window": no `TMUX_PANE` means orphan, and a pane id that is absent from that
1418
+ server's pane list means orphan. If that server cannot be queried the process is **unjudged**: counted, never called
1419
+ an orphan, never reaped.
1420
+
1421
+ **How to clean it** — plan first, then execute:
1422
+
1423
+ ```bash
1424
+ team reap --orphans # the plan: names every target and the signal it would send, sends nothing (exit 0)
1425
+ team reap --orphans --yes # execute; or one pid at a time: team reap <pid> --yes
1426
+ ```
1427
+
1428
+ Each target is re-verified immediately before its signal — still this project's seat, still no live pane, the same
1429
+ process start time the plan recorded (a pid the kernel reused in between is refused) — then `SIGTERM`, a bounded 5 s
1430
+ wait, and only then `SIGKILL`. Every signal appends one line to `state/reap.log`; a target that is not clean makes the
1431
+ command exit non-zero. `--yes` is the only authorization: no configuration key, environment variable or inherited
1432
+ value turns it on.
1433
+
1434
+ **Why nothing is cleaned up automatically** — three reasons, and each of them has bitten:
1435
+
1436
+ - The reading is **read-only**: it is appended to `team ps`/`team status`, and nobody expects those to signal
1437
+ anything.
1438
+ - Another project's orphans and identity-less same-shaped processes are only **counted**, never named — the reading
1439
+ is meant to be pasted into the ledger, so printing their pids, seats or paths would leak another project's state;
1440
+ and a sweep acting on that count would kill another project's seats.
1441
+ - An unqueryable tmux server leaves a process **unjudged**: "I cannot tell" must never become "kill it".
1442
+
1443
+ So the decision stays with a human (or the PM) in front of a named list. `TEAM_ORPHAN_SCAN=0` turns the whole reading
1444
+ off — `team ps`/`team status`/`team up` then print one named skip line, `team digest` adds no hint, and
1445
+ `team reap --orphans` refuses (cleanup still works with an explicit pid) — for hosts where reading another process's
1446
+ environment is refused.
1447
+
1448
+ **Not to be confused with**: the orphan tmux **server** of §25 — a private server whose socket is gone and whose temp
1449
+ root never got swept. That is temp-root hygiene (`bash <skill>/tests/tmp-hygiene.sh --status`, then `--sweep`), not a
1450
+ seat process.
1451
+
1452
+ ## 29. A seat is stuck in one very long turn (its message is never read)
1453
+
1454
+ **Symptom**: a message handed to a seat (`team say`, `notify`, a reply to its question) is never read. Its window
1455
+ shows `Working` with a growing `Elapsed`; its own session file and its worktree stop changing; `team ps` still calls
1456
+ it running. The wake-up loop delivers at **turn end**, so a turn that never ends swallows every message — this is
1457
+ the shape behind D188 (two seats stuck 18 h and 16 h with two unread messages).
1458
+
1459
+ **First read the evidence** — the plan prints it, and it is the evidence the decision rests on. `team interrupt
1460
+ <seat> --reason <one line>` reads (and prints) the seat's last session-file write `session_last`, the number of
1461
+ uncommitted files in its worktree `uncommitted`, and the **newer** of the two as the newest disk evidence with its
1462
+ age. Fresh evidence (newer than the freshness window, default 3600 s) means the seat **is writing**: the interrupt
1463
+ refuses and names the file and its age, because ending a seat mid-write is how a half-written file happens.
1464
+ `TEAM_INTERRUPT_FRESH_SEC` is the knob for that bounded default (non-numeric falls back to it).
1465
+
1466
+ **How to use it**:
1467
+
1468
+ ```bash
1469
+ team interrupt dev --reason "18h without a commit; the queued root cause is unread" # plan: zero signals, zero writes, exit 0
1470
+ team interrupt dev --reason "…" --yes # execute
1471
+ team resume --agent dev # the way back into the same session
1472
+ ```
1473
+
1474
+ `--yes` is the only authorization: it is read from this command line alone, and no configuration key, environment
1475
+ variable or inherited value turns a signal on. The reason is required, and it is written into the seat's thread (the
1476
+ second step of its reading order on resume) and its inbox **before** the signal; if either cannot be written the
1477
+ interrupt is refused and nothing is signalled. An authorized interrupt appends exactly one line to
1478
+ `state/interrupt.log` carrying the readings taken *before* the signal (`session_last`, `uncommitted`, `guard`,
1479
+ `signal`, `outcome`).
1480
+
1481
+ **What a refusal means**: nothing was signalled and nothing was written — plan mode and every refusal leave the
1482
+ seat's worktree, thread, inbox and audit byte-identical. The message names the reason (window gone, the pane no
1483
+ longer holds that pid, the start time changed, identity gone, not in the roster, another project, yourself or an
1484
+ ancestor, or fresh evidence) and the route for it (`team resume --agent <seat>`, or `team reap --orphans` when the
1485
+ pane is gone but the process lives). A refusal is **not** a verdict on the seat's work.
1486
+
1487
+ **Known boundaries**:
1488
+
1489
+ - Only the one **proven pid** is signalled — never by name, pattern, process tree or process group. The proof chain
1490
+ is the assignment record's window → that window's pane → this project's identity and the recorded start time, and
1491
+ the same facts are re-verified immediately before the signal; any change refuses.
1492
+ - The window is left as a **live shell**: nothing is respawned, no session is created, and nothing but the seat
1493
+ process is signalled. The seat's **background jobs are detached and survive** — that is `long-job-suspend`'s lane;
1494
+ run `team bg list` before resuming.
1495
+ - The worktree, the session file and the assignment record are untouched, so an interrupted turn loses no state.
1496
+ - The panel's death-reason reading may say `unknown` afterwards: this entry is not a death-cause word. `team resume
1497
+ --agent <seat>` continues the same session (`mode=continued`).
1498
+ - `--force` crosses exactly **one** refusal — the freshness window — and the audit line records `guard=forced`. It
1499
+ never crosses identity, liveness, the roster, cross-project refusal, or "this is yourself/an ancestor".
1500
+ - `--reason` and the refusal wording are not gated (D170); the behaviour is (fixture `tests/seat-interrupt.sh`,
1501
+ gate section `51c`).
1502
+
1503
+ **Not to be confused with**: §28 (`reap` = the pane is gone and the process is an orphan), a seat that has
1504
+ *stopped* (that is `team resume`), and `team teardown` (which removes the window, the state and the worktree).
@@ -14,7 +14,7 @@ each** — the reasoning, owners and gates are in [openspec.md](openspec.md):
14
14
  | # | Phase | Owner | Gate before the next phase |
15
15
  |---|---|---|---|
16
16
  | 1 | `opsx-explore` | an explorer worker (never the eventual implementer) | the PM accepts the approach, records it in `DECISIONS.md`, writes the propose brief |
17
- | 2 | `opsx-propose` | the explorer, same agent (planning only — no code) | the PM's **proposal review is ACCEPTED** in `reviews/<change>-proposal.md`: `openspec validate --all --strict` green + the eight-point checklist |
17
+ | 2 | `opsx-propose` | the explorer, same agent (planning only — no code) | the PM's **proposal review is ACCEPTED** in `reviews/<change>-proposal.md`: `openspec validate --all --strict` green + the ten-point checklist |
18
18
  | 3 | `opsx-apply` | a dev worker | independent verification is dispatched to a different agent |
19
19
  | 4 | `opsx-verify` | an **independent** verify agent | the PM re-runs the gate on the merged tree and sets `done` |
20
20
  | 5 | `opsx-archive` | the PM | the user confirms (the PM may act as the user's proxy only when it says so and records why) |
@@ -36,7 +36,8 @@ verified one by one, archived only after the last one landed.
36
36
  New-project setup lives in the **`teamsmith-init`** skill: it carries the ordered question checklist (dependencies,
37
37
  session/roster and the task-category map + independent PM model, gates, VCS mode, install command, the project's
38
38
  ROADMAP/OWNERSHIP/AGENTS.md red lines), the `team bootstrap` command (fresh projects must pass
39
- `--task-models` and `--pm-model`; a legacy config is refused and migrates through `team config upgrade-models`) and
39
+ `--task-models` and `--pm-model`; a legacy config is refused and migrates on the next `team up` (the startup
40
+ transaction) or through the explicit `team config upgrade-models`) and
40
41
  the handoff back here. Read `skills/teamsmith-init/SKILL.md` before running anything; the command's own behaviour is in
41
42
  [../../teamsmith-init/references/bootstrap.md](../../teamsmith-init/references/bootstrap.md).
42
43
 
@@ -164,6 +165,12 @@ on Pi (§E2); `team doctor` reports the harness and the plugins this project car
164
165
  `已装插件 packages` — information, never a recommendation); the background-tmux-window fallback plus the four delivery
165
166
  rules are in [references/troubleshooting.md](troubleshooting.md) §17.
166
167
 
168
+ **Read for what each finding changes.** While you read the report and the review record, check that every finding
169
+ states what it changed — the implementation, the next step, the conclusion, or nothing. A caution that names no
170
+ fact, counterexample, reasoning gap or unobserved boundary is a finding to delete, not evidence of thoroughness,
171
+ and a longer or more defensive report is not stronger evidence. This is a reading rule, not a gate: no section
172
+ checks the wording (see [references/protocol.md](protocol.md) §11b).
173
+
167
174
  ### E2. The PM's background gate (the team's own lane, no extra window)
168
175
 
169
176
  On the built-in Pi paths (both the PM and the workers) the session already has two tools for this:
@@ -458,3 +465,30 @@ bash <skill>/scripts/team teardown --all # close every window
458
465
  - Archive periodically: finished reports and verification records can move to `docs/team/archive/`; threads stay
459
466
  (append-only).
460
467
  - Worktrees left around eat disk: check with `git worktree list` and clean unused ones with `teardown --purge`.
468
+
469
+ ## K. Reading the help surface
470
+
471
+ The CLI's help is three levels deep, and it never dumps every command at once:
472
+
473
+ ```bash
474
+ bash <skill>/scripts/team # level 0: what teamsmith is, the groups, a beginner set
475
+ bash <skill>/scripts/team help seats # level 1: the commands of one group
476
+ bash <skill>/scripts/team help dispatch # level 2: one command's own page
477
+ bash <skill>/scripts/team dispatch --help # the same page (byte-identical to `help dispatch`)
478
+ ```
479
+
480
+ A command page answers the questions a reader who does not know teamsmith would ask: what it does, when to use it,
481
+ what it reads and writes, which side effects it has, whether it needs `--yes`, and how it can be undone. The pages
482
+ are rendered from one command manifest (`scripts/strings/commands.tsv`) and two parallel prose tables
483
+ (`scripts/strings/help.en.tsv`, `help.zh.tsv`); `tests/help-surface.sh` checks the surface's own promises (menu
484
+ size, coverage, layout, language, the declared effects and their probes) and `tests/routes.sh` probes every printed
485
+ flag against the real parser.
486
+
487
+ Two environment knobs, read from the environment only (the help paths never load the project contract, so they work
488
+ in a directory that is not a project yet):
489
+
490
+ - `TEAM_LANG=en|zh` — the prose language. Unset or empty means English; another value prints one warning and keeps
491
+ English. It selects prose only: command paths, flags and usage lines are byte-identical in both languages, and no
492
+ `--json`/`--print` output changes.
493
+ - `TEAM_HELP_WIDTH=<positive integer>` — the width the surface wraps to, in display cells (a CJK-wide character
494
+ counts two). The default is 100; an invalid value prints one warning and falls back to 100.