teamsmith 0.1.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -7
- package/package.json +1 -1
- package/skills/teamsmith/CHANGELOG.md +67 -0
- package/skills/teamsmith/SKILL.md +26 -8
- package/skills/teamsmith/extension/team-notify.ts +37 -6
- package/skills/teamsmith/extension/team.ts +438 -0
- package/skills/teamsmith/references/agent-adapters.md +7 -7
- package/skills/teamsmith/references/config.md +65 -18
- package/skills/teamsmith/references/migration.md +220 -34
- package/skills/teamsmith/references/protocol.md +250 -25
- package/skills/teamsmith/references/troubleshooting.md +124 -7
- package/skills/teamsmith/references/workflows.md +66 -20
- package/skills/teamsmith/scripts/lib/cmd-agents.sh +525 -90
- package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +71 -10
- package/skills/teamsmith/scripts/lib/cmd-config.sh +562 -128
- package/skills/teamsmith/scripts/lib/cmd-death.sh +2 -15
- package/skills/teamsmith/scripts/lib/cmd-docs.sh +6 -3
- package/skills/teamsmith/scripts/lib/cmd-draft.sh +4 -4
- package/skills/teamsmith/scripts/lib/cmd-help.sh +677 -0
- package/skills/teamsmith/scripts/lib/cmd-init.sh +157 -5
- package/skills/teamsmith/scripts/lib/cmd-interrupt.sh +461 -0
- package/skills/teamsmith/scripts/lib/cmd-meeting.sh +2 -25
- package/skills/teamsmith/scripts/lib/cmd-project.sh +149 -105
- package/skills/teamsmith/scripts/lib/cmd-reap.sh +277 -0
- package/skills/teamsmith/scripts/lib/cmd-reply.sh +96 -0
- package/skills/teamsmith/scripts/lib/cmd-review.sh +188 -40
- package/skills/teamsmith/scripts/lib/cmd-status.sh +268 -30
- package/skills/teamsmith/scripts/lib/cmd-update.sh +36 -7
- package/skills/teamsmith/scripts/lib/cmd-watch.sh +634 -54
- package/skills/teamsmith/scripts/lib/common.sh +1560 -109
- package/skills/teamsmith/scripts/lib/gate-lock.sh +544 -0
- package/skills/teamsmith/scripts/monitor.mjs +34 -3
- package/skills/teamsmith/scripts/panel/README.md +22 -11
- package/skills/teamsmith/scripts/panel/draft-send.sh +11 -1
- package/skills/teamsmith/scripts/panel/panel.js +226 -224
- package/skills/teamsmith/scripts/panel/src/App.tsx +478 -184
- package/skills/teamsmith/scripts/panel/src/clipboard.ts +11 -5
- package/skills/teamsmith/scripts/panel/src/compose.ts +6 -3
- package/skills/teamsmith/scripts/panel/src/data.ts +95 -7
- package/skills/teamsmith/scripts/panel/src/layout.ts +703 -152
- package/skills/teamsmith/scripts/panel/src/main.tsx +129 -19
- package/skills/teamsmith/scripts/panel/src/settings.ts +1 -1
- package/skills/teamsmith/scripts/panel/src/strings/en.ts +76 -31
- package/skills/teamsmith/scripts/panel/src/strings/zh.ts +78 -33
- package/skills/teamsmith/scripts/panel/src/types.ts +204 -17
- package/skills/teamsmith/scripts/replies.mjs +896 -0
- package/skills/teamsmith/scripts/shim/tmux +18 -0
- package/skills/teamsmith/scripts/strings/commands.tsv +86 -0
- package/skills/teamsmith/scripts/strings/help.en.tsv +503 -0
- package/skills/teamsmith/scripts/strings/help.zh.tsv +489 -0
- package/skills/teamsmith/scripts/team +20 -6
- package/skills/teamsmith/templates/AGENTS.section.md.tmpl +23 -3
- package/skills/teamsmith/templates/BOARD.md.tmpl +2 -2
- package/skills/teamsmith/templates/OWNERSHIP.md.tmpl +7 -3
- package/skills/teamsmith/templates/PROTOCOL.md.tmpl +17 -0
- package/skills/teamsmith/templates/config.sh.tmpl +29 -5
- package/skills/teamsmith/templates/memory-seed.md.tmpl +3 -0
- package/skills/teamsmith/templates/pm-prompt.md.tmpl +41 -1
- package/skills/teamsmith/templates/report.md.tmpl +12 -0
- package/skills/teamsmith/templates/task.md.tmpl +4 -0
- package/skills/teamsmith/tests/bg-ledger-harness.mjs +464 -40
- package/skills/teamsmith/tests/bg-ledger.sh +168 -10
- package/skills/teamsmith/tests/checkout-shape-probe.sh +3 -1
- package/skills/teamsmith/tests/config-cli.sh +320 -300
- package/skills/teamsmith/tests/death-cause.sh +5 -2
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +7 -1
- package/skills/teamsmith/tests/fixtures/p287/lint-good.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p287/lint-hardcoded.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p287/lint-no-ns.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +18 -6
- package/skills/teamsmith/tests/flip-m33.sh +5 -3
- package/skills/teamsmith/tests/flip-m37.sh +4 -1
- package/skills/teamsmith/tests/flip-m4.3.sh +4 -1
- package/skills/teamsmith/tests/flip-m6.3.sh +4 -1
- package/skills/teamsmith/tests/flip-m6.5.sh +4 -1
- package/skills/teamsmith/tests/flip-m7.2.sh +4 -1
- package/skills/teamsmith/tests/flip-p158.sh +2 -1
- package/skills/teamsmith/tests/flip-p210.sh +4 -1
- package/skills/teamsmith/tests/flip-p217.sh +4 -1
- package/skills/teamsmith/tests/flip-p287-lock.sh +342 -0
- package/skills/teamsmith/tests/flip-p287-name.sh +279 -0
- package/skills/teamsmith/tests/flip-p304-read-side.sh +98 -0
- package/skills/teamsmith/tests/flip-p308-skip-not-pass.sh +151 -0
- package/skills/teamsmith/tests/flip-p309-p162-deep.sh +122 -0
- package/skills/teamsmith/tests/flip-p310-lock.sh +216 -0
- package/skills/teamsmith/tests/flip-p310-socket.sh +125 -0
- package/skills/teamsmith/tests/help-surface.sh +1664 -0
- package/skills/teamsmith/tests/install-shape.sh +283 -22
- package/skills/teamsmith/tests/key-replies-pty.sh +374 -0
- package/skills/teamsmith/tests/key-replies-ui.sh +325 -0
- package/skills/teamsmith/tests/key-replies.sh +1314 -0
- package/skills/teamsmith/tests/ledger-ban.sh +9 -8
- package/skills/teamsmith/tests/ledger-claim.sh +248 -0
- package/skills/teamsmith/tests/lib/bounded-spin.sh +90 -0
- package/skills/teamsmith/tests/lib/model-policy.sh +30 -0
- package/skills/teamsmith/tests/lib/model-routing-boundary.sh +420 -0
- package/skills/teamsmith/tests/lib/model-routing-expansion.sh +155 -0
- package/skills/teamsmith/tests/lib/model-routing-flips.py +187 -0
- package/skills/teamsmith/tests/lib/model-routing-roles.sh +250 -0
- package/skills/teamsmith/tests/lib/proc-io.sh +103 -0
- package/skills/teamsmith/tests/lib/reply-fixture.sh +367 -0
- package/skills/teamsmith/tests/lib/section-guard.sh +258 -13
- package/skills/teamsmith/tests/lib/tmp-root.sh +139 -27
- package/skills/teamsmith/tests/lib/tmux-cap.sh +10 -1
- package/skills/teamsmith/tests/lib/tmux-iso.sh +39 -13
- package/skills/teamsmith/tests/loop-inventory.tsv +59 -47
- package/skills/teamsmith/tests/panel-b2.sh +107 -4
- package/skills/teamsmith/tests/panel-b3-stub.sh +139 -4
- package/skills/teamsmith/tests/panel-b3.sh +189 -29
- package/skills/teamsmith/tests/panel-choices.sh +81 -63
- package/skills/teamsmith/tests/panel-cpu.sh +3 -2
- package/skills/teamsmith/tests/panel-knobs.sh +7 -1
- package/skills/teamsmith/tests/panel-p21.sh +445 -241
- package/skills/teamsmith/tests/panel-snapshots.sh +41 -225
- package/skills/teamsmith/tests/panel-strings.mjs +33 -18
- package/skills/teamsmith/tests/perf.sh +122 -31
- package/skills/teamsmith/tests/pm-box-real.sh +1 -1
- package/skills/teamsmith/tests/pulse-nudge-key.sh +1 -1
- package/skills/teamsmith/tests/routes.sh +364 -109
- package/skills/teamsmith/tests/seat-interrupt.sh +1002 -0
- package/skills/teamsmith/tests/seat-visibility.sh +675 -0
- package/skills/teamsmith/tests/section-budgets.tsv +26 -12
- package/skills/teamsmith/tests/section-guard.sh +6 -1
- package/skills/teamsmith/tests/section-needs-audit.sh +24 -7
- package/skills/teamsmith/tests/section-paths.tsv +42 -26
- package/skills/teamsmith/tests/section-select.sh +90 -7
- package/skills/teamsmith/tests/slash-team-e2e.sh +323 -0
- package/skills/teamsmith/tests/slash-team.sh +617 -0
- package/skills/teamsmith/tests/smoke.sh +3762 -628
- package/skills/teamsmith/tests/snapshots/zh-dark-120-detail.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-120-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-120.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-dark-160-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-160.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-dark-59-detail.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-dark-59-p4.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-dark-59.txt +5 -5
- package/skills/teamsmith/tests/snapshots/zh-dark-99-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-dark-99.txt +5 -5
- package/skills/teamsmith/tests/snapshots/zh-light-120-detail.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-120-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-120.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-light-160-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-160.txt +9 -9
- package/skills/teamsmith/tests/snapshots/zh-light-59-detail.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-light-59-p4.txt +1 -1
- package/skills/teamsmith/tests/snapshots/zh-light-59.txt +5 -5
- package/skills/teamsmith/tests/snapshots/zh-light-99-p4.txt +2 -2
- package/skills/teamsmith/tests/snapshots/zh-light-99.txt +5 -5
- package/skills/teamsmith/tests/task-header-model.sh +2 -1
- package/skills/teamsmith/tests/task-model-routing.sh +1511 -0
- package/skills/teamsmith/tests/tmp-hygiene.sh +782 -45
- package/skills/teamsmith/tests/tmux-identity-leak.sh +773 -0
- package/skills/teamsmith/tests/tmux-lint-legacy.txt +12 -18
- package/skills/teamsmith/tests/upgrade-recipe.sh +537 -0
- package/skills/teamsmith-init/SKILL.md +43 -43
- package/skills/teamsmith-init/references/bootstrap.md +8 -6
- package/skills/teamsmith-init/templates/bootstrap-prompt.md.tmpl +9 -5
|
@@ -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
|
-
-
|
|
70
|
-
of
|
|
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
|
|
@@ -84,6 +94,16 @@ Guards and limitations:
|
|
|
84
94
|
earlier than the automatic one. The **recipient** names the durable inbox file (`docs/team/inbox/<agent>.md`);
|
|
85
95
|
the PM is still the **knock destination** — the queue entry's declaration and the wake pointer both name that
|
|
86
96
|
same recipient file, and a durable append that fails exits non-zero without a wake.
|
|
97
|
+
- **The turn-end notice separates three endings**, the same three turn-end states the worker prompt names: a
|
|
98
|
+
**completed** turn with no job of that session still running is `[auto]`; the same turn with live jobs is
|
|
99
|
+
`[auto·suspended]`, carrying `awaiting=<id>[,<id>…]`; an **unfinished** turn stays `[auto·interrupted]` (with
|
|
100
|
+
`awaiting=` too when its jobs are alive). A suspension omits the `⚠ 未提交` prefix — it is not a delivery claim —
|
|
101
|
+
while `uncommitted=<n>` stays. The three states are **delivered**, **hard-blocked** and
|
|
102
|
+
**suspended on background jobs**, and the lane rule is the suspend default: `team_bg_run` starts a long job and
|
|
103
|
+
the turn ends; the completion wake-up is the normal harvest point; in-turn waiting is the bounded exception,
|
|
104
|
+
only inside the inline-wait budget (about 2 minutes), when the result blocks the next step and nothing else can
|
|
105
|
+
advance. A seat that suspended and then died needs no new patrol clause: an unfinished task with no live window
|
|
106
|
+
is already pending work (§8).
|
|
87
107
|
- The **other** injected extension is `extension/team-bg.ts` (M27) — not notification, but the team's own
|
|
88
108
|
background lane: `team_bg_run` starts a detached job (bounded `state/bg/<id>.log`), `team_bg_wait <id>` harvests
|
|
89
109
|
it, a harvested job stays silent, several finishing jobs arrive as one message, and every turn end appends
|
|
@@ -119,10 +139,79 @@ Guards and limitations:
|
|
|
119
139
|
call appends one line to `state/signal-calls.log` (`TEAM_SIGNAL_CALLS_LOG`), and a refusal is also copied byte
|
|
120
140
|
for byte into `<log>.forensics` so it outlives the call log's rotation.
|
|
121
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
|
+
|
|
163
|
+
## 4b. Key replies: publish the body before you answer
|
|
164
|
+
|
|
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:
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
team reply post --from <seat> --title "<short single line>" --stdin <<'EOF'
|
|
176
|
+
… the exact body you are about to send …
|
|
177
|
+
EOF
|
|
178
|
+
```
|
|
179
|
+
|
|
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
|
|
189
|
+
reported `saved` (0), an input error (2), storage unavailable (4), a busy writer (5, the lock wait is bounded) or
|
|
190
|
+
`unconfirmed` (6, the entry is visible but its durability could not be confirmed — never re-post it automatically).
|
|
191
|
+
Failures are diagnostics on stderr; they must not be concatenated into the answer, and they must not stop it.
|
|
192
|
+
|
|
193
|
+
What a receipt does and does not mean:
|
|
194
|
+
- **A saved receipt is project-local durable publication only.** It is not user delivery, not approval, not read
|
|
195
|
+
status, and not a refreshed console. Nothing else changes state: publishing creates no pending work, no BOARD row,
|
|
196
|
+
no outbox/inbox entry, no patrol wake-up, and no confirmation/reminder/approval lifecycle.
|
|
197
|
+
- **No new configuration key.** The capability is part of the tool, not a project setting.
|
|
198
|
+
- **Storage is project state, outside the published tree**: `<main_root>/.pi/team/state/key-replies/` holds a
|
|
199
|
+
fixed-size commit index plus the immutable originals (`team paths` resolves the root; the store never lands in
|
|
200
|
+
`docs/team/` or in a checkout). `list` / `show` / the console's summary are **observation-only**: they never
|
|
201
|
+
create, repair or lock anything, and a missing store stays missing.
|
|
202
|
+
- **Read it back with the tool, not by hand**: `team reply list [--before <no>] [--json]` pages the numbered slots
|
|
203
|
+
(newest first), `team reply show <no>` prints safe display text, `team reply show <no> --raw` exports the original
|
|
204
|
+
bytes to a non-TTY stdout, and the console's page 5 renders the latest reply plus the numbered history. Flags and
|
|
205
|
+
exit codes are in `team reply --help`.
|
|
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.
|
|
210
|
+
|
|
122
211
|
## 5. Task briefs: written for "a weak model without context"
|
|
123
212
|
|
|
124
|
-
The
|
|
125
|
-
ambiguous requirement on its own**, so a brief has to be self-contained:
|
|
213
|
+
The `routine` category usually runs a cheap, fast model (e.g. `opencode-go/deepseek-v4.1-flash`). It **will not
|
|
214
|
+
correct an ambiguous requirement on its own**, so a brief has to be self-contained:
|
|
126
215
|
|
|
127
216
|
- Background: why this is being done, where the relevant docs are (do not paste large chunks of code).
|
|
128
217
|
- Deliverables: file paths plus key signatures/behaviour, item by item.
|
|
@@ -180,14 +269,30 @@ exactly how a printed fix turned into `✗ dispatch: 未知参数 --force(…
|
|
|
180
269
|
with no override still refuses. A printed route is a promise, not decoration: `tests/routes.sh` applies every
|
|
181
270
|
`修法:`/`改行:` family in a fixture and reddens when a route stops clearing its blocker or is no longer honored.
|
|
182
271
|
|
|
183
|
-
## 6. Model strategy:
|
|
272
|
+
## 6. Model strategy: task categories; different families for verification
|
|
184
273
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
274
|
+
The contract maps **task categories** to models (`TEAM_TASK_MODELS`) and names one independent `TEAM_PM_MODEL`.
|
|
275
|
+
The brief's `category:` selects a new dispatch's model, `team dispatch --model` overrides one launch, and a
|
|
276
|
+
complete same-task recovery keeps the model/SID it was committed to (even if the category later leaves the map).
|
|
277
|
+
The engine never derives a model from a phase or a seat: "verify" is a project category name, not an automatic
|
|
278
|
+
phase→model mapping, so a project with other names says which one means independent review.
|
|
279
|
+
|
|
280
|
+
| Use | Category | Selection principle |
|
|
281
|
+
|---|---|---|
|
|
282
|
+
| Implementation/tests/docs | `routine` | a cheap model without concurrency limits; a good brief is enough |
|
|
283
|
+
| Complex planning / important architecture judgment | `analysis` | a strong model, with the reasoning recorded on disk (decision log/design), not only in a session |
|
|
284
|
+
| Independent verification/adversarial analysis | `verify` | switch model families (to avoid the same blind spots); a strong author model never waives independent review |
|
|
285
|
+
| Heavy concurrent work | any | the subscription token/quota is shared → cap concurrency with `TEAM_MODEL_LIMITS` and queue the rest; `team ps` shows occupancy |
|
|
286
|
+
|
|
287
|
+
Changing the policy changes **future** selections only. Redefining or dropping a category does not invalidate a
|
|
288
|
+
committed assignment: recovery uses the recorded model/SID, while a **new** task citing a dropped category is
|
|
289
|
+
refused. A running PM keeps its model until an explicit `team up --fresh-pm`, and a fresh takeover continues from
|
|
290
|
+
the files on disk (brief, report, thread, `state/`), never by replaying a conversation.
|
|
291
|
+
|
|
292
|
+
Private source verification, protected-branch source landing, this project's configuration/fresh launch and shared
|
|
293
|
+
skill-source adoption are **four separate recorded gates**; each is previewed and authorized per operation. A
|
|
294
|
+
shared skill link reads its target's current bytes, so changing that target can affect other projects without an
|
|
295
|
+
installer.
|
|
191
296
|
|
|
192
297
|
`team dispatch` checks `TEAM_MODEL_LIMITS` and capacity before dispatching: the rules (from two OOM incidents on CEP,
|
|
193
298
|
one of which hit RAM and zram bottom at the same time):
|
|
@@ -456,7 +561,7 @@ unresolved `merge --squash` is caught by the next gate instead of reaching `main
|
|
|
456
561
|
A trap: an add/add conflict is often git's rename detection pairing two different paths (e.g. `reviews/<ID>.md` and
|
|
457
562
|
`reports/<ID>-<agent>.md`). Retry with `git -c merge.renames=false merge --squash <branch>` and it goes away.
|
|
458
563
|
|
|
459
|
-
## 8f. Template rendering and dispatch traps (measured on
|
|
564
|
+
## 8f. Template rendering and dispatch traps (measured on an external project)
|
|
460
565
|
|
|
461
566
|
- **Rendering must not go through sed**: `&` inside the replacement string means "the matched text", so
|
|
462
567
|
`TEAM_GATES="pnpm test && pnpm lint"` was written out as `pnpm test {{GATES}}{{GATES}} pnpm lint`. `team_render` now
|
|
@@ -465,7 +570,7 @@ A trap: an add/add conflict is often git's rename detection pairing two differen
|
|
|
465
570
|
`init` also escapes gate values containing `$ \` \ "` before writing them into the config, so sourcing it back
|
|
466
571
|
yields the same value as the input (and is never executed).
|
|
467
572
|
- **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
|
|
573
|
+
in `command not found` (reproduced twice on an external project). Dispatch now resolves pi's absolute path first, writes it into the
|
|
469
574
|
window command, and checks that it exists before dispatching (a missing binary fails immediately instead of being
|
|
470
575
|
discovered inside the window).
|
|
471
576
|
- **GitLab API headers and bodies must match**: if `--data-urlencode` is the form body, then
|
|
@@ -553,16 +658,96 @@ carries an illegal token, so the read side and the write side can never disagree
|
|
|
553
658
|
|
|
554
659
|
The full gate — `openspec validate … && bash skills/teamsmith/tests/smoke.sh` — spends the machine's tmux servers,
|
|
555
660
|
node/bun processes and login shells, so it is serialised on **one gate lock**
|
|
556
|
-
(`${TEAM_SMOKE_LOCK:-${TMPDIR:-/tmp}/teamsmith-smoke.lock}`,
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
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.
|
|
560
689
|
|
|
561
690
|
**A lock that cannot be taken is a visible degradation, not a hard failure.** If the lock file cannot be
|
|
562
691
|
created (or `flock` is absent) the suite prints `注意:锁文件 … 建不了 → 不做排队` and runs anyway; only a
|
|
563
|
-
*queue overrun* is loud (a one-line `排队超限` naming the holder in `<
|
|
692
|
+
*queue overrun* is loud (a one-line `排队超限` naming the holder in `<companion>.holder`, exit 2), and a genuine
|
|
564
693
|
red is exit 1 with no queue wording (P66/P100's F1).
|
|
565
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
|
+
|
|
566
751
|
**The gate fingerprints the tree it judges (P158).** Once the run's own root exists it records `HEAD` and the
|
|
567
752
|
sha256 of `git status --porcelain --untracked-files=all` (untracked files included) into the run's scene file
|
|
568
753
|
(`<run tmp>/run-fingerprint.txt`, next to `sections.tsv`), and compares that fingerprint again after the last
|
|
@@ -602,7 +787,8 @@ one core), the premise factors (`0.75` for the five-sample assembly median, `0.2
|
|
|
602
787
|
and the sampled pane CPU, `TEAM_PANEL_CPU_PREMISE_FACTOR`) and the median-of-three/five rules are unchanged, every
|
|
603
788
|
sample is printed, and above the premise the judgement **skips visibly** (exit `4` for a skip, `2` for a red, `0`
|
|
604
789
|
only when every judgement ran green) rather than reporting a red the machine owes. The suite takes its **own** lock
|
|
605
|
-
(`TEAM_PERF_LOCK`, `TEAM_PERF_LOCK_WAIT`, holder in `<
|
|
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
|
|
606
792
|
one read-only non-blocking probe of the gate lock and prints the holder when the correctness gate is running, but
|
|
607
793
|
it never queues behind it. The gate's lock accounting (`limit=Ns queued=Ns ran=Ns`), the fixture-knob rule (those
|
|
608
794
|
`TEAM_*` knobs only work under `TEAM_SMOKE_FIXTURE=1`, and in the real path they are ignored and printed) and the
|
|
@@ -613,14 +799,24 @@ review verdict. The contracts live in the specs (`verification#The correctness g
|
|
|
613
799
|
`panel#Frame assembly is asynchronous, cached and never blocks input`); this section is the operational rule.
|
|
614
800
|
|
|
615
801
|
The gate also reports **its own temp-root usage**: one line at the start and one with the result summary (also on
|
|
616
|
-
failure) name the run's root, its size
|
|
617
|
-
|
|
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
|
|
618
810
|
single owner helper `tests/lib/tmp-root.sh` (owner marker inside, run ledger outside, reclaim on `EXIT`/`INT`/`TERM`,
|
|
619
811
|
`TEAM_TMP_KEEP=1` to keep); residual roots are reclaimed by an **operator** action,
|
|
620
812
|
`bash skills/teamsmith/tests/tmp-hygiene.sh --status` then `--sweep` (it proves a root is unoccupied before
|
|
621
|
-
deleting, and refuses with nothing deleted when it cannot)
|
|
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
|
|
622
818
|
by hand is not in the gate lock, so pattern-deleting in the shared temp filesystem is the D37 family. `team doctor`
|
|
623
|
-
prints the temp root's headroom (free/total bytes and inodes, warning only) so a full
|
|
819
|
+
prints the temp root's headroom (free/total bytes and inodes, warning only) so a full filesystem is visible before it
|
|
624
820
|
turns into a red a fixture cannot explain.
|
|
625
821
|
|
|
626
822
|
### 9b-3. The ledger is public, so the ban is a gate check (D94)
|
|
@@ -628,7 +824,10 @@ turns into a red a fixture cannot explain.
|
|
|
628
824
|
Since 2026-10-04 the readable ledger — board, decisions, roadmap, ownership, briefs, the text of reports and
|
|
629
825
|
verification records, threads — is committed to the repository (D94). A brief or a report is therefore public the
|
|
630
826
|
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
|
|
827
|
+
So the ban is a check in the gate: suite section `60` runs `tests/ledger-ban.sh`, which scans every file under
|
|
828
|
+
`docs/team` that would be committed (`git ls-files -c -o --exclude-standard`; P231 widened this from `**/*.md`,
|
|
829
|
+
because the `.tsv` ledgers — precisely where branch and project names get written — were a blind spot: a planted
|
|
830
|
+
leak there came back green)
|
|
632
831
|
and fails, naming file and line, on
|
|
633
832
|
|
|
634
833
|
- a home directory (`/home/<name>…` or `/Users/<name>…`; the ellipsis placeholders `/home/.../` and `/home/…/` pass);
|
|
@@ -656,7 +855,12 @@ itself failed. Falsifiability lives in the fixture self-test (`bash tests/ledger
|
|
|
656
855
|
path and a planted forbidden name must come back red with file:line, a missing list must show the visible skip, a
|
|
657
856
|
shadow scanner whose hit counter is broken must make the two red cases fail, and a second shadow whose masking is
|
|
658
857
|
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.
|
|
858
|
+
a placeholder standing before the hit (the offset must survive the blanking), and an over-long line. P231 extends
|
|
859
|
+
both ends: the face itself is pinned by the ownership fixture (`tests/ledger-claim.sh`) — a planted name in a
|
|
860
|
+
`docs/team/ledger/*.tsv` must come back red naming that file and line, while a copy of the scanner whose face is
|
|
861
|
+
narrowed back to `*.md` must return `hits=0` on the same tree (the false green, reproduced) — and the header rules
|
|
862
|
+
(`# ledger-scan:` must be a single line and must point at the section that carries this check) are refused at load
|
|
863
|
+
time instead of at check time.
|
|
660
864
|
|
|
661
865
|
## 9c. Strong verification (adversarial package + finding flips, for milestones)
|
|
662
866
|
|
|
@@ -710,3 +914,24 @@ The mechanism backs this up wherever the ledger already knows the name: `team di
|
|
|
710
914
|
board-skipped line, wrap-up, suggestions), `team status` and `team roster` print the name next to the code, resolving
|
|
711
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
|
|
712
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**
|
|
1163
|
-
|
|
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
|
|
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` (
|
|
1192
|
-
ledger outside, reclaims on normal exit **and**
|
|
1193
|
-
prints the path). Pointing a fixture elsewhere is
|
|
1194
|
-
|
|
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).
|