teamsmith 0.2.0 → 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.
Files changed (117) hide show
  1. package/README.md +4 -4
  2. package/package.json +1 -1
  3. package/skills/teamsmith/CHANGELOG.md +28 -0
  4. package/skills/teamsmith/SKILL.md +14 -7
  5. package/skills/teamsmith/extension/team-notify.ts +37 -6
  6. package/skills/teamsmith/extension/team.ts +438 -0
  7. package/skills/teamsmith/references/config.md +39 -6
  8. package/skills/teamsmith/references/migration.md +197 -47
  9. package/skills/teamsmith/references/protocol.md +176 -19
  10. package/skills/teamsmith/references/troubleshooting.md +124 -7
  11. package/skills/teamsmith/references/workflows.md +36 -2
  12. package/skills/teamsmith/scripts/lib/cmd-agents.sh +318 -23
  13. package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +2 -2
  14. package/skills/teamsmith/scripts/lib/cmd-config.sh +349 -67
  15. package/skills/teamsmith/scripts/lib/cmd-draft.sh +4 -4
  16. package/skills/teamsmith/scripts/lib/cmd-help.sh +677 -0
  17. package/skills/teamsmith/scripts/lib/cmd-init.sh +157 -5
  18. package/skills/teamsmith/scripts/lib/cmd-interrupt.sh +461 -0
  19. package/skills/teamsmith/scripts/lib/cmd-meeting.sh +2 -25
  20. package/skills/teamsmith/scripts/lib/cmd-project.sh +30 -103
  21. package/skills/teamsmith/scripts/lib/cmd-reap.sh +277 -0
  22. package/skills/teamsmith/scripts/lib/cmd-reply.sh +3 -3
  23. package/skills/teamsmith/scripts/lib/cmd-review.sh +175 -30
  24. package/skills/teamsmith/scripts/lib/cmd-status.sh +226 -17
  25. package/skills/teamsmith/scripts/lib/cmd-update.sh +36 -7
  26. package/skills/teamsmith/scripts/lib/cmd-watch.sh +564 -46
  27. package/skills/teamsmith/scripts/lib/common.sh +773 -48
  28. package/skills/teamsmith/scripts/lib/gate-lock.sh +544 -0
  29. package/skills/teamsmith/scripts/panel/draft-send.sh +11 -1
  30. package/skills/teamsmith/scripts/panel/panel.js +207 -207
  31. package/skills/teamsmith/scripts/panel/src/App.tsx +58 -21
  32. package/skills/teamsmith/scripts/panel/src/clipboard.ts +11 -5
  33. package/skills/teamsmith/scripts/panel/src/compose.ts +6 -3
  34. package/skills/teamsmith/scripts/panel/src/data.ts +11 -3
  35. package/skills/teamsmith/scripts/panel/src/layout.ts +209 -69
  36. package/skills/teamsmith/scripts/panel/src/main.tsx +33 -8
  37. package/skills/teamsmith/scripts/panel/src/strings/en.ts +39 -29
  38. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +41 -31
  39. package/skills/teamsmith/scripts/panel/src/types.ts +28 -3
  40. package/skills/teamsmith/scripts/replies.mjs +4 -1
  41. package/skills/teamsmith/scripts/shim/tmux +18 -0
  42. package/skills/teamsmith/scripts/strings/commands.tsv +86 -0
  43. package/skills/teamsmith/scripts/strings/help.en.tsv +503 -0
  44. package/skills/teamsmith/scripts/strings/help.zh.tsv +489 -0
  45. package/skills/teamsmith/scripts/team +19 -6
  46. package/skills/teamsmith/templates/AGENTS.section.md.tmpl +8 -1
  47. package/skills/teamsmith/templates/config.sh.tmpl +20 -1
  48. package/skills/teamsmith/templates/pm-prompt.md.tmpl +21 -0
  49. package/skills/teamsmith/tests/bg-ledger-harness.mjs +464 -40
  50. package/skills/teamsmith/tests/bg-ledger.sh +168 -10
  51. package/skills/teamsmith/tests/checkout-shape-probe.sh +3 -1
  52. package/skills/teamsmith/tests/config-cli.sh +160 -14
  53. package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +7 -1
  54. package/skills/teamsmith/tests/fixtures/p287/lint-good.sh.in +3 -0
  55. package/skills/teamsmith/tests/fixtures/p287/lint-hardcoded.sh.in +3 -0
  56. package/skills/teamsmith/tests/fixtures/p287/lint-no-ns.sh.in +3 -0
  57. package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +18 -6
  58. package/skills/teamsmith/tests/flip-m33.sh +5 -3
  59. package/skills/teamsmith/tests/flip-m37.sh +4 -1
  60. package/skills/teamsmith/tests/flip-m4.3.sh +4 -1
  61. package/skills/teamsmith/tests/flip-m6.3.sh +4 -1
  62. package/skills/teamsmith/tests/flip-m6.5.sh +4 -1
  63. package/skills/teamsmith/tests/flip-m7.2.sh +4 -1
  64. package/skills/teamsmith/tests/flip-p158.sh +2 -1
  65. package/skills/teamsmith/tests/flip-p210.sh +4 -1
  66. package/skills/teamsmith/tests/flip-p217.sh +4 -1
  67. package/skills/teamsmith/tests/flip-p287-lock.sh +342 -0
  68. package/skills/teamsmith/tests/flip-p287-name.sh +279 -0
  69. package/skills/teamsmith/tests/flip-p304-read-side.sh +98 -0
  70. package/skills/teamsmith/tests/flip-p308-skip-not-pass.sh +151 -0
  71. package/skills/teamsmith/tests/flip-p309-p162-deep.sh +122 -0
  72. package/skills/teamsmith/tests/flip-p310-lock.sh +216 -0
  73. package/skills/teamsmith/tests/flip-p310-socket.sh +125 -0
  74. package/skills/teamsmith/tests/help-surface.sh +1664 -0
  75. package/skills/teamsmith/tests/install-shape.sh +279 -20
  76. package/skills/teamsmith/tests/key-replies-pty.sh +9 -10
  77. package/skills/teamsmith/tests/key-replies-ui.sh +0 -7
  78. package/skills/teamsmith/tests/key-replies.sh +240 -1
  79. package/skills/teamsmith/tests/ledger-ban.sh +5 -4
  80. package/skills/teamsmith/tests/ledger-claim.sh +2 -1
  81. package/skills/teamsmith/tests/lib/bounded-spin.sh +90 -0
  82. package/skills/teamsmith/tests/lib/model-policy.sh +4 -0
  83. package/skills/teamsmith/tests/lib/model-routing-flips.py +51 -0
  84. package/skills/teamsmith/tests/lib/reply-fixture.sh +4 -9
  85. package/skills/teamsmith/tests/lib/section-guard.sh +258 -13
  86. package/skills/teamsmith/tests/lib/tmp-root.sh +139 -27
  87. package/skills/teamsmith/tests/lib/tmux-cap.sh +10 -1
  88. package/skills/teamsmith/tests/lib/tmux-iso.sh +31 -13
  89. package/skills/teamsmith/tests/loop-inventory.tsv +59 -47
  90. package/skills/teamsmith/tests/panel-b2.sh +106 -3
  91. package/skills/teamsmith/tests/panel-b3-stub.sh +112 -4
  92. package/skills/teamsmith/tests/panel-b3.sh +175 -19
  93. package/skills/teamsmith/tests/panel-choices.sh +11 -6
  94. package/skills/teamsmith/tests/panel-cpu.sh +2 -1
  95. package/skills/teamsmith/tests/panel-knobs.sh +7 -1
  96. package/skills/teamsmith/tests/panel-p21.sh +156 -73
  97. package/skills/teamsmith/tests/panel-snapshots.sh +41 -225
  98. package/skills/teamsmith/tests/panel-strings.mjs +33 -18
  99. package/skills/teamsmith/tests/perf.sh +121 -30
  100. package/skills/teamsmith/tests/routes.sh +327 -93
  101. package/skills/teamsmith/tests/seat-interrupt.sh +1002 -0
  102. package/skills/teamsmith/tests/seat-visibility.sh +675 -0
  103. package/skills/teamsmith/tests/section-budgets.tsv +20 -10
  104. package/skills/teamsmith/tests/section-guard.sh +6 -1
  105. package/skills/teamsmith/tests/section-needs-audit.sh +24 -7
  106. package/skills/teamsmith/tests/section-paths.tsv +19 -13
  107. package/skills/teamsmith/tests/section-select.sh +8 -1
  108. package/skills/teamsmith/tests/slash-team-e2e.sh +323 -0
  109. package/skills/teamsmith/tests/slash-team.sh +617 -0
  110. package/skills/teamsmith/tests/smoke.sh +2972 -440
  111. package/skills/teamsmith/tests/task-model-routing.sh +507 -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-init/SKILL.md +12 -12
  117. package/skills/teamsmith-init/references/bootstrap.md +3 -3
