teamsmith 0.3.0 → 0.3.2
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 +4 -4
- package/package.json +6 -2
- package/skills/teamsmith/CHANGELOG.md +56 -0
- package/skills/teamsmith/SKILL.md +7 -7
- package/skills/teamsmith/extension/team-inbox-watch.ts +5 -3
- package/skills/teamsmith/references/protocol.md +33 -19
- package/skills/teamsmith/references/troubleshooting.md +6 -3
- package/skills/teamsmith/scripts/lib/cmd-review.sh +15 -10
- package/skills/teamsmith/scripts/lib/cmd-status.sh +8 -4
- package/skills/teamsmith/scripts/lib/common.sh +301 -267
- package/skills/teamsmith/scripts/lib/gate-lock.sh +66 -28
- package/skills/teamsmith/scripts/panel/panel.js +64 -64
- package/skills/teamsmith/scripts/panel/src/clipboard.ts +2 -1
- package/skills/teamsmith/scripts/panel/src/data.ts +40 -2
- package/skills/teamsmith/scripts/panel/src/main.tsx +5 -1
- package/skills/teamsmith/scripts/shim/killall +10 -0
- package/skills/teamsmith/scripts/shim/pgrep +10 -0
- package/skills/teamsmith/scripts/shim/pidof +10 -0
- package/skills/teamsmith/scripts/shim/pkill +10 -0
- package/skills/teamsmith/scripts/shim/signal-gate +108 -31
- package/skills/teamsmith/tests/README.md +31 -0
- package/skills/teamsmith/tests/checkout-shape-probe.sh +80 -53
- package/skills/teamsmith/tests/config-cli.sh +28 -22
- package/skills/teamsmith/tests/flip-p310-lock.sh +3 -9
- package/skills/teamsmith/tests/gate-guard.sh +52 -79
- package/skills/teamsmith/tests/help-surface.sh +2 -2
- package/skills/teamsmith/tests/install-shape.sh +127 -8
- package/skills/teamsmith/tests/key-replies-ui.sh +2 -1
- package/skills/teamsmith/tests/key-replies.sh +41 -27
- package/skills/teamsmith/tests/lib/pty-wait.sh +21 -111
- package/skills/teamsmith/tests/lib/section-guard.sh +104 -197
- package/skills/teamsmith/tests/loop-inventory.tsv +83 -89
- package/skills/teamsmith/tests/panel-b2.sh +351 -376
- package/skills/teamsmith/tests/panel-b3.sh +139 -43
- package/skills/teamsmith/tests/panel-cpu.sh +41 -129
- package/skills/teamsmith/tests/panel-p21.sh +96 -193
- package/skills/teamsmith/tests/perf.sh +83 -383
- package/skills/teamsmith/tests/routes.sh +115 -26
- package/skills/teamsmith/tests/seat-interrupt.sh +20 -10
- package/skills/teamsmith/tests/seat-visibility.sh +1 -1
- package/skills/teamsmith/tests/section-guard.sh +7 -101
- package/skills/teamsmith/tests/section-paths.tsv +15 -7
- package/skills/teamsmith/tests/section-select.sh +363 -18
- package/skills/teamsmith/tests/signal-gate.sh +249 -27
- package/skills/teamsmith/tests/signal-lint-legacy.txt +4 -1
- package/skills/teamsmith/tests/slash-team-e2e.sh +4 -4
- package/skills/teamsmith/tests/slice-coverage.sh +206 -0
- package/skills/teamsmith/tests/smoke.sh +856 -581
- package/skills/teamsmith/tests/task-model-routing.sh +25 -7
- package/skills/teamsmith/tests/team-bg-stop.sh +18 -10
- package/skills/teamsmith/tests/workflow-entry.sh +207 -0
- package/skills/teamsmith-init/SKILL.md +1 -1
- package/skills/teamsmith/tests/flip-glue.sh +0 -162
- package/skills/teamsmith/tests/flip-m12-26c.sh +0 -129
- package/skills/teamsmith/tests/flip-m12.sh +0 -185
- package/skills/teamsmith/tests/flip-m16.sh +0 -166
- package/skills/teamsmith/tests/flip-m17.sh +0 -204
- package/skills/teamsmith/tests/flip-m34.sh +0 -96
- package/skills/teamsmith/tests/flip-m37.sh +0 -188
- package/skills/teamsmith/tests/flip-m4.3.sh +0 -378
- package/skills/teamsmith/tests/flip-m43.sh +0 -128
- package/skills/teamsmith/tests/flip-m45.sh +0 -244
- package/skills/teamsmith/tests/flip-m46.sh +0 -238
- package/skills/teamsmith/tests/flip-m48.sh +0 -304
- package/skills/teamsmith/tests/flip-m6.2.sh +0 -205
- package/skills/teamsmith/tests/flip-m6.3.sh +0 -286
- package/skills/teamsmith/tests/flip-m6.4.sh +0 -267
- package/skills/teamsmith/tests/flip-m6.5.sh +0 -116
- package/skills/teamsmith/tests/flip-m7.1.sh +0 -135
- package/skills/teamsmith/tests/flip-m7.2.sh +0 -324
- package/skills/teamsmith/tests/flip-p144.sh +0 -112
- package/skills/teamsmith/tests/flip-p156.sh +0 -133
- package/skills/teamsmith/tests/flip-p160.sh +0 -182
- package/skills/teamsmith/tests/flip-p171.sh +0 -249
- package/skills/teamsmith/tests/flip-p18.1.sh +0 -95
- package/skills/teamsmith/tests/flip-p20.sh +0 -286
- package/skills/teamsmith/tests/flip-p201.sh +0 -249
- package/skills/teamsmith/tests/flip-p210.sh +0 -242
- package/skills/teamsmith/tests/flip-p211.sh +0 -152
- package/skills/teamsmith/tests/flip-p217.sh +0 -291
- package/skills/teamsmith/tests/flip-p22.sh +0 -123
- package/skills/teamsmith/tests/flip-p23.sh +0 -239
- package/skills/teamsmith/tests/flip-p25.sh +0 -165
- package/skills/teamsmith/tests/flip-p287-lock.sh +0 -342
- package/skills/teamsmith/tests/flip-p287-name.sh +0 -279
- package/skills/teamsmith/tests/flip-p304-read-side.sh +0 -98
- package/skills/teamsmith/tests/flip-p309-p162-deep.sh +0 -122
- package/skills/teamsmith/tests/flip-p71.sh +0 -184
- package/skills/teamsmith/tests/flip-p72.sh +0 -202
- package/skills/teamsmith/tests/load-experiment.sh +0 -290
- package/skills/teamsmith/tests/panel-cpu-premise.sh +0 -173
- package/skills/teamsmith/tests/panel-flip-m54.sh +0 -207
- package/skills/teamsmith/tests/panel-flip-p123.sh +0 -278
- package/skills/teamsmith/tests/panel-flip-p125.sh +0 -318
- package/skills/teamsmith/tests/panel-flip-p128.sh +0 -259
- package/skills/teamsmith/tests/panel-keyprobe-stub.sh +0 -41
- package/skills/teamsmith/tests/panel-keyprobe.sh +0 -82
- package/skills/teamsmith/tests/panel-knobs.sh +0 -89
- package/skills/teamsmith/tests/section-budgets.tsv +0 -164
- package/skills/teamsmith/tests/team-bg-flip.sh +0 -239
- package/skills/teamsmith/tests/team-inbox-watch-flip.sh +0 -191
package/README.md
CHANGED
|
@@ -56,14 +56,14 @@ than replaced (`--force` replaces only an entry recognised as this skill).
|
|
|
56
56
|
### As a Pi package (no global CLI)
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
pi install git:git@github.com:Track07-cda/teamsmith@v0.3.
|
|
60
|
-
pi install -l git:git@github.com:Track07-cda/teamsmith@v0.3.
|
|
59
|
+
pi install git:git@github.com:Track07-cda/teamsmith@v0.3.2 # user level: every project
|
|
60
|
+
pi install -l git:git@github.com:Track07-cda/teamsmith@v0.3.2 # project level: recorded in .pi/settings.json
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
- **Pin a released tag**: `@v<version>`, the version `team version` prints. Latest tag:
|
|
64
64
|
`git tag --sort=-v:refname | head -1`.
|
|
65
|
-
- The `git@github.com:` form (or `ssh://git@github.com/Track07-cda/teamsmith@v0.3.
|
|
66
|
-
whether or not you have a token; the shorthand `git:github.com/Track07-cda/teamsmith@v0.3.
|
|
65
|
+
- The `git@github.com:` form (or `ssh://git@github.com/Track07-cda/teamsmith@v0.3.2`) uses your SSH key and works
|
|
66
|
+
whether or not you have a token; the shorthand `git:github.com/Track07-cda/teamsmith@v0.3.2` takes the HTTPS
|
|
67
67
|
route, so it works anonymously on the public repository and asks for credentials if your access is private.
|
|
68
68
|
- The clone lands in `~/.pi/agent/git/<host>/<path>` (user level) or `.pi/git/<host>/<path>` (project level); the
|
|
69
69
|
skill directory — the `<skill>` used in every command below — is `<clone>/skills/teamsmith`.
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teamsmith",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Turn one agent session into a project owner: self-contained task briefs dispatched to worker agents in their own git worktrees, independent verification on a separate checkout, and an auditable ledger (BOARD / reviews / threads / DECISIONS). Runs on Pi today.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
7
|
-
"team": "./bin/team.mjs"
|
|
7
|
+
"team": "./bin/team.mjs",
|
|
8
|
+
"pkill": "./skills/teamsmith/scripts/shim/pkill",
|
|
9
|
+
"killall": "./skills/teamsmith/scripts/shim/killall",
|
|
10
|
+
"pgrep": "./skills/teamsmith/scripts/shim/pgrep",
|
|
11
|
+
"pidof": "./skills/teamsmith/scripts/shim/pidof"
|
|
8
12
|
},
|
|
9
13
|
"repository": {
|
|
10
14
|
"type": "git",
|
|
@@ -5,6 +5,62 @@
|
|
|
5
5
|
> `SKILL.md`/`references/**`/`templates/**`/`extension/**` 在 Pi 里输入 `/reload`(或 `/pi-team-reload`)即生效;
|
|
6
6
|
> 判断自己是不是旧的:`team mark-loaded`(开局记一次)→ `team version --check`。
|
|
7
7
|
|
|
8
|
+
## v0.3.2(2026-10-22)
|
|
9
|
+
|
|
10
|
+
**npm 安装的人必须升级(0.3.0 与 0.3.1 都受影响)。**
|
|
11
|
+
|
|
12
|
+
0.3.1 修好了「四个信号入口随包发布」这件事,但 `package.json` 的 `bin` 字段仍然只列了 `team`——
|
|
13
|
+
而 `npm install -g` 只给 `bin` 里列出的名字建链接。于是**装完之后 `pkill` / `killall` / `pgrep` / `pidof`
|
|
14
|
+
仍然解析到 `/usr/bin`,防误杀的信号闸门在 npm 路线上等于不存在**(包里的 shim 文件在,但没人指向它们)。
|
|
15
|
+
用 Git 检出安装或跑 `install.sh` 的人不受影响。
|
|
16
|
+
|
|
17
|
+
这一版把四个名字加进 `bin`(都指向包内的 shim),并在安装面夹具里补上那个缺失的证伪者:
|
|
18
|
+
`npm i -g --prefix …` 之后,`prefix/bin/{pkill,killall,pgrep,pidof}` 必须**解析到安装包内部**,
|
|
19
|
+
否则判红。这一条以前没有,所以两次独立复验都漏过去了——它们只检查了「包内文件在不在」。
|
|
20
|
+
|
|
21
|
+
除此之外与 0.3.1 完全相同。`0.3.1` 已在 npm 上标记为 deprecated。
|
|
22
|
+
|
|
23
|
+
## v0.3.1(2026-10-21)
|
|
24
|
+
|
|
25
|
+
补丁版:**没有破坏性变化、没有默认行为切换、没有新依赖**。这一版修的是 0.3.0 发出后才暴露的六件事。
|
|
26
|
+
|
|
27
|
+
### ⚠️ 用 npm 装的人必须重装
|
|
28
|
+
|
|
29
|
+
`npm i -g teamsmith` 装出来的 0.3.0 **缺少 `pkill` / `killall` / `pgrep` / `pidof` 四个命令入口** —— npm 的 tarball 不携带软链接,
|
|
30
|
+
四个名字装完全部落到 `/usr/bin` 的系统命令上,也就是说**防误杀的信号闸门在 npm 路线上等于不存在**(用 Git 检出安装的人不受影响)。
|
|
31
|
+
这一版把四个入口改成普通文件,随包一起装;装完用 `command -v pkill` 应指向 teamsmith 的 shim。
|
|
32
|
+
|
|
33
|
+
### 修好的行为
|
|
34
|
+
|
|
35
|
+
- **图片粘贴真的落盘**:新建项目没有容量历史时,容量块降级会连带丢掉临时根信息,`Ctrl-V` 插入的是空路径、文件没写。
|
|
36
|
+
- **已 squash 合并的分支不再被报「领先 N」**:那条判定把命令输出管进 `grep -q`,`pipefail` 下左端吃 SIGPIPE、整条管道判失败 ——
|
|
37
|
+
它今天只靠 8 字节余量活着(本仓 8200 字节的树列表 vs 8192 字节管道缓冲),把 `TEAM_SQUASH_LOOKBACK` 上调即必错。
|
|
38
|
+
- **长标题流时不再误判「没有接受记录」**:同一类管道判定,explore 阶段的证据检查在标题流多 1 KB 时 30/30 误判。
|
|
39
|
+
- **合法的长门禁不再让等待者超时失败**:等待上限原来看一个从没人公布的数字(恒为 0 → 固定 30 分钟),一次 80 分钟的全量门禁会让
|
|
40
|
+
所有等待者红。现在跟随持有者心跳:心跳新鲜就继续等(硬顶 4×W),停跳满一个窗口才判卡死并点名持有者;旧记录(无心跳字段)行为不变。
|
|
41
|
+
- **PM 起不来时诊断说得清**:诊断里原来会冒出 shell 自己的「文件不存在」报错和一个空数字;现在具名说明「谁还没写出什么」。
|
|
42
|
+
|
|
43
|
+
### 门禁与 CI(写给仓库使用者)
|
|
44
|
+
|
|
45
|
+
- 普通推送**不再跑整套**:`--floor` 跑产品地板,改动路径只加相关段;**未知路径仍退回全量**。
|
|
46
|
+
- 门禁的私有 tmux 锚点不再泄漏:外部 `kill -9` 之后它 2 秒内自己消失(此前会带着 `sleep 100000` 留到天荒地老);
|
|
47
|
+
socket 目录的回收形状修对(此前每轮漏一个空目录,本机曾积到 1233 个)。
|
|
48
|
+
- 两处时红时绿修根:运行登记的 EXIT trap 武装得太晚(前七百行落一个 TERM 就没人删记录,等满 300 秒再红);
|
|
49
|
+
`§34b` 里最后两处墙钟窗口换成确定性条件。
|
|
50
|
+
- 三条发布门禁自身的缺陷修掉:`--keep` 不再泄进夹具自己发起的嵌套运行(保留开关属于发起它的那一层);
|
|
51
|
+
`seat-interrupt` 的一个组自 P309 起其实从未跑过(隔离前置只认一个自有目录,而私有 socket 目录早已搬出临时根)——
|
|
52
|
+
它现在恢复执行;路由变异矩阵给最慢那条臂的预算从 900 s 提到 1 800 s(实测 844 s),撞上限时点名「哪条臂、用满多少秒」。
|
|
53
|
+
- 一条**死了两个版本**的断言被救活:`§36③` 的红标检查拿带 ANSI 的串去比对已去色的文本,永不命中;现在匹配串同样去色,
|
|
54
|
+
并配一条正向对照 —— 仪表坏了自己报红,不许绿。
|
|
55
|
+
|
|
56
|
+
### 内部卫生(不改变行为)
|
|
57
|
+
|
|
58
|
+
- 门禁瘦身一轮(−196 条断言:逐字节快照与文案定位针退场,渲染正确性与一致性不变量保留)。
|
|
59
|
+
- 测试精简三轮:`signal-gate` 223→143、`team-bg-stop` 81→76、`config-cli` 350→331、`key-replies` 212→203、`panel-b2` 13→11 场景。
|
|
60
|
+
- 死夹具清理:删掉从不被调用的夹具,其中 7 个在修复落地后结构上就跑不起来(红树取 `merge-base HEAD main`)。
|
|
61
|
+
- 两个「写好了却没人跑」的夹具接线;其中一个已经红了两个星期没人知道。
|
|
62
|
+
- `common.sh` 的吞错清理:251 处 `|| true` / `2>/dev/null` 逐条判(改 66、留 181 并说明理由)。
|
|
63
|
+
|
|
8
64
|
## v0.3.0(2026-10-18)
|
|
9
65
|
|
|
10
66
|
### ⚠️ 默认变化:临时根落到磁盘(tmp-root-on-disk)
|
|
@@ -3,7 +3,7 @@ name: teamsmith
|
|
|
3
3
|
description: teamsmith gives one agent real ownership of a project — it plans, writes self-contained task briefs, dispatches worker agents into their own tmux windows and git worktrees, verifies their work on an independent checkout, merges, and keeps an auditable ledger (BOARD/reviews/threads/DECISIONS). A pulse window (the periodic patrol) wakes the owner only when there is pending work, and the owner can deliberately stand down. Works with Pi; the launch/notify seam is an internal seam (frozen) reserved for a possible future non-Pi adapter, with no compatibility promise. Use when the user wants an agent to own a project end to end, dispatch tasks to worker agents, run agents in parallel in tmux with git worktree isolation, act as a PM/orchestrator over other agents, review an agent's work independently, run the patrol (`pulse`) as a tmux window, wake the PM only when there is pending work, or resume and coordinate a multi-agent project. To start a new project, use the teamsmith-init skill.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: "0.3.
|
|
6
|
+
version: "0.3.2"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# teamsmith · one agent that actually owns the project
|
|
@@ -67,14 +67,15 @@ everything below is the daily loop, which starts once the project is up.
|
|
|
67
67
|
| Cross-project meetings | `team meeting open/say/read/list/inbox/propose/agree/close` (PM-to-PM peer exchange: interface work, advice, problem reports; **not a command channel** — consensus needs both sides) |
|
|
68
68
|
| Updates | `team mark-loaded` (record the version at session start), `team version --check` (should I reload?), `team changelog [--since X]`, `team reload` |
|
|
69
69
|
| Diagnostics | `team paths` (resolved paths/session), `team smoke` (end-to-end self-test; `TEAM_SMOKE_FAST=1 team smoke` = **fast mode**, pure-logic sections only, ~10s, skipped process sections print `SKIP (FAST mode)`; the **full** run is for delivery/review and queues on the gate lock — `TEAM_SMOKE_LOCK` / `TEAM_SMOKE_LOCK_WAIT`, the mutex is a pair (published `<lock>` + dot-prefixed companion `<lock>.machine`, the holder recorded in `<companion>.holder`; neither file is ever unlinked, and losing the companion mid-run stops the run loudly), and `team review` takes the same pair before its timeout so the record's `queued`/`ran` are separate; the gate judges **correctness only** — its panel section keeps the time-independent knob check), `team version` |
|
|
70
|
-
| Performance | `team perf [--host \| --container]` (**separate from correctness**:
|
|
70
|
+
| Performance | `team perf [--host \| --container]` (**separate from correctness**: it only measures and prints reference readings — interactive first frame, frame assembly, steady-state pane CPU — and names the environment it measured in; the exit codes are `0` (a reading was taken) and `3` (setup failed, or the perf lock was unavailable), with no thresholds, no premise factor and no `2`/`4`; its own lock `TEAM_PERF_LOCK`, never the gate lock; default = the pinned `ci/Containerfile` image, `--host` is labelled **not the reference**) |
|
|
71
71
|
|
|
72
72
|
The two gates answer different questions and are run at different times. **Correctness, on every change:**
|
|
73
73
|
`openspec validate --all --strict && bash skills/teamsmith/tests/smoke.sh </dev/null` (the pair `team review` runs;
|
|
74
74
|
`team smoke` is the suite's front door). **Performance, separately and before a release:**
|
|
75
75
|
`bash skills/teamsmith/tests/perf.sh` (front door `team perf`; the reference environment is the pinned
|
|
76
|
-
`ci/Containerfile` image, `team perf --host` is explicitly *not* the reference).
|
|
77
|
-
|
|
76
|
+
`ci/Containerfile` image, `team perf --host` is explicitly *not* the reference). Its numbers are reference-only
|
|
77
|
+
and it has no verdict to give (exit `0` = a reading was taken, `3` = it could not measure), so a performance run
|
|
78
|
+
never changes a review verdict and never blocks a merge.
|
|
78
79
|
|
|
79
80
|
## Read the creed first, then the process
|
|
80
81
|
The PM's judgement standard lives in [references/philosophy.md](references/philosophy.md) (8 principles, each with
|
|
@@ -301,7 +302,7 @@ about them). They stay writable so the seam can be maintained and diagnosed; to
|
|
|
301
302
|
| `references/troubleshooting.md` | Notifications not arriving, lost sessions, worktree conflicts, forge 403, dishonest reports |
|
|
302
303
|
| `templates/` | Copy when you need to hand-write a brief/report/board |
|
|
303
304
|
| `scripts/team`, `scripts/lib/*.sh` | When changing behaviour (use `team <cmd> --print` to see what it generates) |
|
|
304
|
-
| `tests/smoke.sh`, `tests/perf.sh`, `tests/skill-load.mjs` | To confirm the tooling works here: `team smoke` (end-to-end in a temp repo, never touches this project). **Fast mode**: `TEAM_SMOKE_FAST=1 team smoke` runs only sections that need no real tmux stage or agent process — good for day-to-day gates before dispatch/verification; it **does not cover** dispatch actually launching an agent, the non-Pi agent end-to-end segment, window/close behaviour, the pulse waking the PM, standby/monitor, real agent resume, cross-session guards, offline `say` delivery, or knock probing (those print `SKIP (FAST mode)`); run the full suite before changing those paths or cutting a release. The full run is the machine's **one** shared gate resource: it queues on `TEAM_SMOKE_LOCK` up to `TEAM_SMOKE_LOCK_WAIT`, and `team review` takes the same lock *before* its hard timeout (so the record's `queued`/`ran` are separate and a long queue is a loud `FAIL`, never a `TIMEOUT`). The **performance**
|
|
305
|
+
| `tests/smoke.sh`, `tests/perf.sh`, `tests/skill-load.mjs` | To confirm the tooling works here: `team smoke` (end-to-end in a temp repo, never touches this project). **Fast mode**: `TEAM_SMOKE_FAST=1 team smoke` runs only sections that need no real tmux stage or agent process — good for day-to-day gates before dispatch/verification; it **does not cover** dispatch actually launching an agent, the non-Pi agent end-to-end segment, window/close behaviour, the pulse waking the PM, standby/monitor, real agent resume, cross-session guards, offline `say` delivery, or knock probing (those print `SKIP (FAST mode)`); run the full suite before changing those paths or cutting a release. The full run is the machine's **one** shared gate resource: it queues on `TEAM_SMOKE_LOCK` up to `TEAM_SMOKE_LOCK_WAIT`, and `team review` takes the same lock *before* its hard timeout (so the record's `queued`/`ran` are separate and a long queue is a loud `FAIL`, never a `TIMEOUT`). The **performance** readings live in `tests/perf.sh` (`team perf`), not in the correctness gate (there are no performance red lines left to run there — the suite prints reference readings, names the environment it measured in, and cannot fail a run): correctness on every change, one performance reading before a release |
|
|
305
306
|
|
|
306
307
|
## Requirements
|
|
307
308
|
|
|
@@ -326,5 +327,4 @@ about them). They stay writable so the seam can be maintained and diagnosed; to
|
|
|
326
327
|
- Optional helpers: `timeout` (hard timeout for gates; degrades with a warning), `lsof` (needed only where
|
|
327
328
|
`/proc` is unavailable), `/usr/bin/time` (GNU time, not bash's `time` keyword: `tests/panel-cpu.sh` wraps the
|
|
328
329
|
console with it to read the tree CPU figure — the gate image pins it, and where it is missing that fixture
|
|
329
|
-
prints
|
|
330
|
-
segment that drives it).
|
|
330
|
+
prints that the reading was not taken (exit `0`) instead of judging).
|
|
@@ -449,8 +449,9 @@ function forcedWatchErrno(): string {
|
|
|
449
449
|
function writeDegradedRecord(root: string, target: string, info: {
|
|
450
450
|
errno: string; watches: string; pollMs: number; forced: boolean
|
|
451
451
|
}): void {
|
|
452
|
-
// 变量名故意不叫 dir:flip-m46
|
|
453
|
-
//
|
|
452
|
+
// 变量名故意不叫 dir:P354 之前 flip-m46 的翻转包用 `}): void {\n const dir = watchDir(root)` 当
|
|
453
|
+
// writeSkipRecord 的注射锚点,重名会让那个锚点变成 2 处(那个包会 exit 2)。那个包已在 P354 退役、
|
|
454
|
+
// 今天没有执行者;它守的 M46 行为由 §12b-pi 的 M46-S14…S17 活着守着。
|
|
454
455
|
const wdir = watchDir(root)
|
|
455
456
|
const key = targetKey(target)
|
|
456
457
|
try { mkdirSync(wdir, { recursive: true }) } catch { return }
|
|
@@ -596,7 +597,8 @@ function readNewLines(file: string, offset: number): ReadResult {
|
|
|
596
597
|
// 行中起步 = 碎片(被 clamp 截住的旧行的尾巴):跳到它自己的换行为止,绝不投递(B1.2)
|
|
597
598
|
const start = midLine ? win.indexOf(0x0a) + 1 : 0
|
|
598
599
|
const resync = start
|
|
599
|
-
const advance = end + 1 // P28/B1
|
|
600
|
+
const advance = end + 1 // P28/B1:字节真值(曾由 flip-p25.sh 的 mutant A/B 把这一行换成解码→再编码的长度来
|
|
601
|
+
// 翻转,该夹具 P354 已退役;这条不变量今天由 §12b-pi S18–S21 守)
|
|
600
602
|
const lines: string[] = []
|
|
601
603
|
let from = start
|
|
602
604
|
for (let i = start; i <= end; i++) {
|
|
@@ -654,12 +654,13 @@ carries an illegal token, so the read side and the write side can never disagree
|
|
|
654
654
|
- Acceptance commands in a brief should carry their own timeout as well; destructive experiment scripts must restore
|
|
655
655
|
the scene with `trap 'git checkout -- …' EXIT`.
|
|
656
656
|
|
|
657
|
-
### 9b-2. The gate is the machine's one shared resource (queue
|
|
657
|
+
### 9b-2. The gate is the machine's one shared resource (queue)
|
|
658
658
|
|
|
659
659
|
The full gate — `openspec validate … && bash skills/teamsmith/tests/smoke.sh` — spends the machine's tmux servers,
|
|
660
660
|
node/bun processes and login shells, so it is serialised on **one gate lock**
|
|
661
661
|
(`${TEAM_SMOKE_LOCK:-${TMPDIR:-/tmp}/teamsmith-smoke.lock}`, wait capped by `TEAM_SMOKE_LOCK_WAIT`, default
|
|
662
|
-
1800 s
|
|
662
|
+
1800 s — extended to `4 ×` that while the run it waits for keeps publishing heartbeats, see below). Use
|
|
663
|
+
`TEAM_SMOKE_FAST=1` for in-batch self-tests (pure-logic sections only; measured in the low minutes
|
|
663
664
|
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
|
|
|
665
666
|
**The gate lock is a pair: a published path (compatibility) and a companion (the mutex).** The published path is
|
|
@@ -706,8 +707,10 @@ the run was handed — or by a live record naming it: environment variables alon
|
|
|
706
707
|
also be a **strict** ancestor of the claiming suite (a section-selected run adds one more process layer, so the
|
|
707
708
|
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
709
|
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,
|
|
710
|
-
|
|
710
|
+
a tmux window name; unresolvable fields are written `?`, not guessed), its start time, and the `expected` /
|
|
711
|
+
`bound` pair (the section table's Σband / Σbudget over the sections that run will execute — since P316 retired
|
|
712
|
+
that table the pair is a **diagnostic** field: it is still written and still printed, and it decides nothing),
|
|
713
|
+
and the waiter prints
|
|
711
714
|
that record when it starts queueing and again when it hits its cap. Only the process that really holds the lock
|
|
712
715
|
writes and removes the holder record — and it writes only when that record is absent, stale (its process is gone)
|
|
713
716
|
or already names that same pid: the inherited `SMOKE_LOCK_MARKER` file is a hint, not a proof, so a descendant
|
|
@@ -734,11 +737,20 @@ blocked on is unlinked and rebuilt while it waits, it prints one line with both
|
|
|
734
737
|
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
738
|
waiter ends up "holding" a lock nobody else can see.
|
|
736
739
|
|
|
737
|
-
**The queue cap follows the holder's published expected
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
`
|
|
740
|
+
**The queue cap follows the holder's heartbeat; the published `expected` no longer decides it.** Every round of
|
|
741
|
+
the poll re-reads the lock's **live** records — `<companion>.holder` *and* `<companion>.runs/<pid>.run` — and
|
|
742
|
+
takes the newest published heartbeat file that is still there. The holder record alone is not enough: a
|
|
743
|
+
top-level suite's holder record names the locking wrapper's heartbeat path, which nobody writes, and a
|
|
744
|
+
review's holder record carries `heartbeat=-` while the suite that review spawned registers a heartbeat that
|
|
745
|
+
does move. While the newest heartbeat's last movement is less than `TEAM_SMOKE_LOCK_WAIT` ago the waiter keeps
|
|
746
|
+
waiting, with the cap at `4 × TEAM_SMOKE_LOCK_WAIT`; when no usable heartbeat exists — an older writer, a
|
|
747
|
+
record whose `heartbeat=` is `-`, a published path whose file is gone, or a silence of `TEAM_SMOKE_LOCK_WAIT`
|
|
748
|
+
or more — the cap stays `TEAM_SMOKE_LOCK_WAIT` exactly as before, so a stalled holder is waited out for at most
|
|
749
|
+
`TEAM_SMOKE_LOCK_WAIT`. The queue line prints both bounds together with the heartbeat's state, and the failure
|
|
750
|
+
line says whether the heartbeat had been silent or had never been published. The read is not authenticated
|
|
751
|
+
against the current holder's ancestry: a leftover registration that is still alive can hold the cap at `4 ×`
|
|
752
|
+
while the real holder is stuck — accepted on purpose, and bounded at two hours by default. The verdict token
|
|
753
|
+
set (`PASS|FAIL|TIMEOUT|SKIPPED|UNKNOWN`), the
|
|
742
754
|
`queued Ns / ran Ns / limit Ns` accounting and the rule that a queue overrun is `FAIL` (never `TIMEOUT`) with
|
|
743
755
|
the holder named are all unchanged. `team review` takes the same pair, in the same order, in its own process,
|
|
744
756
|
and runs the project's gate with the lock descriptors closed: its gate record still separates `queued` from
|
|
@@ -782,19 +794,21 @@ The gate judges **correctness only**: it contains no wall-clock or CPU-share red
|
|
|
782
794
|
gate's own sources (`tests/gate-guard.sh`) fails when a frame-budget/CPU-share marker reappears in it or when the
|
|
783
795
|
performance suite loses its markers. The three panel numbers — the interactive first frame, the uncached frame
|
|
784
796
|
assembly and the steady-state pane CPU — belong to the **performance suite**
|
|
785
|
-
(`bash skills/teamsmith/tests/perf.sh`, front door `team perf`)
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
sample is printed, and above the premise the judgement **skips visibly** (exit `4` for a skip, `2` for a red, `0`
|
|
789
|
-
only when every judgement ran green) rather than reporting a red the machine owes. The suite takes its **own** lock
|
|
797
|
+
(`bash skills/teamsmith/tests/perf.sh`, front door `team perf`) and are **readings**: every sample is printed
|
|
798
|
+
together with the environment it was taken in, there is no threshold and no premise factor, and no number it prints
|
|
799
|
+
can fail a run. The suite takes its **own** lock
|
|
790
800
|
(`TEAM_PERF_LOCK`, `TEAM_PERF_LOCK_WAIT`, holder in `<companion>.holder`, where `<companion>` is
|
|
791
801
|
`<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
|
|
792
802
|
one read-only non-blocking probe of the gate lock and prints the holder when the correctness gate is running, but
|
|
793
|
-
it never queues behind it.
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
803
|
+
it never queues behind it. Its exit codes are `0` (a reading was taken) and `3` (setup failed, or the perf lock
|
|
804
|
+
was unavailable): there is no judgement, so there is no `2`/`4`. The gate's lock accounting (`limit=Ns queued=Ns
|
|
805
|
+
ran=Ns`), the fixture-knob rule (those `TEAM_*` knobs only work under `TEAM_SMOKE_FIXTURE=1`, and in the real path
|
|
806
|
+
they are ignored and printed) and the gate's time-independent half of that check (`tests/panel-knobs.sh`) are
|
|
807
|
+
unchanged; a performance run changes no review verdict. Its readings are taken once before a release, in the
|
|
808
|
+
pinned image, and pasted into that release's record (`docs/team/reviews/release-<version>.md`); the release
|
|
809
|
+
checklist names the command. The contracts live in the specs
|
|
810
|
+
(`verification#The correctness gate judges correctness only, and a duration is a reading`,
|
|
811
|
+
`verification#The performance suite is separate, self-describing, and its numbers are reference-only`,
|
|
798
812
|
`verification#The hard timeout covers the gate run, not the queue`,
|
|
799
813
|
`panel#Frame assembly is asynchronous, cached and never blocks input`); this section is the operational rule.
|
|
800
814
|
|
|
@@ -1120,9 +1120,12 @@ second time).
|
|
|
1120
1120
|
pass `--allow-dup` for new rows; remember that `reviews/<ID>.md` and the pending-report heuristic are keyed by
|
|
1121
1121
|
the id too, so both rows share one review namespace, and the detail view opens the same document for both.
|
|
1122
1122
|
|
|
1123
|
-
The
|
|
1124
|
-
|
|
1125
|
-
|
|
1123
|
+
The gate pins this in `tests/smoke.sh` §4c (`bash skills/teamsmith/tests/smoke.sh --select 4c`):
|
|
1124
|
+
`M48:重复 ID 被拒(非 0)`, `M48:被拒时 BOARD 逐字节未变`, `M48:--allow-dup 显式允许写入`,
|
|
1125
|
+
`M48:assign 后行数不变(不是又加一行)`, `M48:assign 后 T1.1 仍是两行(没有顺手改历史数据)`, and the three visible
|
|
1126
|
+
reports (`board ls`, `team digest`, `team doctor`); each goes red when the row identity or the check is
|
|
1127
|
+
removed. The console half — two rows with one id sharing one cursor, both reachable, both walks — is pinned
|
|
1128
|
+
only by `tests/panel-b3.sh board`, which the gate does not run: no gate section carries it.
|
|
1126
1129
|
|
|
1127
1130
|
## 24. The performance suite refuses to call itself the "reference environment" — the trust boundary (M66 → M69 → M73)
|
|
1128
1131
|
|
|
@@ -1034,6 +1034,7 @@ $(printf '%s\n' "$ignored_list" | head -5)
|
|
|
1034
1034
|
# G1(P26):门禁锁的排队阶段与记账。queue_state: none(门禁没跑)/ held(祖先持有)/ queued(本
|
|
1035
1035
|
# 次自己排队)/ noqueue(没有 flock,降级)/ cap(排队超上限,门禁没跑)。
|
|
1036
1036
|
local queue_state="none" queue_marker="" queued_elapsed="" queue_holder="" used_lock="" lock_cap=""
|
|
1037
|
+
local lock_note=""
|
|
1037
1038
|
if [ "$no_gates" = "1" ]; then
|
|
1038
1039
|
verdict="SKIPPED"; gates_marker="none"
|
|
1039
1040
|
gates_out="(--no-gates:PM 选择人工看 diff;**没有跑过任何门禁**,本记录不是 PASS 证据)"
|
|
@@ -1092,10 +1093,12 @@ $(printf '%s\n' "$ignored_list" | head -5)
|
|
|
1092
1093
|
local lock_comp; lock_comp="$(gate_lock_companion_path "$lock")"
|
|
1093
1094
|
local lock_dev_ino="" lock_cap_hit=0 lock_broken="" gate_rc=0
|
|
1094
1095
|
local queue_started gate_end marker_epoch
|
|
1095
|
-
# P281:排队上限不再是「一律 W
|
|
1096
|
-
#
|
|
1097
|
-
#
|
|
1098
|
-
|
|
1096
|
+
# P281:排队上限不再是「一律 W」——它跟着**持有者的心跳**(change: gate-waiter-patience · P338):
|
|
1097
|
+
# 心跳还在动(任一活登记公布的心跳文件 < W 秒前更新)→ 4×W(硬顶);
|
|
1098
|
+
# 心跳停了 / 没有可用心跳(旧记录、`heartbeat=-`、文件不在)→ W(与今天一字不改)。
|
|
1099
|
+
# 每轮**现算**(不缓存排队时的读数):心跳停了,上限当轮就落回 W。
|
|
1100
|
+
# `expected`/`bound` 仍写在记录里、仍被点名,但**不再决定耐心**(P316 之后没有生产者)。
|
|
1101
|
+
local lock_wait lock_pat lock_silent
|
|
1099
1102
|
lock_cap="${TEAM_SMOKE_LOCK_WAIT:-1800}"
|
|
1100
1103
|
case "$lock_cap" in ''|*[!0-9]*) lock_cap=1800 ;; esac
|
|
1101
1104
|
lock_wait="$lock_cap"
|
|
@@ -1139,15 +1142,17 @@ $(printf '%s\n' "$ignored_list" | head -5)
|
|
|
1139
1142
|
fi
|
|
1140
1143
|
lock_waited_id="$lock_probe_id"
|
|
1141
1144
|
fi
|
|
1142
|
-
#
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
+
# 耐心跟着持有者的心跳(change: gate-waiter-patience · P338):心跳还在动 → 4W,停了 / 没有
|
|
1146
|
+
# 可用心跳(旧记录、`heartbeat=-`、文件不在)→ W(与今天一字不改)。**每轮现算**,不缓存。
|
|
1147
|
+
IFS=$'\t' read -r lock_cap lock_pat lock_silent _ \
|
|
1148
|
+
< <(gate_lock_patience_pair "$lock" "$lock_wait")
|
|
1145
1149
|
case "$lock_cap" in ''|*[!0-9]*) lock_cap="$lock_wait" ;; esac
|
|
1150
|
+
lock_note="$(gate_lock_patience_note "$lock_pat" "$lock_silent")"
|
|
1146
1151
|
if [ "$lock_reported" = "0" ]; then
|
|
1147
1152
|
lock_reported=1
|
|
1148
1153
|
lock_role="$([ "$lock_probe" = "1" ] && printf '发布路径(兼容声明)' || printf '伴生锁(运行互斥)')"
|
|
1149
1154
|
queue_holder="$(gate_lock_describe_pair "$lock")"
|
|
1150
|
-
team_info "门禁锁正被持有(${queue_holder});排队,最多等 ${lock_cap}s
|
|
1155
|
+
team_info "门禁锁正被持有(${queue_holder});排队,最多等 ${lock_cap}s(${lock_note};下限 TEAM_SMOKE_LOCK_WAIT=${lock_wait}s,上限 4×=$(( lock_wait * 4 ))s;TEAM_SMOKE_LOCK_WAIT 可调)"
|
|
1151
1156
|
fi
|
|
1152
1157
|
if [ "$lock_probe" = "1" ]; then lock_waited_path="$lock"; else lock_waited_path="$lock_comp"; fi
|
|
1153
1158
|
[ -n "$lock_waited_id" ] || lock_waited_id="$(gate_lock_path_identity "$lock_waited_path" 2>/dev/null || true)"
|
|
@@ -1252,11 +1257,11 @@ $(printf '%s\n' "$ignored_list" | head -5)
|
|
|
1252
1257
|
queued_elapsed=$(( gate_end - queue_started ))
|
|
1253
1258
|
[ "$queued_elapsed" -lt 0 ] && queued_elapsed=0
|
|
1254
1259
|
queue_holder="$(gate_lock_describe_pair "$lock")" # 撞上限时**重读**:等的这段时间持有者可能换了
|
|
1255
|
-
gates_out="(门禁锁排队超过上限 ${lock_cap}s:**门禁没有运行**。持锁者:${queue_holder}
|
|
1260
|
+
gates_out="(门禁锁排队超过上限 ${lock_cap}s:**门禁没有运行**。持锁者:${queue_holder}。${lock_note}这不是对代码的判定 —— 等持锁者结束,或抬 TEAM_SMOKE_LOCK_WAIT 后重跑。)"
|
|
1256
1261
|
gate_elapsed=""
|
|
1257
1262
|
used_timeout=0
|
|
1258
1263
|
used_lock="$lock"
|
|
1259
|
-
team_err "门禁锁排队超过上限 ${lock_cap}s → 门禁没有运行(持锁者:${queue_holder})"
|
|
1264
|
+
team_err "门禁锁排队超过上限 ${lock_cap}s → 门禁没有运行(持锁者:${queue_holder};${lock_note})"
|
|
1260
1265
|
fi
|
|
1261
1266
|
grace="${TEAM_REVIEW_TIMEOUT_GRACE:-2}"
|
|
1262
1267
|
case "$grace" in ''|*[!0-9]*) grace=2 ;; esac
|
|
@@ -144,18 +144,22 @@ team_report_seat_live() { # <id> <报告路径> → 0 = 归属席位在跑(in-
|
|
|
144
144
|
# (squash 合并且没有别的改动时正是这个形状:内容相同、却没有共同提交)。
|
|
145
145
|
# 窗口外/部分 squash 会落回诚实的「领先 N」;文档里写明这是启发式(references/workflows.md)。
|
|
146
146
|
team_branch_squash_merged() { # <worktree> → 0=内容已在保护分支里
|
|
147
|
-
local wt="${1:-}" tree lookback="${TEAM_SQUASH_LOOKBACK:-200}"
|
|
147
|
+
local wt="${1:-}" tree lookback="${TEAM_SQUASH_LOOKBACK:-200}" trees=""
|
|
148
148
|
[ -d "$wt" ] || return 1
|
|
149
149
|
case "$lookback" in ''|*[!0-9]*) lookback=200 ;; esac
|
|
150
150
|
tree="$(git -C "$wt" rev-parse 'HEAD^{tree}' 2>/dev/null || true)"
|
|
151
151
|
[ -n "$tree" ] || return 1
|
|
152
152
|
# M50:保护分支的 tree 清单一个纪元读一次(原来每个工作树一次 git log)
|
|
153
|
+
# P350:两条腿都**先落变量再匹配**。`printf … | grep -qx` / `git log … | grep -qx` 的右端一命中就
|
|
154
|
+
# 退出,左端还在写的那段拿到 SIGPIPE(141),CLI 顶层的 `set -o pipefail` 于是把「已在清单里」判成
|
|
155
|
+
# 「不在」——已 squash 合并的分支被报成「领先 N」。判据仍是同一行精确匹配,只是不再经过管道。
|
|
153
156
|
if team_scan_cache_on; then
|
|
154
157
|
_team_prot_trees_load
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
trees="$_TEAM_PROT_TREES"
|
|
159
|
+
else
|
|
160
|
+
trees="$(git -C "$wt" log --format=%T --max-count="$lookback" "$TEAM_PROTECTED_BRANCH" 2>/dev/null || true)" # 留:查不到=空答案(不是故障)
|
|
157
161
|
fi
|
|
158
|
-
|
|
162
|
+
grep -qx "$tree" <<< "$trees"
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
# 这个 worktree 是不是「已 squash 合并、且没有别的未收尾信号」:脏工作区/真的未 push 优先说了算。
|