@@ -44,6 +44,10 @@ the implementation of that chain.
44
44
  harder; a long-lived worktree lets the agent keep its memory.
45
45
  - The main worktree (main) belongs to the PM alone: merges, verification and documentation happen there, so nobody
46
46
  fights an agent over the workspace.
47
+ - **A merged branch is deleted at once.** Landing is `merge --squash` + commit + push, then `close`, then
48
+ `git branch -D <branch>`: the commit on `main` is the deliverable and the branch is only the vehicle. Nothing of
49
+ value lives only on a branch, and keeping them turns the branch list into an archeology site (134 branches removed
50
+ in one pass on 2026-10-18, none of them an ancestor of `main` because squash merges leave no ancestry).
47
51
 
48
52
  ## 4. The wake-up loop: an asynchronous agent must be able to wake the PM by itself
49
53
 
@@ -66,8 +70,14 @@ Guards and limitations:
66
70
  be concatenated with what the human is typing. On a dirty PM box the entry waits in `state/outbox/`; the extension
67
71
  never falls back to `send-keys`, and a failed enqueue is logged while the inbox line stays.
68
72
  - The inbox is transient state (gitignored); the durable record is still the report + verification + decision log.
69
- - The same briefing is sent once per `TEAM_NOTIFY_DEDUP_SEC` seconds: Pi may settle several times inside one stretch
70
- of work.
73
+ - **Settles inside one stretch of work become one line, not one line each**: consecutive notices with the same
74
+ merge key (seat, task, state class, `awaiting=` set) fold into the line at the end of the inbox file, which then
75
+ carries `×N first=<ISO> last=<ISO>` and the **field values of the last event** (`tip=`, `branch=`, `uncommitted=`).
76
+ The line is a **window summary**, not the seat's current state: `last=` names the event whose revision it
77
+ describes, and the run's earlier events are read from the detail file with `team inbox <agent> --detail` (raw
78
+ records in `state/notify.log`, bounded by `TEAM_NOTIFY_DETAIL_MAX` and rotated once). A different key, a manual
79
+ notice in between, or a record write that failed starts a new line; a byte-identical briefing inside
80
+ `TEAM_NOTIFY_DEDUP_SEC` is still suppressed outright.
71
81
  - **A notice names the revision it describes** (R2/P139; width and branch proof fixed by P160): the durable inbox
72
82
  line and the knock payload carry `task=<ID> tip=<12-hex>` — the **first twelve hex characters of the branch tip,
73
83
  truncated by the sender itself** (`git rev-parse HEAD | cut -c1-12`; the extension's `TIP_WIDTH`), never a Git
@@ -129,12 +139,37 @@ Guards and limitations:
129
139
  call appends one line to `state/signal-calls.log` (`TEAM_SIGNAL_CALLS_LOG`), and a refusal is also copied byte
130
140
  for byte into `<log>.forensics` so it outlives the call log's rotation.
131
141
 
142
+ ## 4a. Two signal entries: `reap` the orphan, `interrupt` the turn
143
+
144
+ The tool has exactly two entries that end a *process*, and they answer different questions. `team reap` ends an
145
+ **orphan**: the process is alive but its pane is gone, so no turn is running and nothing is waiting for it
146
+ (troubleshooting §28). `team interrupt <seat>` ends the **turn of a live seat** — the window is alive, the agent
147
+ process is the one its assignment record names, and the seat is stuck inside one long tool call, which is exactly
148
+ why a queued message never reaches it: the wake-up loop delivers at turn end (§4). `team resume` is neither: it is
149
+ the way **back** into the same session, the step after either entry, never a third way to signal anything.
150
+
151
+ What the two entries share is the discipline, not the target: both pick the process from a **recorded pid**
152
+ (`reap`: the host census; `interrupt`: the seat's own window → pane → pid → identity and start time), both
153
+ re-verify immediately before the signal, both send `SIGTERM` → bounded wait → `SIGKILL`, both take `--yes` on the
154
+ same command line as the only authorization, and both append one audit line per authorized signal. `interrupt`
155
+ additionally requires `--reason` and writes it into the seat's thread and inbox **before** the signal: an
156
+ interrupted seat has to learn why it was stopped, and that entry is part of its reading order on resume.
157
+
158
+ Never swap them — an interrupt aimed at an orphan's pid is refused (no window), and a reap aimed at a live seat is
159
+ refused (its pane is alive; `reap` only judges orphans); each refusal names the other entry. Both are turn/process
160
+ entries only: `interrupt` leaves the window as a live shell, leaves the worktree, the session file and the
161
+ assignment record untouched, and does not touch the seat's detached background jobs (§4's `team-bg` lane).
162
+
132
163
  ## 4b. Key replies: publish the body before you answer
133
164
 
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:
165
+ Publishing the body of a key conclusion is a **standing duty of the PM**, not a licence for answers that merely look
166
+ memorable: it travels with the tool, so it holds in every project and on every machine. The wake-up loop carries a
167
+ *pointer* (`inbox/<agent>.md` plus a knock) and the report carries the *process*; neither carries the **body**, and
168
+ both are transient or post-hoc — the inbox is gitignored, and a report is written after the work. **The reader
169
+ decides what is published**: whenever the reply is written for the user — a landed milestone, an answer to a
170
+ question, a status or progress report, a conclusion or a ruling, a decision you ask the user for, a delivery or
171
+ verification summary, however short — publish the **complete reply** — the substance the user needs to read, not a
172
+ play-by-play of the work — with:
138
173
 
139
174
  ```
140
175
  team reply post --from <seat> --title "<short single line>" --stdin <<'EOF'
@@ -142,7 +177,15 @@ team reply post --from <seat> --title "<short single line>" --stdin <<'EOF'
142
177
  EOF
143
178
  ```
144
179
 
145
- Then send the answer normally. Publication **never gates the answer**: the same body goes out whether the post
180
+ **The reader decides, so ask "who is this reply written for?"** A reply meant for the patrol or the watchdog, for
181
+ another seat, or for another project's PM stays in its own channel, and a receipt a tool generated is not a reply at
182
+ all. Length never decides: a one-line answer or a short progress report meant for the user is published in full.
183
+ A reply is never held back because of its kind: a status or progress report, a delivery summary and a decision
184
+ request are published exactly as a conclusion is, and reading like process never makes a reply unpublishable.
185
+ When the reader cannot be settled, treat the reply as meant for the user rather than risk the user missing it.
186
+
187
+ A batch of user-facing replies may be one reply. Then send the answer normally. Publication **never gates the
188
+ answer**: the same body goes out whether the post
146
189
  reported `saved` (0), an input error (2), storage unavailable (4), a busy writer (5, the lock wait is bounded) or
147
190
  `unconfirmed` (6, the entry is visible but its durability could not be confirmed — never re-post it automatically).
148
191
  Failures are diagnostics on stderr; they must not be concatenated into the answer, and they must not stop it.
@@ -160,8 +203,10 @@ What a receipt does and does not mean:
160
203
  (newest first), `team reply show <no>` prints safe display text, `team reply show <no> --raw` exports the original
161
204
  bytes to a non-TTY stdout, and the console's page 5 renders the latest reply plus the numbered history. Flags and
162
205
  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.
206
+ - **The honest limit**: the gate holds only that this duty is shipped on the instruction surfaces (the injected PM
207
+ prompt template, this section, the command table) and that the example command printed there is accepted by the real
208
+ parser. No tool can verify that a live PM follows the duty — whether a given reply was meant for the user, which
209
+ conclusions a PM published, and whether the body matched the answer, stay unprovable from here.
165
210
 
166
211
  ## 5. Task briefs: written for "a weak model without context"
167
212
 
@@ -613,16 +658,96 @@ carries an illegal token, so the read side and the write side can never disagree
613
658
 
614
659
  The full gate — `openspec validate … && bash skills/teamsmith/tests/smoke.sh` — spends the machine's tmux servers,
615
660
  node/bun processes and login shells, so it is serialised on **one gate lock**
616
- (`${TEAM_SMOKE_LOCK:-${TMPDIR:-/tmp}/teamsmith-smoke.lock}`, holder recorded in `<lock>.holder`, wait capped by
617
- `TEAM_SMOKE_LOCK_WAIT`, default 1800 s). Use `TEAM_SMOKE_FAST=1` for in-batch self-tests (pure-logic sections
618
- only; measured in the low minutes on a loaded 32-core box, not the seconds it once was - P100's F6) and the
619
- **full** suite for delivery and review.
661
+ (`${TEAM_SMOKE_LOCK:-${TMPDIR:-/tmp}/teamsmith-smoke.lock}`, wait capped by `TEAM_SMOKE_LOCK_WAIT`, default
662
+ 1800 s). Use `TEAM_SMOKE_FAST=1` for in-batch self-tests (pure-logic sections only; measured in the low minutes
663
+ on a loaded 32-core box, not the seconds it once was - P100's F6) and the **full** suite for delivery and review.
664
+
665
+ **The gate lock is a pair: a published path (compatibility) and a companion (the mutex).** The published path is
666
+ what a writer of an earlier release — which knows only that name — takes, so a run takes it **first** and then the
667
+ companion `<same dir>/.<basename>.machine`, where the mutex actually lives and where the run keeps its records
668
+ (`<companion>.holder`, `<companion>.runs/<pid>.run`). The companion is dot-prefixed on purpose: a shared temp root
669
+ collects other projects' cleanups, and a `rm -rf ${TMPDIR}/teamsmith-smoke.*` from one of them must not be able to
670
+ reach this project's lock (that incident deleted a running gate's lock and work root; a shared `teamsmith-` prefix
671
+ is not ownership). **Neither file is ever unlinked** — removing a lock file that waiters are blocked on is exactly
672
+ the silent split the pair exists to remove — and only the holder's own record and run entry are removed at the end
673
+ of the run. The run takes both locks **in its own process** (fds 8/9) and hands the suite to a child with those
674
+ descriptors closed (`8>&- 9>&-`), so a fixture's background process cannot inherit the lock and hold it past the
675
+ run. The holder record carries the locking process's own descriptor identity (`lock_identity=fd|path`,
676
+ `lock_dev_ino=<dev:ino>`) — the identity of the file the holder really holds, readable only through that process's
677
+ `/proc`; when that cannot be read the record says `path` and the path's identity instead, rather than guessing.
678
+
679
+ **Losing the lock while running is loud and stops the run.** The 0.2 s tripwire watches the companion as well:
680
+ when the lock is no longer the file the holder holds — *gone* (unlinked, not rebuilt) or *replaced* (the path now
681
+ names a different inode; `rm`+recreate and `mv`-over both land here) — it prints one line saying which of the two
682
+ happened, with the inode the holder holds and the one now on the path, appends the evidence (identity, the
683
+ published path's state, the last section reached) next to the run's `$TMP` — outside it, so deleting the scene
684
+ does not take it — and stops at the next safe point with exit 2 and **no result line**: a verdict computed after
685
+ the mutex broke is not honest, and a plain red would bury *when* the lock went. Losing the **published** path alone
686
+ is printed once and does not stop the run (the mutex is on the companion; what is lost is serialisation against
687
+ older writers). A run that takes a lock whose live `top` record attests **another** identity refuses in the same
688
+ way *before* running the suite — that record is the observable form of a mutex that is already broken.
620
689
 
621
690
  **A lock that cannot be taken is a visible degradation, not a hard failure.** If the lock file cannot be
622
691
  created (or `flock` is absent) the suite prints `注意:锁文件 … 建不了 → 不做排队` and runs anyway; only a
623
- *queue overrun* is loud (a one-line `排队超限` naming the holder in `<lock>.holder`, exit 2), and a genuine
692
+ *queue overrun* is loud (a one-line `排队超限` naming the holder in `<companion>.holder`, exit 2), and a genuine
624
693
  red is exit 1 with no queue wording (P66/P100's F1).
625
694
 
695
+ **A nested run does not queue on the gate lock, and it must prove its ancestor.** The lock serialises
696
+ **top-level** runs only. A run started inside a run that holds the lock — *proved* by walking the process
697
+ ancestry to a pid recorded in `<companion>.holder` / `<companion>.runs/<pid>.run` and matching that process's
698
+ start time, never by the inherited `SMOKE_LOCK_WRAPPED` marker (a fixture can clear it, and a nested run carrying
699
+ it used to overwrite and delete the real holder's record) — does not queue: queueing there hands the machine's one
700
+ shared resource to a fixture and deadlocks the run against its own ancestor. It registers itself in
701
+ `<companion>.runs/<pid>.run` instead, so a waiter can attribute what it is waiting for. A run that cannot prove a
702
+ live ancestor holding the lock (including on a host without `/proc`) is treated as top-level and queues exactly
703
+ as before, so skipping the queue is never unconditional. The claim that a run is "the one that holds the lock"
704
+ must be backed by the locking process's own `/proc` — its descriptor pointing at the companion, with the identity
705
+ the run was handed — or by a live record naming it: environment variables alone name nobody. The claimant must
706
+ also be a **strict** ancestor of the claiming suite (a section-selected run adds one more process layer, so the
707
+ locker is the grandparent there and the parent in the direct case, and both are covered). The holder record names its kind (`top`/`nested`), its
708
+ seat and its worktree (derived from the runtime directory by the same rule as `team notify`'s sender, never from
709
+ a tmux window name; unresolvable fields are written `?`, not guessed), its start time, its expected duration and
710
+ its bound (the section table's Σband / Σbudget over the sections that run will execute), and the waiter prints
711
+ that record when it starts queueing and again when it hits its cap. Only the process that really holds the lock
712
+ writes and removes the holder record — and it writes only when that record is absent, stale (its process is gone)
713
+ or already names that same pid: the inherited `SMOKE_LOCK_MARKER` file is a hint, not a proof, so a descendant
714
+ that rewrites the marker with its own pid still cannot overwrite or delete a record naming another **live**
715
+ process. A record whose process is gone is printed as stale and ignored, and no run removes a record it did not
716
+ write. A nested run must finish inside the section that spawned it: its section
717
+ guard is armed with a deadline taken from the ancestor's currently armed section (the record publishes the
718
+ section guard's heartbeat path; the nested run reads `armed_epoch + budget` and takes the smaller of that and
719
+ its own table budget), so it trips at the suite's own safe point, names the section and the bound, stops and
720
+ leaves its scene; a fixture that leaves a registered nested run alive after its spawning section closed gets one
721
+ visible line naming it, and only the pids the fixture itself registered are signalled.
722
+
723
+ **The residual window is the explicit opt-out.** `TEAM_SMOKE_NO_LOCK=1`, a host without `flock` or the fast mode
724
+ (which runs no real-process section) leave the suite unserialised, so two seats' nested runs can overlap there.
725
+ The suite prints `no_lock=1` with the reason **and registers that run** in `<companion>.runs/<pid>.run` with
726
+ `no_lock=1` when that happens: the window is *observable* in the record, not just on stdout, and it is not
727
+ asserted away. The gate can prove that the record carries these fields, that a waiter prints them, and that a nested run
728
+ past its bound is named and stopped — it **cannot** prove that a live seat read the line and acted on it, nor
729
+ that two seats' nested runs never overlap. Those two are outside what the gate can show.
730
+
731
+ **A waiter re-resolves the path it is waiting on.** The wait is a bounded poll (one short non-blocking
732
+ `flock` per second, cap recomputed each round), not a single blocking `flock`: when the lock the waiter is
733
+ blocked on is unlinked and rebuilt while it waits, it prints one line with both identities (what it was waiting
734
+ on, what is on the path now) and goes on waiting on the path — never silently on a dead inode, which is how a
735
+ waiter ends up "holding" a lock nobody else can see.
736
+
737
+ **The queue cap follows the holder's published expected duration.** When the holder record publishes `started`
738
+ and `expected`, the waiter's cap is `clamp(remaining + 60 s, TEAM_SMOKE_LOCK_WAIT, 4 × TEAM_SMOKE_LOCK_WAIT)`
739
+ with `remaining = expected − (now − started)`, and the waiter prints that arithmetic together with the three
740
+ numbers; when the record publishes no `expected` (an older writer, or an unreadable record) the cap stays
741
+ `TEAM_SMOKE_LOCK_WAIT` exactly as before. The verdict token set (`PASS|FAIL|TIMEOUT|SKIPPED|UNKNOWN`), the
742
+ `queued Ns / ran Ns / limit Ns` accounting and the rule that a queue overrun is `FAIL` (never `TIMEOUT`) with
743
+ the holder named are all unchanged. `team review` takes the same pair, in the same order, in its own process,
744
+ and runs the project's gate with the lock descriptors closed: its gate record still separates `queued` from
745
+ `ran`, and a broken mutex makes the verdict `FAIL` with its own marker (internal `mutexbroken`; rendered as
746
+ `gate mutex broken(互斥被破坏:判定不可信)` in the record's flags, alongside `queuecap`) — either before the
747
+ gate runs (a live `top` record attesting another identity: the gate did **not** run, and the record says so,
748
+ exactly as the `queuecap` shape does) or after it (the gate ran, the record says the verdict is not trustworthy,
749
+ and it does not claim the gate never ran).
750
+
626
751
  **The gate fingerprints the tree it judges (P158).** Once the run's own root exists it records `HEAD` and the
627
752
  sha256 of `git status --porcelain --untracked-files=all` (untracked files included) into the run's scene file
628
753
  (`<run tmp>/run-fingerprint.txt`, next to `sections.tsv`), and compares that fingerprint again after the last
@@ -662,7 +787,8 @@ one core), the premise factors (`0.75` for the five-sample assembly median, `0.2
662
787
  and the sampled pane CPU, `TEAM_PANEL_CPU_PREMISE_FACTOR`) and the median-of-three/five rules are unchanged, every
663
788
  sample is printed, and above the premise the judgement **skips visibly** (exit `4` for a skip, `2` for a red, `0`
664
789
  only when every judgement ran green) rather than reporting a red the machine owes. The suite takes its **own** lock
665
- (`TEAM_PERF_LOCK`, `TEAM_PERF_LOCK_WAIT`, holder in `<lock>.holder`) and **never** takes `TEAM_SMOKE_LOCK`: it does
790
+ (`TEAM_PERF_LOCK`, `TEAM_PERF_LOCK_WAIT`, holder in `<companion>.holder`, where `<companion>` is
791
+ `<same dir>/.<basename>.machine` — the same pair the gate uses, so a perf lock survives the same incident) and **never** takes `TEAM_SMOKE_LOCK`: it does
666
792
  one read-only non-blocking probe of the gate lock and prints the holder when the correctness gate is running, but
667
793
  it never queues behind it. The gate's lock accounting (`limit=Ns queued=Ns ran=Ns`), the fixture-knob rule (those
668
794
  `TEAM_*` knobs only work under `TEAM_SMOKE_FIXTURE=1`, and in the real path they are ignored and printed) and the
@@ -673,14 +799,24 @@ review verdict. The contracts live in the specs (`verification#The correctness g
673
799
  `panel#Frame assembly is asynchronous, cached and never blocks input`); this section is the operational rule.
674
800
 
675
801
  The gate also reports **its own temp-root usage**: one line at the start and one with the result summary (also on
676
- failure) name the run's root, its size and its file count, and the run asserts that every root it created is gone
677
- unless it declared one kept. Fixtures get their root from `${TMPDIR:-/tmp}/teamsmith-<kind>.XXXXXX` through the
802
+ failure) name the run's root, its size, its file count and **how the root was resolved** (`source=tmpdir|config|
803
+ default`, plus the `TEAM_TMP_ROOT` value that lost when `TMPDIR` overrode it); the run also asserts that every root
804
+ it created is gone unless it declared one kept. Fixtures get their root from the
805
+ resolved temp root (`TMPDIR` → `TEAM_TMP_ROOT` → `/var/tmp/teamsmith-<ns>`, one resolver, never re-implemented):
806
+ `<that root>/teamsmith-<kind>-<ns>.XXXXXX`
807
+ (`ns = <slug>-<hash8>`, derived from the main checkout, so every worktree of one project shares it and two projects
808
+ cannot collide; the helper records it in the root's marker and the run ledger, `tmp-hygiene.sh --status` shows it,
809
+ and roots that predate the namespace are listed as `legacy`) through the
678
810
  single owner helper `tests/lib/tmp-root.sh` (owner marker inside, run ledger outside, reclaim on `EXIT`/`INT`/`TERM`,
679
811
  `TEAM_TMP_KEEP=1` to keep); residual roots are reclaimed by an **operator** action,
680
812
  `bash skills/teamsmith/tests/tmp-hygiene.sh --status` then `--sweep` (it proves a root is unoccupied before
681
- deleting, and refuses with nothing deleted when it cannot). The gate never sweeps: a fixture another agent started
813
+ deleting, and refuses with nothing deleted when it cannot), or by deleting only this project's own
814
+ `teamsmith-<kind>-<ns>.*` entries. A pattern against the shared prefix — `rm -rf "$(team_tmp_root)/teamsmith-*"` — is
815
+ forbidden: that shape is what deleted another project's running gate's lock on 2026-10-15, and a shared prefix is
816
+ not ownership. Everything a run creates directly under the temp root is either dot-prefixed (ledger, pid, evidence)
817
+ or carries the ns (root, queue marker, filter copy). The gate never sweeps: a fixture another agent started
682
818
  by hand is not in the gate lock, so pattern-deleting in the shared temp filesystem is the D37 family. `team doctor`
683
- prints the temp root's headroom (free/total bytes and inodes, warning only) so a full tmpfs is visible before it
819
+ prints the temp root's headroom (free/total bytes and inodes, warning only) so a full filesystem is visible before it
684
820
  turns into a red a fixture cannot explain.
685
821
 
686
822
  ### 9b-3. The ledger is public, so the ban is a gate check (D94)
@@ -778,3 +914,24 @@ The mechanism backs this up wherever the ledger already knows the name: `team di
778
914
  board-skipped line, wrap-up, suggestions), `team status` and `team roster` print the name next to the code, resolving
779
915
  it from the BOARD's task column first, then the task brief's H1, then the task's report H1. When no name is known the
780
916
  code is printed alone — never a made-up name, and never a hidden code: the code is the key to the ledger.
917
+
918
+ ### 11b. A caution earns its place by what it cites; a finding earns its place by what it changes
919
+
920
+ The rule in this section is about **support**, not tone. A sentence that hedges, qualifies, warns or sets a boundary
921
+ stays only when it names something the reader can check — a measurement, a counterexample, a gap in the reasoning,
922
+ or a boundary that was not observed; a sentence that names none is deleted, not kept as evidence of care. When the
923
+ evidence no longer supports a claim, say what the evidence does support instead of narrowing the claim, and never
924
+ delete a boundary statement that carries its evidence: it names exactly what this rule asks for. A finding,
925
+ likewise, states what it changed — the implementation, the next step, the conclusion, or nothing; an observation
926
+ that changes nothing does not stand between the reader and the answer. This is not an instruction to sound more
927
+ confident, more assertive or shorter (the measurements are in *Defensive Writing in GPT Models*, arXiv:2610.11355);
928
+ the vocabulary rule of §11 stands unchanged.
929
+
930
+ The reason is who rewards which text. In that study's comparison an AI reviewer scores a reviewer-oriented rewrite
931
+ higher (+1.22 on a ten-point scale) while the human readers find it harder to read (−0.70 on a seven-point scale)
932
+ with comprehension unchanged: a caution written for an imagined reviewer is paid for by the reader, so it has to
933
+ carry its evidence to earn its place.
934
+
935
+ **No tool verifies that a live author follows this rule.** The gate asserts nothing about wording — it can stay
936
+ green over a document that hedges everywhere — so whether a sentence earns its place is decided by the review that
937
+ reads the diff, and a surface that later loses the rule is caught there, by the reviewer naming the surface.
@@ -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
 
@@ -1159,8 +1163,15 @@ never recorded under the reference name.
1159
1163
 
1160
1164
  ## 25. The gate goes red for a reason that is not the code: the temp root is full
1161
1165
 
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
1166
+ The fixtures' or gates' temp root is a **shared** directory per project, and it is a *resolved* one: exactly one
1167
+ resolver decides it (`team_tmp_root`: a non-empty `TMPDIR`, else the project's `TEAM_TMP_ROOT`, else the platform
1168
+ default `/var/tmp/teamsmith-<project-ns>`), and every surface that names a root also prints how it decided —
1169
+ `source=tmpdir|config|default`, plus the value that lost when `TMPDIR` overrode it (`team status`, the dispatch
1170
+ capacity line, the gate's start line and `tmp-hygiene.sh --status` all read the same resolver). The default is on
1171
+ **disk**, not on the memory-backed `/tmp`, so a fixture's writes do not compete with the OOM killer for RAM;
1172
+ `/var/tmp` not being writable falls back to `/tmp`, and `TEAM_TMP_ROOT=/tmp` is the working rollback to the old
1173
+ behaviour. On 2026-09-22 09:50 the old default (`/tmp`, a memory-backed tmpfs on this host) was 100 % full (0 bytes
1174
+ free **and** the inode table full), and
1164
1175
  `tests/panel-p21.sh choices` produced an ENOSPC red whose verdict was about the code while the cause was the
1165
1176
  filesystem. Measure before believing a red whose failure text mentions "No space left on device",
1166
1177
  `mktemp: failed to create directory`, or a fixture dying while writing its own scene.
@@ -1185,13 +1196,16 @@ verification record is missing or uncommitted) while reclaiming the rest, and pr
1185
1196
  first deletion (exit 0 when something was done — skips are listed; exit 3 when every candidate was blocked and
1186
1197
  nothing was done). `--status` also counts tmux-side residue — orphan private servers whose socket is gone and stale
1187
1198
  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.
1199
+ 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
1200
 
1190
1201
  **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
1202
+ `tests/lib/tmp-root.sh` (`<the resolved root>/teamsmith-<kind>-<ns>.XXXXXX`; the resolver is called, never
1203
+ re-implemented), which writes an owner marker inside and a run ledger outside, reclaims on normal exit **and**
1204
+ `INT`/`TERM`, and keeps only when asked (`TEAM_TMP_KEEP=1`, which prints the path). Pointing a fixture elsewhere is
1205
+ `TMPDIR=/var/tmp bash tests/config-cli.sh` (an explicit root must already exist and be writable — it is never
1206
+ created for you; only the default leg is created, 0700, on the first write); a fixture template
1207
+ that hardcodes `/tmp` is a gate finding (`tests/tmp-hygiene.sh --lint` runs inside the gate), the docs that still
1208
+ teach the old default are a gate finding too (`tests/tmp-hygiene.sh --docs-check`), and the gate itself
1195
1209
  asserts that no root its run created survives it.
1196
1210
 
1197
1211
  **What to do when a gate dies mid-run** (`SIGKILL` cannot be caught, so a root survives): run the sweep above; the
@@ -1382,3 +1396,106 @@ record that `team board set <ID> done` and the merge step read. The details that
1382
1396
  - A container run cannot mount a `git worktree` — its `.git` is a pointer file to the main checkout, so every
1383
1397
  git-dependent fixture fails. Check the branch out with `git clone -b <task-branch> <root> /tmp/review-<ID>`
1384
1398
  instead and pass that clone's root to `--dir` (see the note at the end of §26; give the run `--pid=host`).
1399
+
1400
+ ## 28. Orphan seat processes: the agent still runs, its pane is gone
1401
+
1402
+ **Symptom**: `team ps` and `team status` end with a block that starts `孤儿席位进程(主机侧 /proc 普查;…)` and
1403
+ names pids, each with a `team reap <pid> --yes` command; `team digest`'s capacity line carries a
1404
+ `| 孤儿席位进程合计 ≥ …` hint once the host-wide total reaches `TEAM_ORPHAN_WARN_MB`; `team up` prints one line
1405
+ `孤儿席位进程:N 个本项目孤儿(合计 XMB)→ team reap --orphans --yes`.
1406
+
1407
+ **What it is**: a process whose command line names this project's configured agent (or PM) executable *and* whose own
1408
+ environment carries this project's identity (`TEAM_MAIN_ROOT` / `TEAM_ROOT`), but whose pane is gone. It appears when
1409
+ the tmux server — or just that window — died while the agent process kept running: a tmux crash, a killed session, or
1410
+ a corpse window whose pane died under a live process (§11b). The process keeps holding its memory and its model
1411
+ session, which is why it is worth cleaning up.
1412
+
1413
+ The judgement is made on the process's **own** tmux server (the socket named in its `TMUX`) — never on the default
1414
+ server, never on "is this the current window": no `TMUX_PANE` means orphan, and a pane id that is absent from that
1415
+ server's pane list means orphan. If that server cannot be queried the process is **unjudged**: counted, never called
1416
+ an orphan, never reaped.
1417
+
1418
+ **How to clean it** — plan first, then execute:
1419
+
1420
+ ```bash
1421
+ team reap --orphans # the plan: names every target and the signal it would send, sends nothing (exit 0)
1422
+ team reap --orphans --yes # execute; or one pid at a time: team reap <pid> --yes
1423
+ ```
1424
+
1425
+ Each target is re-verified immediately before its signal — still this project's seat, still no live pane, the same
1426
+ process start time the plan recorded (a pid the kernel reused in between is refused) — then `SIGTERM`, a bounded 5 s
1427
+ wait, and only then `SIGKILL`. Every signal appends one line to `state/reap.log`; a target that is not clean makes the
1428
+ command exit non-zero. `--yes` is the only authorization: no configuration key, environment variable or inherited
1429
+ value turns it on.
1430
+
1431
+ **Why nothing is cleaned up automatically** — three reasons, and each of them has bitten:
1432
+
1433
+ - The reading is **read-only**: it is appended to `team ps`/`team status`, and nobody expects those to signal
1434
+ anything.
1435
+ - Another project's orphans and identity-less same-shaped processes are only **counted**, never named — the reading
1436
+ is meant to be pasted into the ledger, so printing their pids, seats or paths would leak another project's state;
1437
+ and a sweep acting on that count would kill another project's seats.
1438
+ - An unqueryable tmux server leaves a process **unjudged**: "I cannot tell" must never become "kill it".
1439
+
1440
+ So the decision stays with a human (or the PM) in front of a named list. `TEAM_ORPHAN_SCAN=0` turns the whole reading
1441
+ off — `team ps`/`team status`/`team up` then print one named skip line, `team digest` adds no hint, and
1442
+ `team reap --orphans` refuses (cleanup still works with an explicit pid) — for hosts where reading another process's
1443
+ environment is refused.
1444
+
1445
+ **Not to be confused with**: the orphan tmux **server** of §25 — a private server whose socket is gone and whose temp
1446
+ root never got swept. That is temp-root hygiene (`bash <skill>/tests/tmp-hygiene.sh --status`, then `--sweep`), not a
1447
+ seat process.
1448
+
1449
+ ## 29. A seat is stuck in one very long turn (its message is never read)
1450
+
1451
+ **Symptom**: a message handed to a seat (`team say`, `notify`, a reply to its question) is never read. Its window
1452
+ shows `Working` with a growing `Elapsed`; its own session file and its worktree stop changing; `team ps` still calls
1453
+ it running. The wake-up loop delivers at **turn end**, so a turn that never ends swallows every message — this is
1454
+ the shape behind D188 (two seats stuck 18 h and 16 h with two unread messages).
1455
+
1456
+ **First read the evidence** — the plan prints it, and it is the evidence the decision rests on. `team interrupt
1457
+ <seat> --reason <one line>` reads (and prints) the seat's last session-file write `session_last`, the number of
1458
+ uncommitted files in its worktree `uncommitted`, and the **newer** of the two as the newest disk evidence with its
1459
+ age. Fresh evidence (newer than the freshness window, default 3600 s) means the seat **is writing**: the interrupt
1460
+ refuses and names the file and its age, because ending a seat mid-write is how a half-written file happens.
1461
+ `TEAM_INTERRUPT_FRESH_SEC` is the knob for that bounded default (non-numeric falls back to it).
1462
+
1463
+ **How to use it**:
1464
+
1465
+ ```bash
1466
+ team interrupt dev --reason "18h without a commit; the queued root cause is unread" # plan: zero signals, zero writes, exit 0
1467
+ team interrupt dev --reason "…" --yes # execute
1468
+ team resume --agent dev # the way back into the same session
1469
+ ```
1470
+
1471
+ `--yes` is the only authorization: it is read from this command line alone, and no configuration key, environment
1472
+ variable or inherited value turns a signal on. The reason is required, and it is written into the seat's thread (the
1473
+ second step of its reading order on resume) and its inbox **before** the signal; if either cannot be written the
1474
+ interrupt is refused and nothing is signalled. An authorized interrupt appends exactly one line to
1475
+ `state/interrupt.log` carrying the readings taken *before* the signal (`session_last`, `uncommitted`, `guard`,
1476
+ `signal`, `outcome`).
1477
+
1478
+ **What a refusal means**: nothing was signalled and nothing was written — plan mode and every refusal leave the
1479
+ seat's worktree, thread, inbox and audit byte-identical. The message names the reason (window gone, the pane no
1480
+ longer holds that pid, the start time changed, identity gone, not in the roster, another project, yourself or an
1481
+ ancestor, or fresh evidence) and the route for it (`team resume --agent <seat>`, or `team reap --orphans` when the
1482
+ pane is gone but the process lives). A refusal is **not** a verdict on the seat's work.
1483
+
1484
+ **Known boundaries**:
1485
+
1486
+ - Only the one **proven pid** is signalled — never by name, pattern, process tree or process group. The proof chain
1487
+ is the assignment record's window → that window's pane → this project's identity and the recorded start time, and
1488
+ the same facts are re-verified immediately before the signal; any change refuses.
1489
+ - The window is left as a **live shell**: nothing is respawned, no session is created, and nothing but the seat
1490
+ process is signalled. The seat's **background jobs are detached and survive** — that is `long-job-suspend`'s lane;
1491
+ run `team bg list` before resuming.
1492
+ - The worktree, the session file and the assignment record are untouched, so an interrupted turn loses no state.
1493
+ - The panel's death-reason reading may say `unknown` afterwards: this entry is not a death-cause word. `team resume
1494
+ --agent <seat>` continues the same session (`mode=continued`).
1495
+ - `--force` crosses exactly **one** refusal — the freshness window — and the audit line records `guard=forced`. It
1496
+ never crosses identity, liveness, the roster, cross-project refusal, or "this is yourself/an ancestor".
1497
+ - `--reason` and the refusal wording are not gated (D170); the behaviour is (fixture `tests/seat-interrupt.sh`,
1498
+ gate section `51c`).
1499
+
1500
+ **Not to be confused with**: §28 (`reap` = the pane is gone and the process is an orphan), a seat that has
1501
+ *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.