teamsmith 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/README.md +4 -4
  2. package/package.json +1 -1
  3. package/skills/teamsmith/CHANGELOG.md +69 -0
  4. package/skills/teamsmith/SKILL.md +20 -13
  5. package/skills/teamsmith/extension/team-inbox-watch.ts +5 -3
  6. package/skills/teamsmith/extension/team-notify.ts +37 -6
  7. package/skills/teamsmith/extension/team.ts +438 -0
  8. package/skills/teamsmith/references/config.md +39 -6
  9. package/skills/teamsmith/references/migration.md +197 -47
  10. package/skills/teamsmith/references/protocol.md +201 -30
  11. package/skills/teamsmith/references/troubleshooting.md +130 -10
  12. package/skills/teamsmith/references/workflows.md +36 -2
  13. package/skills/teamsmith/scripts/lib/cmd-agents.sh +318 -23
  14. package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +2 -2
  15. package/skills/teamsmith/scripts/lib/cmd-config.sh +349 -67
  16. package/skills/teamsmith/scripts/lib/cmd-draft.sh +4 -4
  17. package/skills/teamsmith/scripts/lib/cmd-help.sh +677 -0
  18. package/skills/teamsmith/scripts/lib/cmd-init.sh +157 -5
  19. package/skills/teamsmith/scripts/lib/cmd-interrupt.sh +461 -0
  20. package/skills/teamsmith/scripts/lib/cmd-meeting.sh +2 -25
  21. package/skills/teamsmith/scripts/lib/cmd-project.sh +30 -103
  22. package/skills/teamsmith/scripts/lib/cmd-reap.sh +277 -0
  23. package/skills/teamsmith/scripts/lib/cmd-reply.sh +3 -3
  24. package/skills/teamsmith/scripts/lib/cmd-review.sh +182 -32
  25. package/skills/teamsmith/scripts/lib/cmd-status.sh +234 -21
  26. package/skills/teamsmith/scripts/lib/cmd-update.sh +36 -7
  27. package/skills/teamsmith/scripts/lib/cmd-watch.sh +564 -46
  28. package/skills/teamsmith/scripts/lib/common.sh +1004 -245
  29. package/skills/teamsmith/scripts/lib/gate-lock.sh +582 -0
  30. package/skills/teamsmith/scripts/panel/draft-send.sh +11 -1
  31. package/skills/teamsmith/scripts/panel/panel.js +211 -211
  32. package/skills/teamsmith/scripts/panel/src/App.tsx +58 -21
  33. package/skills/teamsmith/scripts/panel/src/clipboard.ts +12 -5
  34. package/skills/teamsmith/scripts/panel/src/compose.ts +6 -3
  35. package/skills/teamsmith/scripts/panel/src/data.ts +51 -5
  36. package/skills/teamsmith/scripts/panel/src/layout.ts +209 -69
  37. package/skills/teamsmith/scripts/panel/src/main.tsx +37 -8
  38. package/skills/teamsmith/scripts/panel/src/strings/en.ts +39 -29
  39. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +41 -31
  40. package/skills/teamsmith/scripts/panel/src/types.ts +28 -3
  41. package/skills/teamsmith/scripts/replies.mjs +4 -1
  42. package/skills/teamsmith/scripts/shim/killall +10 -0
  43. package/skills/teamsmith/scripts/shim/pgrep +10 -0
  44. package/skills/teamsmith/scripts/shim/pidof +10 -0
  45. package/skills/teamsmith/scripts/shim/pkill +10 -0
  46. package/skills/teamsmith/scripts/shim/signal-gate +108 -31
  47. package/skills/teamsmith/scripts/shim/tmux +18 -0
  48. package/skills/teamsmith/scripts/strings/commands.tsv +86 -0
  49. package/skills/teamsmith/scripts/strings/help.en.tsv +503 -0
  50. package/skills/teamsmith/scripts/strings/help.zh.tsv +489 -0
  51. package/skills/teamsmith/scripts/team +19 -6
  52. package/skills/teamsmith/templates/AGENTS.section.md.tmpl +8 -1
  53. package/skills/teamsmith/templates/config.sh.tmpl +20 -1
  54. package/skills/teamsmith/templates/pm-prompt.md.tmpl +21 -0
  55. package/skills/teamsmith/tests/README.md +31 -0
  56. package/skills/teamsmith/tests/bg-ledger-harness.mjs +464 -40
  57. package/skills/teamsmith/tests/bg-ledger.sh +168 -10
  58. package/skills/teamsmith/tests/checkout-shape-probe.sh +83 -54
  59. package/skills/teamsmith/tests/config-cli.sh +184 -32
  60. package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +7 -1
  61. package/skills/teamsmith/tests/fixtures/p287/lint-good.sh.in +3 -0
  62. package/skills/teamsmith/tests/fixtures/p287/lint-hardcoded.sh.in +3 -0
  63. package/skills/teamsmith/tests/fixtures/p287/lint-no-ns.sh.in +3 -0
  64. package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +18 -6
  65. package/skills/teamsmith/tests/flip-m33.sh +5 -3
  66. package/skills/teamsmith/tests/flip-p158.sh +2 -1
  67. package/skills/teamsmith/tests/flip-p308-skip-not-pass.sh +151 -0
  68. package/skills/teamsmith/tests/flip-p310-lock.sh +210 -0
  69. package/skills/teamsmith/tests/flip-p310-socket.sh +125 -0
  70. package/skills/teamsmith/tests/gate-guard.sh +52 -79
  71. package/skills/teamsmith/tests/help-surface.sh +1664 -0
  72. package/skills/teamsmith/tests/install-shape.sh +359 -22
  73. package/skills/teamsmith/tests/key-replies-pty.sh +9 -10
  74. package/skills/teamsmith/tests/key-replies-ui.sh +2 -8
  75. package/skills/teamsmith/tests/key-replies.sh +281 -28
  76. package/skills/teamsmith/tests/ledger-ban.sh +5 -4
  77. package/skills/teamsmith/tests/ledger-claim.sh +2 -1
  78. package/skills/teamsmith/tests/lib/bounded-spin.sh +90 -0
  79. package/skills/teamsmith/tests/lib/model-policy.sh +4 -0
  80. package/skills/teamsmith/tests/lib/model-routing-flips.py +51 -0
  81. package/skills/teamsmith/tests/lib/pty-wait.sh +21 -111
  82. package/skills/teamsmith/tests/lib/reply-fixture.sh +4 -9
  83. package/skills/teamsmith/tests/lib/section-guard.sh +316 -164
  84. package/skills/teamsmith/tests/lib/tmp-root.sh +139 -27
  85. package/skills/teamsmith/tests/lib/tmux-cap.sh +10 -1
  86. package/skills/teamsmith/tests/lib/tmux-iso.sh +31 -13
  87. package/skills/teamsmith/tests/loop-inventory.tsv +83 -77
  88. package/skills/teamsmith/tests/panel-b2.sh +430 -352
  89. package/skills/teamsmith/tests/panel-b3-stub.sh +112 -4
  90. package/skills/teamsmith/tests/panel-b3.sh +314 -62
  91. package/skills/teamsmith/tests/panel-choices.sh +11 -6
  92. package/skills/teamsmith/tests/panel-cpu.sh +43 -130
  93. package/skills/teamsmith/tests/panel-p21.sh +251 -265
  94. package/skills/teamsmith/tests/panel-snapshots.sh +41 -225
  95. package/skills/teamsmith/tests/panel-strings.mjs +33 -18
  96. package/skills/teamsmith/tests/perf.sh +187 -396
  97. package/skills/teamsmith/tests/routes.sh +440 -117
  98. package/skills/teamsmith/tests/seat-interrupt.sh +1012 -0
  99. package/skills/teamsmith/tests/seat-visibility.sh +675 -0
  100. package/skills/teamsmith/tests/section-guard.sh +13 -102
  101. package/skills/teamsmith/tests/section-needs-audit.sh +24 -7
  102. package/skills/teamsmith/tests/section-paths.tsv +32 -18
  103. package/skills/teamsmith/tests/section-select.sh +371 -19
  104. package/skills/teamsmith/tests/signal-gate.sh +249 -27
  105. package/skills/teamsmith/tests/signal-lint-legacy.txt +4 -1
  106. package/skills/teamsmith/tests/slash-team-e2e.sh +323 -0
  107. package/skills/teamsmith/tests/slash-team.sh +617 -0
  108. package/skills/teamsmith/tests/slice-coverage.sh +206 -0
  109. package/skills/teamsmith/tests/smoke.sh +3595 -788
  110. package/skills/teamsmith/tests/task-model-routing.sh +530 -15
  111. package/skills/teamsmith/tests/team-bg-stop.sh +18 -10
  112. package/skills/teamsmith/tests/tmp-hygiene.sh +782 -45
  113. package/skills/teamsmith/tests/tmux-identity-leak.sh +773 -0
  114. package/skills/teamsmith/tests/tmux-lint-legacy.txt +12 -18
  115. package/skills/teamsmith/tests/upgrade-recipe.sh +537 -0
  116. package/skills/teamsmith/tests/workflow-entry.sh +207 -0
  117. package/skills/teamsmith-init/SKILL.md +12 -12
  118. package/skills/teamsmith-init/references/bootstrap.md +3 -3
  119. package/skills/teamsmith/tests/flip-glue.sh +0 -162
  120. package/skills/teamsmith/tests/flip-m12-26c.sh +0 -129
  121. package/skills/teamsmith/tests/flip-m12.sh +0 -185
  122. package/skills/teamsmith/tests/flip-m16.sh +0 -166
  123. package/skills/teamsmith/tests/flip-m17.sh +0 -204
  124. package/skills/teamsmith/tests/flip-m34.sh +0 -96
  125. package/skills/teamsmith/tests/flip-m37.sh +0 -185
  126. package/skills/teamsmith/tests/flip-m4.3.sh +0 -375
  127. package/skills/teamsmith/tests/flip-m43.sh +0 -128
  128. package/skills/teamsmith/tests/flip-m45.sh +0 -244
  129. package/skills/teamsmith/tests/flip-m46.sh +0 -238
  130. package/skills/teamsmith/tests/flip-m48.sh +0 -304
  131. package/skills/teamsmith/tests/flip-m6.2.sh +0 -205
  132. package/skills/teamsmith/tests/flip-m6.3.sh +0 -283
  133. package/skills/teamsmith/tests/flip-m6.4.sh +0 -267
  134. package/skills/teamsmith/tests/flip-m6.5.sh +0 -113
  135. package/skills/teamsmith/tests/flip-m7.1.sh +0 -135
  136. package/skills/teamsmith/tests/flip-m7.2.sh +0 -321
  137. package/skills/teamsmith/tests/flip-p144.sh +0 -112
  138. package/skills/teamsmith/tests/flip-p156.sh +0 -133
  139. package/skills/teamsmith/tests/flip-p160.sh +0 -182
  140. package/skills/teamsmith/tests/flip-p171.sh +0 -249
  141. package/skills/teamsmith/tests/flip-p18.1.sh +0 -95
  142. package/skills/teamsmith/tests/flip-p20.sh +0 -286
  143. package/skills/teamsmith/tests/flip-p201.sh +0 -249
  144. package/skills/teamsmith/tests/flip-p210.sh +0 -239
  145. package/skills/teamsmith/tests/flip-p211.sh +0 -152
  146. package/skills/teamsmith/tests/flip-p217.sh +0 -288
  147. package/skills/teamsmith/tests/flip-p22.sh +0 -123
  148. package/skills/teamsmith/tests/flip-p23.sh +0 -239
  149. package/skills/teamsmith/tests/flip-p25.sh +0 -165
  150. package/skills/teamsmith/tests/flip-p71.sh +0 -184
  151. package/skills/teamsmith/tests/flip-p72.sh +0 -202
  152. package/skills/teamsmith/tests/load-experiment.sh +0 -290
  153. package/skills/teamsmith/tests/panel-cpu-premise.sh +0 -173
  154. package/skills/teamsmith/tests/panel-flip-m54.sh +0 -207
  155. package/skills/teamsmith/tests/panel-flip-p123.sh +0 -278
  156. package/skills/teamsmith/tests/panel-flip-p125.sh +0 -318
  157. package/skills/teamsmith/tests/panel-flip-p128.sh +0 -259
  158. package/skills/teamsmith/tests/panel-keyprobe-stub.sh +0 -41
  159. package/skills/teamsmith/tests/panel-keyprobe.sh +0 -82
  160. package/skills/teamsmith/tests/panel-knobs.sh +0 -83
  161. package/skills/teamsmith/tests/section-budgets.tsv +0 -154
  162. package/skills/teamsmith/tests/team-bg-flip.sh +0 -239
  163. package/skills/teamsmith/tests/team-inbox-watch-flip.sh +0 -191
@@ -11,23 +11,10 @@
11
11
  # Every scenario runs in a private tmux server and a fresh git project initialised with the real
12
12
  # `team init`; the panel runs the **real** CLI through a logging wrapper (`argv.log`), so "the
13
13
  # console writes only through the owning command" is checked against real argv, not a stub.
14
- # Exit: 0 every selected scenario green, 1 at least one assertion failed, 3 setup failure,
15
- # 4 a scenario was visibly SKIPPED (see the premise below): no failure, no conclusion.
14
+ # Exit: 0 every selected scenario green, 1 at least one assertion failed, 3 setup failure.
16
15
  #
17
- # P48 / D33 — `panel#The project-settings pty fixture judges under a machine premise` (the gate
18
- # rule is `verification#The correctness gate judges correctness only`): the wait horizons stay
19
- # failure detectors, never judgments. Every scenario prints a **premise line** before its first
20
- # assertion (real `loadavg_1m`/`loadavg_5m`, the logical core count and a **code-independent probe**
21
- # — `python3 -c pass` + `bash -c true` + `git rev-parse`, in ms), and when a wait runs out of its
22
- # (progress-extended) horizon the engine attributes the verdict from the machine's own readings:
23
- # still painting / probe over its ceiling / load over the coarse guard -> one visible SKIP line and
24
- # the scenario stops there (fixture exit 4, the gate stays 0); a static scene with the readings
25
- # under their ceilings -> the ordinary red with its M59 scene (a regression is a code verdict).
26
- # Constants and their measured bands: probe ceiling 120 ms (measured 12-34 ms across loadavg
27
- # 8.4-42.4 on 32 cores), coarse load guard 2.0 x cores (the highest measured green load is 1.33 x
28
- # cores) — both sit **outside** the band where this fixture judges. Re-derivation recipe:
29
- # `tests/load-experiment.sh {storm,burn,probe}` (the safe harness: owned load, owned targets) +
30
- # design.md §3/§4; the raw calibration table is in docs/team/reports/P48-dev3.md.
16
+ # P316(用户裁定第二条:性能只能是参考指标,不能阻塞):**没有负载前提、没有 SKIP 出口**。
17
+ # 等待上限只防死等;耗尽一律红并报「没等到 X」(含最后一次状态)。机器忙不再是「没结论」。
31
18
  #
32
19
  # P68 / fixture-waits-for-landed-reads — 数据态等待(requirement「A fixture observes a data-derived state
33
20
  # before it asserts it」):视图行、席位行、组标题这类**断言对象本身**从异步的 settings 读来,断言前必须
@@ -38,16 +25,11 @@
38
25
  #
39
26
  # Fixture knobs (honoured **only** under `TEAM_SMOKE_FIXTURE=1`; otherwise printed as ignored and
40
27
  # the real reading is used — the panel-cpu.sh precedent):
41
- # TEAM_P21_PREMISE_PROBE_MS=<ms> inject the probe reading; over its ceiling the fixture also
42
28
  # injects the "the state never arrives" stall, so the
43
29
  # exhaustion path is reachable on a quiet host
44
- # TEAM_P21_PREMISE_LOADAVG=<n> inject loadavg_1m
45
- # TEAM_P21_PREMISE_LOAD_FACTOR=<f> inject the coarse entry guard's factor
46
- # TEAM_P21_PREMISE_PROBE_CEIL_MS=<ms> inject the probe ceiling
47
30
  # TEAM_P21_STALL_ROUNDS=<n> inject the progress window (PTY_STALL_ROUNDS)
48
31
  # TEAM_P21_STALL=1 inject a needle that never appears (the exhaustion shape
49
32
  # on a healthy machine: it must stay a red, not a skip)
50
- # TEAM_P21_PREMISE_ONLY=1 print the premise line + the ignore notices, build no tmux
51
33
  # and judge nothing, exit 0 (the gate's knob-integrity check)
52
34
  set -uo pipefail
53
35
 
@@ -60,17 +42,15 @@ _keep_arg="${TEAM_P21_KEEP:-0}"
60
42
  _trace_arg="${TEAM_P21_TRACE:-}"
61
43
  _js_arg="${TEAM_P21_JS:-}"
62
44
  _js_panel="${TEAM_P21_PANEL:-}"
63
- # P48: the premise knobs (and the fixture switch itself) are saved before the identity wipe, which
64
- # would otherwise unset every TEAM_* — including TEAM_SMOKE_FIXTURE, the only switch that makes an
65
- # injected reading count.
66
- _smoke_fixture_arg="${TEAM_SMOKE_FIXTURE:-0}"
67
- _premise_probe_arg="${TEAM_P21_PREMISE_PROBE_MS:-}"
68
- _premise_load_arg="${TEAM_P21_PREMISE_LOADAVG:-}"
69
- _premise_factor_arg="${TEAM_P21_PREMISE_LOAD_FACTOR:-}"
70
- _premise_ceil_arg="${TEAM_P21_PREMISE_PROBE_CEIL_MS:-}"
71
- _premise_stall_arg="${TEAM_P21_STALL_ROUNDS:-}"
72
- _stall_arg="${TEAM_P21_STALL:-}"
73
- _premise_only_arg="${TEAM_P21_PREMISE_ONLY:-0}"
45
+ # 诊断旋钮在身份清洗之前保存(清洗会把所有 TEAM_* 一起 unset)。
46
+ _trace_arg="${TEAM_P21_TRACE:-}"
47
+ # P318(D-3):未绑定键扫描的红侧旋钮(把一个未绑定键换成会写盘的键)。照夹具旋钮的规矩:
48
+ # 只在 TEAM_SMOKE_FIXTURE=1 下生效,否则打印忽略行 —— 环境不能悄悄拆掉判据的方向。
49
+ _fixture_arg="${TEAM_SMOKE_FIXTURE:-0}"
50
+ _sweep_write_arg="${TEAM_P21_SWEEP_WRITE:-0}"
51
+ if [ "$_sweep_write_arg" = "1" ] && [ "$_fixture_arg" != "1" ]; then
52
+ printf 'panel-p21: TEAM_P21_SWEEP_WRITE=1 被忽略(夹具旋钮只在 TEAM_SMOKE_FIXTURE=1 下生效)\n' >&2
53
+ fi
74
54
  while IFS='=' read -r _v _; do
75
55
  case "$_v" in TEAM_*) unset "$_v" 2>/dev/null || true ;; esac
76
56
  done < <(env)
@@ -93,7 +73,6 @@ keep="${_keep_arg:-0}"
93
73
  tmp="$(tmp_root_create panel-p21)" || exit 3
94
74
  PASS=0
95
75
  FAIL=0
96
- SKIP=0
97
76
  ROOT=""
98
77
  state=""
99
78
  current=""
@@ -122,112 +101,6 @@ assert_has() { grep -qF -- "$2" "$1" 2>/dev/null && ok "$3" || bad "$3($1 里
122
101
  assert_not() { grep -qF -- "$2" "$1" 2>/dev/null && bad "$3(不该出现 [$2])" || ok "$3"; }
123
102
  assert_match() { grep -qE -- "$2" "$1" 2>/dev/null && ok "$3" || bad "$3($1 里没有匹配 [$2])"; }
124
103
 
125
- # ── 前提(P48 / D33,panel#The project-settings pty fixture judges under a machine premise)────
126
- # 视界是失败探测器:等待耗尽那一刻由 tests/lib/pty-wait.sh 调 pty_premise_over(下面)按机器读数
127
- # 归因 —— 超前提 → 一行可见 SKIP 并把当前场景停在原地(整体退出 4);静态场景 + 前提之内 → 红。
128
- # 前提本身在**入口不判定**(只有粗闸门跳过整体超载的机器),所以前提行只是把真读数打出来。
129
- P21_PREMISE_PROBE_CEIL_MS_DEFAULT=120
130
- P21_PREMISE_LOAD_FACTOR_DEFAULT=2.0
131
- P21_PREMISE_REASON=""
132
- P21_NOTICED=""
133
- p21_fixture_on() { [ "${_smoke_fixture_arg:-0}" = "1" ]; }
134
- p21_notice() { # 每个旋钮只打一次忽略行(同一个值会被几个读数点重复请求)
135
- case " ${P21_NOTICED:-} " in *" $1 "*) return 0 ;; esac
136
- P21_NOTICED="${P21_NOTICED:-} $1"
137
- printf ' 忽略 %s=%s(只有 TEAM_SMOKE_FIXTURE=1 时夹具旋钮才生效;真实路径读真值)\n' "$1" "$2" >&2
138
- }
139
- p21_cores() { nproc 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || printf '0'; }
140
- p21_load5() { cut -d' ' -f2 /proc/loadavg 2>/dev/null || printf '?'; }
141
- p21_load1() {
142
- if [ -n "${_premise_load_arg:-}" ]; then
143
- if p21_fixture_on; then printf '%s\n' "$_premise_load_arg"; return 0; fi
144
- p21_notice TEAM_P21_PREMISE_LOADAVG "$_premise_load_arg"
145
- fi
146
- cut -d' ' -f1 /proc/loadavg 2>/dev/null || printf '?'
147
- }
148
- # 代码无关探针(P44 的 probe.sh 口径):只起进程,永远不碰面板;5 轮均值,毫秒。
149
- p21_probe_ms() {
150
- local n=5 i t0
151
- t0="$(date +%s%3N)"
152
- for i in $(seq 1 "$n"); do
153
- python3 -c 'pass' >/dev/null 2>&1
154
- bash -c 'true' >/dev/null 2>&1
155
- git -C "$tree" rev-parse --quiet HEAD >/dev/null 2>&1
156
- done
157
- printf '%s\n' $(( ($(date +%s%3N) - t0) / n ))
158
- }
159
- p21_probe_reading() {
160
- if [ -n "${_premise_probe_arg:-}" ]; then
161
- if p21_fixture_on; then printf '%s\n' "$_premise_probe_arg"; return 0; fi
162
- p21_notice TEAM_P21_PREMISE_PROBE_MS "$_premise_probe_arg"
163
- fi
164
- p21_probe_ms
165
- }
166
- p21_factor() {
167
- if [ -n "${_premise_factor_arg:-}" ]; then
168
- if p21_fixture_on; then printf '%s\n' "$_premise_factor_arg"; return 0; fi
169
- p21_notice TEAM_P21_PREMISE_LOAD_FACTOR "$_premise_factor_arg"
170
- fi
171
- printf '%s\n' "$P21_PREMISE_LOAD_FACTOR_DEFAULT"
172
- }
173
- p21_probe_ceil() {
174
- if [ -n "${_premise_ceil_arg:-}" ]; then
175
- if p21_fixture_on; then printf '%s\n' "$_premise_ceil_arg"; return 0; fi
176
- p21_notice TEAM_P21_PREMISE_PROBE_CEIL_MS "$_premise_ceil_arg"
177
- fi
178
- printf '%s\n' "$P21_PREMISE_PROBE_CEIL_MS_DEFAULT"
179
- }
180
- p21_load_threshold() { awk -v c="$(p21_cores)" -v f="$(p21_factor)" 'BEGIN { printf "%.2f", f * c }'; }
181
- p21_premise_line() { # <场景名>:真读数 + 两个顶(只打,不判)
182
- local label="${1:-?}" load1 load5 cores probe factor ceil
183
- load1="$(p21_load1)"; load5="$(p21_load5)"; cores="$(p21_cores)"
184
- probe="$(p21_probe_reading)"; factor="$(p21_factor)"; ceil="$(p21_probe_ceil)"
185
- printf '== 前提 %s:loadavg_1m %s / loadavg_5m %s · 逻辑核 %s · 代码无关探针 %sms(顶 %sms)· 粗闸门 %s = %s×%s 核 ==\n' \
186
- "$label" "$load1" "$load5" "$cores" "$probe" "$ceil" \
187
- "$(p21_load_threshold)" "$factor" "$cores"
188
- }
189
- # 入口粗闸门:0 = 前提之内(照跑)/ 1 = 负载超顶(在第一个等待之前 SKIP 整个场景)。
190
- # 它故意取在实测绿带**之外**(最高实测绿 1.33×核),只是别在严重过载的宿主上白烧几分钟,
191
- # 不是「绿/红交叉点」(P44 的结论:负载平均没有实测交叉点)。
192
- p21_entry_guard() {
193
- local load1 cores thr
194
- load1="$(p21_load1)"; cores="$(p21_cores)"; thr="$(p21_load_threshold)"
195
- case "$cores" in ''|*[!0-9]*) return 0 ;; esac
196
- [ "$cores" -gt 0 ] || return 0
197
- if awk -v l="$load1" -v t="$thr" 'BEGIN { exit !(l <= t) }'; then return 0; fi
198
- return 1
199
- }
200
- p21_entry_skip_line() {
201
- printf ' \033[33mSKIP\033[0m 入口粗闸门:loadavg_1m %s > %s(%s×%s 核)—— 场景 %s 在第一个等待之前就停下(无失败、无结论,exit 4)\n' \
202
- "$(p21_load1)" "$(p21_load_threshold)" "$(p21_factor)" "$(p21_cores)" "${1:-?}"
203
- }
204
- # 引擎在耗尽那一刻调的两个钩子(tests/lib/pty-wait.sh):超前提 → 引擎打 SKIP 行并调 pty_on_skip。
205
- pty_on_skip() { exit 4; }
206
- pty_premise_over() { # 0 = 机器超前提(归因给机器)/ 1 = 前提之内(代码判决)
207
- local load1 cores probe ceil thr factor
208
- load1="$(p21_load1)"; cores="$(p21_cores)"; probe="$(p21_probe_reading)"
209
- ceil="$(p21_probe_ceil)"; factor="$(p21_factor)"; thr="$(p21_load_threshold)"
210
- P21_PREMISE_REASON="loadavg_1m ${load1} vs 粗闸门 ${thr}(${factor}×${cores} 核);探针 ${probe}ms vs 顶 ${ceil}ms"
211
- case "$probe" in ''|*[!0-9]*) probe=0 ;; esac
212
- case "$ceil" in ''|*[!0-9]*) ceil=120 ;; esac
213
- [ "$probe" -le "$ceil" ] || return 0
214
- case "$cores" in ''|*[!0-9]*) return 1 ;; esac
215
- [ "$cores" -gt 0 ] || return 1
216
- awk -v l="$load1" -v t="$thr" 'BEGIN { exit !(l > t) }' && return 0
217
- return 1
218
- }
219
- pty_premise_reason() { printf '%s' "${P21_PREMISE_REASON:-(没有读数)}"; }
220
-
221
- # ── 前提自述模式(M58/panel-knobs 的先例 + P48):只打前提行与每个注入旋钮的忽略行,不建 tmux、
222
- # 不起面板、不判任何时长 —— 门禁每轮用它证明「旋钮不得漏进真路径」(时间无关)。
223
- if [ "${_premise_only_arg:-0}" = "1" ]; then
224
- _only_sections=("$@")
225
- [ "${#_only_sections[@]}" -gt 0 ] || _only_sections=(premise-only)
226
- for _only_s in "${_only_sections[@]}"; do p21_premise_line "$_only_s"; done
227
- printf 'panel-p21: premise-only 模式(裸读数 + 旋钮忽略声明;除代码无关探针外没有起进程、没有建 tmux、没有判定;exit 0)\n'
228
- exit 0
229
- fi
230
-
231
104
  if ! command -v tmux >/dev/null 2>&1; then printf 'panel-p21: tmux is required\n' >&2; exit 3; fi
232
105
  if [ -z "$js" ]; then printf 'panel-p21: no node/bun runtime\n' >&2; exit 3; fi
233
106
  [ -f "$panel" ] || { printf 'panel-p21: no bundle at %s\n' "$panel" >&2; exit 3; }
@@ -238,23 +111,9 @@ if [ -z "$js" ]; then printf 'panel-p21: no node/bun runtime\n' >&2; exit 3; fi
238
111
  . "$here/lib/pty-wait.sh"
239
112
  # shellcheck source=lib/model-policy.sh
240
113
  . "$here/lib/model-policy.sh" # P232:完整派单记录构造器(S1 的共享夹具)
241
- # Fixture-wide knobs. PTY_WAIT_ITERS is a failure-detector horizon, never spent on a green run (a
242
- # green wait returns on the first settled frame, usually rounds 1-3); per-wait overrides use local.
114
+ # 等待视界只防死等:默认由 tests/lib/pty-wait.sh 给(基础 100 轮、仍在绘制时最多 5 倍)。
243
115
  PTY_TRACE="${_trace_arg:-0}"
244
116
  PTY_SCENE_DIR=""
245
- # P48: 延长窗口与上限由夹具钉住(默认 8 / 3);夹具旋钮只在 TEAM_SMOKE_FIXTURE=1 下覆盖。
246
- # 注入读数超顶时同时注入「状态永不到来」的针:那是夹具在模拟「这台机器交不出这一帧」,
247
- # 让耗尽路径在安静机上可达(真路径下没有针,也没有注入)。
248
- PTY_STALL_ROUNDS=8
249
- PTY_EXT_FACTOR=3
250
- if p21_fixture_on; then
251
- case "${_premise_stall_arg:-}" in ''|*[!0-9]*) ;; *) PTY_STALL_ROUNDS="$_premise_stall_arg" ;; esac
252
- case "${_premise_probe_arg:-}" in
253
- ''|*[!0-9]*) ;;
254
- *) [ "$_premise_probe_arg" -gt "$(p21_probe_ceil)" ] && PTY_INJECT_NEEDLE='◊P48-注入:状态永不到来◊' ;;
255
- esac
256
- [ "${_stall_arg:-0}" = "1" ] && PTY_INJECT_NEEDLE='◊P48-注入:状态永不到来◊'
257
- fi
258
117
 
259
118
  SECTIONS=("$@")
260
119
  [ "${#SECTIONS[@]}" -gt 0 ] || SECTIONS=(settings groups wheel choices choices-schema write conflict categories policy readonly)
@@ -307,7 +166,7 @@ start_panel() {
307
166
 
308
167
  wait_panel() {
309
168
  # The panel's first frame must be settled too (the first paint also arrives line by line).
310
- local PTY_WAIT_ITERS=80 PTY_WAIT_PAUSE=0.25 PTY_SETTLE_PAUSE=0.3
169
+ local PTY_WAIT_PAUSE=0.25 PTY_SETTLE_PAUSE=0.3
311
170
  if pty_wait_frame - "面板首帧($current)" 'teamsmith pulse'; then
312
171
  sleep 0.5
313
172
  return 0
@@ -334,16 +193,16 @@ wait_editor() { # <tray title> [body marker]
334
193
  # Wait for the current frame to carry <text>; writes settle asynchronously. The latest capture is
335
194
  # written to the assertion's file every round, so a failure shows exactly what was on screen.
336
195
  wait_cap() { # <name> <text>
337
- local PTY_WAIT_ITERS=30 PTY_WAIT_PAUSE=0.4
196
+ local PTY_WAIT_PAUSE=0.4
338
197
  pty_wait_frame "$tmp/$current/$1.txt" "回执 $1" "$2"
339
198
  }
340
199
  # P68/fixture-waits-for-landed-reads:数据态等待。断言一行**从异步 settings 读来的数据**之前,先等
341
200
  # 那一行自己(值也在)出现在稳定帧上;骨架帧、固定 sleep + 单次采样都不算证据。上界 30 轮基础视界
342
201
  # (≈20s,静态场景不延长)与它的实测延迟带见文件头;耗尽时 pty-wait.sh 打一行归因(等待名 + 缺的
343
- # 标记 + 轮数),由 bad() 按机器读数分派红/SKIP。捕获仍写到 $tmp/$current/<name>.txt 供断言复用。
202
+ # 标记 + 轮数)。捕获仍写到 $tmp/$current/<name>.txt 供断言复用。
344
203
  wait_row() { # <name> <label> <needle...>
345
204
  local _name="$1" _label="$2"; shift 2
346
- local PTY_WAIT_ITERS=30 PTY_WAIT_PAUSE=0.4
205
+ local PTY_WAIT_PAUSE=0.4
347
206
  pty_wait_frame "$tmp/$current/$_name.txt" "数据态:$_label" "$@"
348
207
  }
349
208
 
@@ -377,6 +236,35 @@ audit_log() { printf '%s/config.log' "$state"; }
377
236
  audit_lines() { [ -f "$(audit_log)" ] && wc -l < "$(audit_log)" || echo 0; }
378
237
  sha() { sha256sum "$1" 2>/dev/null | awk '{print $1}'; }
379
238
  tree_hash() { ( cd "$ROOT" && find "$@" -type f 2>/dev/null | sort | while IFS= read -r f; do printf '%s ' "$f"; sha "$f"; done ) | sha256sum | awk '{print $1}'; }
239
+ # ── P318(D-3):未绑定键扫描(从 tests/panel-b2.sh 的 `readonly` 场景搬来,原场景已删)──────────
240
+ # 那一份**没有任何门禁或 CI 执行它**;这一份跟着 §38 段跑。判据:控制台只允许写**自己的**文件 ——
241
+ # 扫过一遍未绑定键与导航键之后,state / docs / 契约里其余内容必须逐字节不变。允许集逐条从代码列:
242
+ # ① state/draft.md 写信草稿(2.2 / 2.7 的结算面)
243
+ # ② state/panel.conf 设置视图写下的契约覆盖
244
+ # ③ state/panel-page 当前页(导航键的结果)
245
+ # ④ state/panel.log 控制台自己的运行日志:scripts/panel/src/main.tsx:229 的 appendFileSync
246
+ # ⑤ state/tmux-calls.log 它 spawn 的每个 `team` 调用的 tmux 闸门记录:scripts/lib/common.sh:3489
247
+ # 把 TEAM_TMUX_CALLS_LOG 钉成 $TEAM_STATE_DIR/tmux-calls.log
248
+ # ⑥ state/signal-calls.log 同一族的信号闸门记录(窗口里被 gated 的工具)
249
+ # 除这六个之外**任何**写入都算「只读面被破了」(红侧 TEAM_P21_SWEEP_WRITE:s 键写出 state/standby
250
+ # 与 watchdog.log 两处,必须红)。
251
+ sweep_manifest() { # → 一行一文件「<相对路径> <sha256>」(红的时候直接点名是谁被改了)
252
+ ( cd "$ROOT" && find .pi/team/state docs/team .pi/team/config.sh -type f 2>/dev/null \
253
+ | grep -vF -e '.pi/team/state/draft.md' -e '.pi/team/state/panel.conf' -e '.pi/team/state/panel-page' \
254
+ -e '.pi/team/state/panel.log' -e '.pi/team/state/tmux-calls.log' -e '.pi/team/state/signal-calls.log' \
255
+ | sort | while IFS= read -r f; do printf '%s %s\n' "$f" "$(sha "$f")"; done )
256
+ }
257
+ # 键表:panel-b2 原表的未绑定键 + 只允许动「控制台自己的文件」的导航/刷新键。
258
+ # 红侧(TEAM_SMOKE_FIXTURE=1 TEAM_P21_SWEEP_WRITE=1):把一次未绑定键换成**会写盘的键**
259
+ # (s → 一行理由 → Enter → 写 state/standby)→ 同一条断言必须变红。
260
+ sweep_keys() {
261
+ local k
262
+ for k in x z '?' '!' '~' 'w' '%' '&'; do type_text "$k"; done
263
+ keys r; keys Tab; keys Up; keys Down
264
+ if [ "$_fixture_arg" = "1" ] && [ "$_sweep_write_arg" = "1" ]; then
265
+ keys s; sleep 0.5; type_text 'sweep write'; sleep 0.3; keys Enter
266
+ fi
267
+ }
380
268
  conf_set() { mkdir -p "$state"; printf '%s\n' "$@" > "$state/panel.conf"; }
381
269
  # P232:把 fixture 契约换成新的类别策略 + 独立 PM(走真实事务入口 upgrade-models)——退休键真的
382
270
  # 离开文件,视图才在「当前契约」这一档上跑;老契约的档由 scn_categories 的 legacy 段专门覆盖。
@@ -403,12 +291,12 @@ open_view() {
403
291
  keys Down Down Down Down Down
404
292
  sleep 0.5
405
293
  keys Enter
406
- local PTY_WAIT_ITERS=40 PTY_WAIT_PAUSE=0.4
294
+ local PTY_WAIT_PAUSE=0.4
407
295
  if pty_wait_frame - "设置视图(marker=$marker)" "$marker"; then
408
296
  sleep 0.4
409
297
  return 0
410
298
  fi
411
- bad "项目设置视图没有在预算内出现数据(marker=$marker)"
299
+ bad "项目设置视图没等到(超过等待上限)数据(marker=$marker)"
412
300
  return 1
413
301
  }
414
302
 
@@ -507,7 +395,7 @@ assert_no_class_heading() { # <capture file> [label]
507
395
  local f="$1" label="${2:-视图没有类分组标题(分组是功能域)}"
508
396
  # M59/P127: `{ … || true; } | grep -q` — the capture file can outgrow the pipe buffer; grep -q
509
397
  # exits on the first hit and sed would take SIGPIPE (rc=141 → a class heading falsely "absent").
510
- if { sed 's/[│|]//g' "$f" || true; } | grep -qE '^ *(立即生效|需要重启|只读|Takes effect now|Needs a restart|Read-only) *$'; then
398
+ if { sed 's/[│|]//g' "$f" || true; } | grep -qE '^ *(立即生效|需重启|不可改|apply|restart|change in file) *$'; then
511
399
  bad "$label(捕获里出现了只有类词的行)"
512
400
  else
513
401
  ok "$label"
@@ -582,12 +470,43 @@ PYFIX
582
470
  assert_eq "导航行打开视图没有写 panel.conf" "$(sha "$state/panel.conf" 2>/dev/null || echo none)" "$conf_before"
583
471
  cap_to view
584
472
  # P30/D2:分组 = schema 第 10 列的功能域。视图开屏在只读骨架(identity),标题就是功能域名;
585
- # 旧的三条类分组标题(立即生效 / 需要重启 / 只读)不再是标题(徽章词仍在,见类徽章段)。
586
- assert_has "$tmp/$current/view.txt" "身份与账本布局" "功能域分组标题(identity,开屏即见)"
473
+ # 旧的三条类分组标题(立即生效 / 需重启 / 不可改)不再是标题(徽章词仍在,见类徽章段)。
587
474
  assert_no_class_heading "$tmp/$current/view.txt"
588
475
  # 行文本是人话标签(不是裸键),开屏聚焦行是 identity 的第一条 schema 键。
589
- assert_match "$tmp/$current/view.txt" '› 项目名 +.*只读' "开屏聚焦行是 identity 第一条(标签 + 只读 徽章)"
476
+ assert_match "$tmp/$current/view.txt" '› 项目名 +.*不可改' "开屏聚焦行是 identity 第一条(标签 + 不可改 徽章)"
590
477
  assert_not "$tmp/$current/view.txt" "TEAM_GATES" "行里不再出现裸键 TEAM_GATES"
478
+ # P266:审计整块离开视图(标题与行都不画)——审计仍可用 `team config list` 自己的尾部和 `team config log` 读。
479
+ assert_not "$tmp/$current/view.txt" "审计(最近)" "P266:视图里没有审计标题"
480
+ assert_not "$tmp/$current/view.txt" "result=" "P266:视图里没有 state/config.log 的审计行"
481
+ assert_no_match "$tmp/$current/view.txt" '^(│ )? *(Audit|审计)' "P266:没有任何一行是审计标题"
482
+ # P266:夹具键是数据驱动的隐藏:行不在视图里,按标签与裸键过滤都搜不到,而同组其它行还在。
483
+ local p266_k p266_cfg_before p266_json p266_route p266_human p266_rc
484
+ for p266_k in TEAM_DISK_STATS_FILE TEAM_SMOKE_FAST TEAM_INBOX_WATCH_FORCE_FAIL TEAM_IW_REQUIRE_WATCH; do
485
+ filter_to "$p266_k"
486
+ cap_to "p266-hidden-$p266_k"
487
+ assert_not "$tmp/$current/p266-hidden-$p266_k.txt" "$p266_k" "P266:$p266_k 不在视图里(按裸键搜不到)"
488
+ done
489
+ assert_not "$tmp/$current/p266-hidden-TEAM_DISK_STATS_FILE.txt" "磁盘读数夹具" "P266:隐藏的夹具键连人话标签也搜不到"
490
+ filter_to 磁盘读数夹具
491
+ cap_to p266-hidden-label
492
+ assert_not "$tmp/$current/p266-hidden-label.txt" "磁盘读数夹具" "P266:按标签过滤也搜不到夹具键"
493
+ # 同一组(policy)里还有可见键:标题因为别的行还在,不因隐藏而空。
494
+ filter_to TEAM_MEMINFO_FILE
495
+ cap_to p266-group-alive
496
+ assert_has "$tmp/$current/p266-group-alive.txt" "权限与依赖" "P266:同组其它行还在(隐藏的只是夹具键,标题没跟着消失)"
497
+ assert_not "$tmp/$current/p266-group-alive.txt" "TEAM_MEMINFO_FILE" "P266:那一帧里仍然只有人话标签,没有裸键"
498
+ filter_clear
499
+ # 读面与命令面一字不变:人读表仍列出、--json 仍带声明标记、set 仍 refuse。
500
+ p266_cfg_before="$(sha "$(cfg)")"
501
+ p266_human="$( ( cd "$ROOT" && bash "$skill/scripts/team" config list ) 2>&1 )"
502
+ case "$p266_human" in *TEAM_DISK_STATS_FILE*) ok "P266:人类可读表仍列出夹具键" ;; *) bad "P266:人类可读表不再列出夹具键" ;; esac
503
+ p266_json="$( ( cd "$ROOT" && bash "$skill/scripts/team" config list --json ) 2>&1 )"
504
+ p266_route="$(printf '%s' "$p266_json" | python3 -c 'import json,sys; d=json.load(sys.stdin); print([k["route"] for k in d["keys"] if k["name"]=="TEAM_DISK_STATS_FILE"][0])')"
505
+ case "$p266_route" in "fixture-only: "*) ok "P266:--json 的 route 原样带 fixture-only: 前缀" ;; *) bad "P266:--json 的 route 丢了声明标记($p266_route)" ;; esac
506
+ ( cd "$ROOT" && bash "$skill/scripts/team" config set TEAM_DISK_STATS_FILE /tmp/x --yes ) >/dev/null 2>&1
507
+ p266_rc=$?
508
+ assert_eq "P266:config set 夹具键仍 refuse(exit 5)" "$p266_rc" "5"
509
+ assert_eq "P266:refuse 没有动契约" "$(sha "$(cfg)")" "$p266_cfg_before"
591
510
  # 组内保持 schema 顺序(项目名 在 会话名 之前)。
592
511
  local n_first n_second
593
512
  n_first="$(grep -n '项目名' "$tmp/$current/view.txt" | head -1 | cut -d: -f1)"
@@ -600,17 +519,17 @@ PYFIX
600
519
  # 类徽章是词(P30/D4):过滤到一条 apply 行看它的徽章。
601
520
  filter_to 模型并发上限
602
521
  cap_to badge-apply
603
- assert_match "$tmp/$current/badge-apply.txt" '模型并发上限 +.*立即生效' "apply 行:人话标签 + 立即生效 徽章(词仍在)"
604
522
  cap_has "↑/↓ 行 · Enter 打开 · / 筛选" keyband
605
523
  # One filter per class: the badge, the unset marker and the line's own comment (all unchanged).
606
524
  filter_to TEAM_PULSE_INTERVAL
607
525
  cap_to restart
608
- assert_match "$tmp/$current/restart.txt" '巡检周期 +900 · 需重启' "restart 行的标签 + 需重启 徽章"
609
526
  assert_has "$tmp/$current/restart.txt" "命令行:team config set TEAM_PULSE_INTERVAL <新值>" "CLI 提示行点名原始键(照敲命令用)"
610
527
  filter_to TEAM_PROJECT
611
528
  cap_to refuse
612
- assert_match "$tmp/$current/refuse.txt" '项目名 +root · 只读' "refuse 行的标签 + 只读 徽章"
613
- assert_has "$tmp/$current/refuse.txt" "手改 .pi/team/config.sh 里的 TEAM_PROJECT" "refuse 提示行点名原始键与手改路线"
529
+ assert_match "$tmp/$current/refuse.txt" '项目名 +root · 不可改' "refuse 行的标签 + 不可改 徽章"
530
+ assert_has "$tmp/$current/refuse.txt" "这个值要改项目配置文件 .pi/team/config.sh,界面不能改" "refuse 提示行是那句普通的文件路线"
531
+ assert_not "$tmp/$current/refuse.txt" "手改" "P266:refuse 提示行里没有「手改」"
532
+ assert_not "$tmp/$current/refuse.txt" "只读" "P266:refuse 行的徽章不再写「只读」"
614
533
  # P32:短列表(一条过滤结果)也把卡片填满 —— 空白留在卡片**里面**,卡片下边框仍紧贴键栏。
615
534
  cap_visible_to filter-fill
616
535
  fstats="$(settings_window_stats "$tmp/$current/filter-fill.txt")"
@@ -626,11 +545,11 @@ PYFIX
626
545
  filter_to TEAM_PULSE_NUDGE_GAP
627
546
  cap_to comment
628
547
  assert_match "$tmp/$current/comment.txt" '重复提醒间隔 +900 · 立即生效 +# 15min' "行内注释原样渲染"
629
- # M49 回退:schema 不认识的键没有标签 → 行的主文本就是原始键(未知键徽章 + 未知键提示)。
548
+ # M49 回退:schema 不认识的键没有标签 → 行的主文本就是原始键(「不认识」徽章 + 提示行)。
630
549
  filter_to TEAM_HAND_ADDED
631
550
  cap_to unknown
632
- assert_match "$tmp/$current/unknown.txt" 'TEAM_HAND_ADDED +hand · 未知键' "schema 不认识的键回退显示原始键"
633
- assert_has "$tmp/$current/unknown.txt" "未知键:TEAM_HAND_ADDED" "未知键的提示行说清楚为什么没有标签"
551
+ assert_match "$tmp/$current/unknown.txt" 'TEAM_HAND_ADDED +hand · 不认识' "schema 不认识的键回退显示原始键"
552
+ assert_has "$tmp/$current/unknown.txt" "TEAM_HAND_ADDED:这个设置在文件里,工具不认识它" "未知键的提示行说清楚为什么没有标签"
634
553
  # The filter matches the label (M49), key or value; esc clears it without closing the view.
635
554
  filter_to 巡检周期
636
555
  cap_to filter-label
@@ -703,33 +622,23 @@ PYFIX
703
622
  local before; before="$(sha "$(cfg)")"
704
623
  filter_to TEAM_SESSION
705
624
  sleep 0.3
706
- if focus_row '会话名 +.*只读'; then
625
+ if focus_row '会话名 +.*不可改'; then
707
626
  keys Enter
708
627
  else
709
628
  bad "没能把焦点移到 refuse 行"
710
629
  fi
711
- if wait_cap refuse-route "手改"; then ok "refuse 行的回执点名路线"; else bad "refuse 行的回执没出现"; fi
630
+ if wait_cap refuse-route "只能改项目配置文件"; then ok "refuse 行的回执点名普通路线(不是命令行黑话)"; else bad "refuse 行的回执没出现"; fi
712
631
  assert_eq "refuse 行没有写契约" "$(sha "$(cfg)")" "$before"
713
- # P144:磁盘底线的两行 + 夹具缝一行 —— 行主文本是标签(不是裸键),类徽章照旧;缝是 refuse:
714
- # 回车只给路线,不开编辑器、不写契约。
632
+ # P144:磁盘底线的两行 —— 行主文本是标签(不是裸键),类徽章照旧。P266:夹具缝行已经**不在视图里**
633
+ # (上面刚证过),它的读面与命令面由那里的断言守住。
715
634
  filter_to 临时根空间底线
716
635
  cap_to p144-mb
717
636
  assert_match "$tmp/$current/p144-mb.txt" '› 临时根空间底线 +未设 · 默认 1024 · 立即生效' \
718
- "P144:临时根空间底线 行是人话标签 + apply 徽章"
719
637
  assert_not "$tmp/$current/p144-mb.txt" '临时根空间底线 +TEAM_' "P144:字节底线行主文本不是裸键"
720
638
  filter_to inode 底线
721
639
  if focus_row '临时根 inode 底线 +未设 · 默认 100000'; then :; else bad "P144:没能把焦点移到 inode 底线行"; fi
722
640
  cap_to p144-ino
723
641
  assert_match "$tmp/$current/p144-ino.txt" '› 临时根 inode 底线 +未设 · 默认 100000 · 立即生效' \
724
- "P144:临时根 inode 底线 行是人话标签 + apply 徽章"
725
- local p144_before; p144_before="$(sha "$(cfg)")"
726
- filter_to 磁盘读数夹具
727
- cap_to p144-seam
728
- assert_match "$tmp/$current/p144-seam.txt" '› 磁盘读数夹具 +.*只读' \
729
- "P144:磁盘读数夹具 行是人话标签 + refuse 徽章"
730
- if focus_row '磁盘读数夹具 +.*只读'; then keys Enter; else bad "P144:没能把焦点移到夹具缝行"; fi
731
- if wait_cap p144-seam-route "手改"; then ok "P144:缝行的回执点名手改路线(不开编辑器)"; else bad "P144:缝行的回执没出现"; fi
732
- assert_eq "P144:缝行没有写契约" "$(sha "$(cfg)")" "$p144_before"
733
642
  # M59: the navigation esc is state-checked too — it fires only while the settings view is on a
734
643
  # settled frame, so a drifted scene gets a named red instead of a blind key.
735
644
  pty_key_when "esc 回浮层" '╭─ 项目设置' Escape || bad "esc 前设置视图已经不在屏幕上"
@@ -758,10 +667,10 @@ PYFIX
758
667
  import sys
759
668
  p = sys.argv[1]
760
669
  s = open(p, encoding='utf-8').read()
761
- s = s.replace('TEAM_GATES|apply|cmd||plain||-|', 'TEAM_GATES|refuse|cmd||plain||-|改门禁请手改(scratch 夹具)')
670
+ s = s.replace('TEAM_GATES|apply|cmd||plain||-|', 'TEAM_GATES|refuse|cmd||plain||-|改门禁要改项目配置文件(scratch 夹具)')
762
671
  anchor = 'TEAM_INSTALL_CMD|apply|cmd||plain||-|||workflow'
763
672
  assert anchor in s, '找不到 TEAM_INSTALL_CMD 的 schema 行'
764
- s = s.replace(anchor, 'TEAM_ZZZ_TEST|apply|text||plain|zzz-default|-|||workflow\n' + anchor, 1)
673
+ s = s.replace(anchor, 'TEAM_ZZZ_TEST|apply|text||plain|zzz-default|-|||workflow\nTEAM_ZZZ_FIXTURE|refuse|path|file,opt|plain||-|fixture-only: 只在 scratch 夹具里用||policy\n' + anchor, 1)
765
674
  open(p, 'w', encoding='utf-8').write(s)
766
675
  PYFIX
767
676
  cat > "$tmp/$current-scratch-wrapper.sh" <<EOF2
@@ -776,13 +685,49 @@ EOF2
776
685
  filter_to TEAM_ZZZ_TEST
777
686
  # P68:等那一行(值也在)出现在稳定帧上,不用固定 sleep 采样。
778
687
  wait_row scratch-key "scratch 视图里的 TEAM_ZZZ_TEST 行" 'TEAM_ZZZ_TEST' '未设 · 默认 zzz-default' \
779
- || bad "scratch CLI 新增的键行没有在预算内出现"
688
+ || bad "scratch CLI 新增的键行没等到(超过等待上限)"
780
689
  assert_match "$tmp/$current/scratch-key.txt" 'TEAM_ZZZ_TEST +未设 · 默认 zzz-default' "scratch CLI 新增的键出现在视图里(不重建 panel.js;无标签→回退裸键)"
690
+ # P266(设计表 248):同一张 scratch schema 里再添一行**带标记**的新键 → 它不进渲染(隐藏规则读标记,
691
+ # 不是 bundle 里写死的四个键名;这一行是 fixture 里从没出现过的名字)。
692
+ filter_to TEAM_ZZZ_FIXTURE
693
+ cap_to scratch-marked
694
+ assert_not "$tmp/$current/scratch-marked.txt" "TEAM_ZZZ_FIXTURE" "P266:带 fixture-only 标记的新键被隐藏(规则是数据,不是名单)"
695
+ filter_clear
781
696
  filter_to TEAM_GATES
782
- wait_row scratch-class "scratch 视图里的 TEAM_GATES 行(类改成只读)" '门禁命令' 'true · 只读' \
783
- || bad "scratch CLI 改过的类行没有在预算内出现"
784
- assert_match "$tmp/$current/scratch-class.txt" '门禁命令 +true · 只读' "scratch CLI 改过的类跟着变(bundle 没有第二张键表)"
785
- assert_has "$tmp/$current/scratch-class.txt" "手改 .pi/team/config.sh 里的 TEAM_GATES" "scratch CLI 的拒统路线也点名原始键"
697
+ wait_row scratch-class "scratch 视图里的 TEAM_GATES 行(类改成不可改)" '门禁命令' 'true · 不可改' \
698
+ || bad "scratch CLI 改过的类行没等到(超过等待上限)"
699
+ assert_match "$tmp/$current/scratch-class.txt" '门禁命令 +true · 不可改' "scratch CLI 改过的类跟着变(bundle 没有第二张键表)"
700
+ assert_has "$tmp/$current/scratch-class.txt" "这个值要改项目配置文件 .pi/team/config.sh" "scratch CLI 的 refuse 提示行仍是那句普通路线"
701
+ if focus_row '门禁命令 +true · 不可改'; then keys Enter; else bad "P266:没能把焦点移到 scratch 的 refuse 行"; fi
702
+ if wait_cap scratch-route "改门禁要改项目配置文件(scratch 夹具)"; then
703
+ ok "P266:scratch CLI 自己写的备注原样上屏(路线不是写死的)"
704
+ else
705
+ bad "P266:scratch CLI 的备注没有上屏"
706
+ fi
707
+ # P266 红侧(数据驱动):把 scratch 树里夹具键的声明标记删掉 → 那一行回到视图;还原 → 又消失。
708
+ local marker_red_cfg
709
+ marker_red_cfg="$scratch/skills/teamsmith/scripts/lib/cmd-config.sh"
710
+ python3 - "$marker_red_cfg" <<'PYFIX'
711
+ import sys
712
+ p = sys.argv[1]
713
+ s = open(p, encoding='utf-8').read()
714
+ mark = 'fixture-only: 只在测试套件里用(磁盘读数夹具)'
715
+ assert mark in s, '找不到夹具键的声明标记'
716
+ s = s.replace('|' + mark + '||policy', '|||policy', 1)
717
+ open(p, 'w', encoding='utf-8').write(s)
718
+ PYFIX
719
+ P21_CLI="$tmp/$current-scratch-wrapper.sh" start_panel
720
+ open_view
721
+ filter_to 磁盘读数夹具
722
+ wait_row p266-marker-red "标记删掉后夹具键回到视图" '磁盘读数夹具' '不可改' \
723
+ || bad "P266 红侧:删掉声明标记后那一行没有回到视图"
724
+ assert_match "$tmp/$current/p266-marker-red.txt" '磁盘读数夹具 +.*不可改' "P266 红侧:行回来了(隐藏跟着读侧的数据走)"
725
+ cp -a "$skill/scripts/lib/cmd-config.sh" "$marker_red_cfg"
726
+ P21_CLI="$tmp/$current-scratch-wrapper.sh" start_panel
727
+ open_view
728
+ filter_to 磁盘读数夹具
729
+ cap_to p266-marker-green
730
+ assert_not "$tmp/$current/p266-marker-green.txt" "磁盘读数夹具" "P266 还原:标记加回后那一行再次消失"
786
731
  # M49:另一种语言的人话标签(同一张表切换,标签不是渲染时的硬编码)。
787
732
  conf_set "lang=en" "page=1" "activity=1" "mouse=1" "density=comfortable" "theme=auto"
788
733
  start_panel
@@ -791,6 +736,13 @@ EOF2
791
736
  cap_to en
792
737
  assert_match "$tmp/$current/en.txt" '› Patrol interval' "en 行的人话标签(行不是裸键)"
793
738
  assert_has "$tmp/$current/en.txt" "CLI: team config set TEAM_PULSE_INTERVAL <value>" "en 的 CLI 提示行同样点名原始键"
739
+ # P266:两种语言的样张都要能给评审直接读(报告里贴的就是这些帧):走到尾部,两个块标题 + 席位原因。
740
+ filter_clear
741
+ sleep 0.4
742
+ walk_to_tail en-tail
743
+ assert_has "$tmp/$current/en-tail.txt" "The model the next task will use" "en 的类别块标题(下一次派任务会用的模型)"
744
+ assert_has "$tmp/$current/en-tail.txt" "The model running tasks actually use" "en 的席位块标题(正在运行的任务实际使用的模型)"
745
+ assert_has "$tmp/$current/en-tail.txt" "this seat has not been given a task yet" "en 的「这个席位还没有派过任务」(席位没有记录)"
794
746
 
795
747
  # ── P32:视图用满窗口高度(用户实测 45 行里 16 行空白)+ 行数记账诚实 ──
796
748
  # 同一条契约、同一个面板,只改 pane 行高:① 内容结尾(卡片下边框)到键栏的空白 ≤1 行;
@@ -802,8 +754,9 @@ EOF2
802
754
  start_panel
803
755
  open_view
804
756
  local want_count
757
+ # P266:视图里的行 = schema 键(减去被声明为 fixture-only 的键)+ 类别 + 席位 + PM 启动记录。
805
758
  want_count="$( (cd "$ROOT" && bash "$skill/scripts/team" config list --json) \
806
- | python3 -c 'import json,sys; d=json.load(sys.stdin); m=d.get("models",{}); print(len(d["keys"]) + len(m.get("policy",{}).get("categories",[])) + len(m.get("assignments",[])) + (1 if m.get("pm_launch") else 0))' )"
759
+ | python3 -c 'import json,sys; d=json.load(sys.stdin); m=d.get("models",{}); keys=[k for k in d["keys"] if not str(k.get("route","")).startswith("fixture-only: ")]; print(len(keys) + len(m.get("policy",{}).get("categories",[])) + len(m.get("assignments",[])) + (1 if m.get("pm_launch") else 0))' )"
807
760
  [ "${want_count:-0}" -gt 0 ] || bad "读数拿不到键数(前提不成立)"
808
761
  local h s rows up down gap prev_rows=""
809
762
  for h in 45 33 30 25; do
@@ -881,7 +834,7 @@ JSON
881
834
  filter_to TEAM_NOTIFY_TMUX
882
835
  # P68:断言那一行本身之前先等数据态(未设 bool 行 + 它的默认值)落定。
883
836
  wait_row bool-row "未设 bool 行显示「未设 · 默认 1」" '走 tmux 投递' '未设 · 默认 1' \
884
- || bad "未设的 bool 行没有在预算内显示默认值"
837
+ || bad "未设的 bool 行没等到显示默认值"
885
838
  assert_match "$tmp/$current/bool-row.txt" '走 tmux 投递 +未设 · 默认 1' "未设的 bool 行显示 未设 · 默认 1"
886
839
  gap0="$(argv_count)"
887
840
  keys Enter
@@ -897,8 +850,8 @@ JSON
897
850
  fi
898
851
  cap_to bool
899
852
  assert_match "$tmp/$current/bool.txt" '› 保持未设' "未设键的首个条目是保持未设(并且是焦点)"
900
- assert_has "$tmp/$current/bool.txt" "开(1) · 默认" "1 是默认条目,带表里的 on 词"
901
- assert_has "$tmp/$current/bool.txt" "关(0)" "0 是另一个条目,带表里的 off 词"
853
+ assert_has "$tmp/$current/bool.txt" "(1) · 默认" "1 是默认条目,带表里的 on 词"
854
+ assert_has "$tmp/$current/bool.txt" "(0)" "0 是另一个条目,带表里的 off 词"
902
855
  assert_not "$tmp/$current/bool.txt" "…(自由输入)" "bool 是封闭域:没有自由输入项"
903
856
  local bool_sha bool_audit
904
857
  bool_sha="$(sha "$(cfg)")"; bool_audit="$(audit_lines)"
@@ -926,7 +879,7 @@ JSON
926
879
  # P68:等那一行真的显示刚写下的规范值(accept 后的 settle 重读落定),再按 Enter ——
927
880
  # 选择器是一次成形的快照(D43),不等读就会从旧块开(CI 那三条红就是这个形状)。
928
881
  wait_row bool-set-row "写入后的 bool 行显示新值 0" '走 tmux 投递' '0 · 立即生效' \
929
- || bad "写入后的设置行没有在预算内显示新值"
882
+ || bad "写入后的设置行没等到显示新值"
930
883
  keys Enter
931
884
  wait_picker TEAM_NOTIFY_TMUX '关(0) · 当前' || bad "bool 选择器第二次没有打开"
932
885
  cap_to bool-set
@@ -947,9 +900,9 @@ PY2
947
900
  filter_to TEAM_NOTIFY_TMUX
948
901
  # P68(本变更的主目标):等那一行**本身**显示手改后的值(视图打开时那次强制读落定)再按 Enter。
949
902
  # 等待名把被等的状态写清楚;耗尽时引擎打一行 `等待超时:数据态:…(缺 [走 tmux 投递 true · 立即生效])`,
950
- # bad() 再按机器读数分派红/SKIP。骨架标记(分组标题)与固定 sleep 都不再是证据。
903
+ # 骨架标记(分组标题)与固定 sleep 都不再是证据。
951
904
  wait_row bool-spelling-row "设置行显示手改后的值 true" '走 tmux 投递' 'true · 立即生效' \
952
- || bad "手改后的设置行没有在预算内显示新值"
905
+ || bad "手改后的设置行没等到显示新值"
953
906
  keys Enter
954
907
  wait_picker TEAM_NOTIFY_TMUX 'true · 当前' || bad "非规范 bool 的选择器没有打开"
955
908
  cap_to bool-spelling
@@ -984,7 +937,7 @@ PY2
984
937
  # ── (3) 未设键:编辑器开在「保持未设」上,接受 = 取消(不写、不留审计、不留临时文件);再接受 300 = 直写 ──
985
938
  filter_to TEAM_DEFER_TTL
986
939
  wait_row defer-row "未设 seconds 行显示「未设 · 默认 300」" '排队过期时间' '未设 · 默认 300' \
987
- || bad "未设键的行没有在预算内显示默认值"
940
+ || bad "未设键的行没等到显示默认值"
988
941
  assert_match "$tmp/$current/defer-row.txt" '排队过期时间 +未设 · 默认 300' "未设键的行显示 未设 · 默认 300"
989
942
  local defer_sha defer_audit
990
943
  defer_sha="$(sha "$(cfg)")"; defer_audit="$(audit_lines)"
@@ -1025,7 +978,7 @@ PY2
1025
978
  keys Enter
1026
979
  wait_picker TEAM_PULSE_INTERVAL '› 保持未设' || bad "数值键的选择器没有打开"
1027
980
  cap_to numeric
1028
- assert_has "$tmp/$current/numeric.txt" "接受区间 60–∞" "数值键显示命令给的接受区间(上界空 = 无界)"
981
+ assert_has "$tmp/$current/numeric.txt" "60–∞" "数值键显示命令给的接受区间(上界空 = 无界)"
1029
982
  assert_match "$tmp/$current/numeric.txt" '› 保持未设' "未设的数值键也以保持未设开头"
1030
983
  assert_has "$tmp/$current/numeric.txt" "900 · 默认" "建议值里的默认值带默认标记"
1031
984
  assert_has "$tmp/$current/numeric.txt" "1800" "建议值原样给出"
@@ -1268,7 +1221,7 @@ EOF2
1268
1221
  open_view
1269
1222
  filter_to TEAM_ZZZ_MODE
1270
1223
  wait_row zzz-row "scratch 新增 enum 键的行(裸键 + red 默认)" 'TEAM_ZZZ_MODE' '未设 · 默认 red' \
1271
- || bad "scratch CLI 新增的 enum 键行没有在预算内出现"
1224
+ || bad "scratch CLI 新增的 enum 键行没等到(超过等待上限)"
1272
1225
  assert_has "$tmp/$current/zzz-row.txt" "TEAM_ZZZ_MODE" "scratch CLI 新增的 enum 键出现在视图里(无标签→回退裸键)"
1273
1226
  assert_has "$tmp/$current/zzz-row.txt" "未设 · 默认 red" "新键的默认值来自 schema"
1274
1227
  keys Enter
@@ -1295,7 +1248,7 @@ PY
1295
1248
  open_view
1296
1249
  filter_to TEAM_ZZZ_MODE
1297
1250
  wait_row zzz-row2 "第二次起的面板仍显示 scratch 新增键" 'TEAM_ZZZ_MODE' \
1298
- || bad "第二次起的面板没有用 scratch CLI(新键不在预算内出现)"
1251
+ || bad "第二次起的面板没有用 scratch CLI(新键没等到(超过等待上限))"
1299
1252
  assert_has "$tmp/$current/zzz-row2.txt" "TEAM_ZZZ_MODE" "第二次起的面板仍用 scratch CLI(新键还在)"
1300
1253
  keys Enter
1301
1254
  wait_editor TEAM_ZZZ_MODE "没有选项集" || bad "去掉 constraints 后没有打开自由输入"
@@ -1335,7 +1288,6 @@ PY
1335
1288
  sleep 0.4
1336
1289
  keys Enter
1337
1290
  if wait_cap confirm "→ 1200"; then ok "第一次 Enter 只给确认行(没写)"; else bad "确认行没有出现(见 confirm.txt)"; fi
1338
- assert_has "$tmp/$current/confirm.txt" "下一个读取它的进程生效" "确认行说明 apply 的时机"
1339
1291
  assert_eq "确认阶段契约未变" "$(sha "$(cfg)")" "$(sha "$tmp/$current/before.cfg")"
1340
1292
  keys Enter
1341
1293
  if wait_cap written "✓ 已写入 TEAM_PULSE_NUDGE_GAP = 1200"; then
@@ -1379,7 +1331,6 @@ PY
1379
1331
  local b1; b1="$(sha "$(cfg)")"
1380
1332
  keys Enter
1381
1333
  if wait_cap invalid "最小 60"; then ok "越界数值的拒绝点名最小 60"; else bad "越界数值的拒绝没出现"; fi
1382
- assert_has "$tmp/$current/invalid.txt" "不合法" "非法值的回执说明被拒"
1383
1334
  assert_eq "非法值契约不变" "$(sha "$(cfg)")" "$b1"
1384
1335
  cap_has "TEAM_PULSE_INTERVAL" draft-kept
1385
1336
  leave_editor TEAM_PULSE_INTERVAL || bad "非法值用例的 esc 发了但编辑器还在"
@@ -1486,8 +1437,8 @@ scn_policy() {
1486
1437
  open_view
1487
1438
  # ① 类别行:未来策略 + 「新任务」徽章 + 命令行点名 set-task-model
1488
1439
  filter_to 类别
1489
- wait_row policy-cat "类别 routine 行(策略模型 + 新任务徽章)" '任务类别(未来策略)' '类别 routine' 'kimi-coding/k3-256k' \
1490
- || bad "类别行没有在预算内出现"
1440
+ wait_row policy-cat "类别 routine 行(策略模型 + 新任务徽章)" '下一次派任务会用的模型' '类别 routine' 'kimi-coding/k3-256k' \
1441
+ || bad "类别行没等到(超过等待上限)"
1491
1442
  # 视图的快照行、命令行提示行都跟着**焦点**走:先把光标移到类别行,再看这一行的两半(M49)。
1492
1443
  if focus_row '› 类别 routine'; then :; else bad "没能把焦点移到类别 routine 行"; fi
1493
1444
  cap_to policy-cat
@@ -1495,19 +1446,34 @@ scn_policy() {
1495
1446
  assert_has "$tmp/$current/policy-cat.txt" "team config set-task-model routine <model>" "命令行点名 set-task-model(唯一写者)"
1496
1447
  # ② 策略 ≠ 实际:dev 的只读行显示**记录**里的模型,行里不出现策略模型
1497
1448
  filter_to dev
1498
- wait_row policy-dev "dev 的只读派单行" '实际派单记录(只读)' 'xai/grok-4.6' \
1499
- || bad "dev 的派单行没有在预算内出现"
1449
+ wait_row policy-dev "dev 的只读派单行" '正在运行的任务实际使用的模型' 'xai/grok-4.6' \
1450
+ || bad "dev 的派单行没等到(超过等待上限)"
1500
1451
  if focus_row '› dev '; then :; else bad "没能把焦点移到 dev 的派单行"; fi
1501
1452
  cap_to policy-dev
1502
- assert_match "$tmp/$current/policy-dev.txt" 'dev +xai/grok-4.6 · 只读' "记录模型逐字显示(不是策略模型)"
1453
+ assert_match "$tmp/$current/policy-dev.txt" 'dev +xai/grok-4.6 · 不可改' "记录模型逐字显示(不是策略模型)"
1503
1454
  assert_not "$tmp/$current/policy-dev.txt" "kimi-coding/k3-256k" "派单行里不出现未来策略的模型"
1504
- assert_has "$tmp/$current/policy-dev.txt" "SID sid-dev-232" "派单行带已提交的 SID"
1505
- assert_has "$tmp/$current/policy-dev.txt" "只读:实际模型来自已提交的派单记录" "命令行说明这是派单决定的只读面"
1455
+ assert_has "$tmp/$current/policy-dev.txt" "会话 sid-dev-232" "派单行带已提交的会话号"
1506
1456
  # ③ 没有记录的席位:不借策略模型
1507
1457
  filter_to verify
1508
- wait_row policy-verify "verify 的「没有完整派单记录」行" 'verify' '没有完整派单记录' \
1509
- || bad "无记录席位行没有在预算内出现"
1458
+ wait_row policy-verify "verify 的「还没有派过任务」行" 'verify' '这个席位还没有派过任务' \
1459
+ || bad "无记录席位行没等到(超过等待上限)"
1510
1460
  assert_not "$tmp/$current/policy-verify.txt" "kimi-coding/k3-256k" "无记录席位行不借未来策略的模型"
1461
+ # ③b P266(设计表的红侧第二格):同一个席位换成一份「存在、但读不出来」的记录(旧格式:版本不是 1)
1462
+ # → 说法换成另一句。面板从读侧的 record_present 事实选措辞(无文件 = 没派过;有文件 = 读不出来),
1463
+ # 不解析诊断字符串。
1464
+ printf 'assignment_version=0\nseat=verify\nmodel=vendor/legacy\n' > "$state/verify.env"
1465
+ reopen_view
1466
+ filter_to verify
1467
+ wait_row policy-unreadable "record_present=true:有记录但读不出来" 'verify' '这个席位派过任务,但它的记录读不出来' \
1468
+ || bad "「读不出来」的席位行没等到(超过等待上限)"
1469
+ assert_not "$tmp/$current/policy-unreadable.txt" "还没有派过任务" "P266:有记录但读不出来时不说「还没派过任务」(两个原因分得开)"
1470
+ assert_not "$tmp/$current/policy-unreadable.txt" "legacy/unknown assignment_version" "P266:命令的诊断字符串不上屏"
1471
+ local pol_json_verify
1472
+ pol_json_verify="$( ( cd "$ROOT" && bash "$skill/scripts/team" config list --json ) \
1473
+ | python3 -c 'import json,sys; d=json.load(sys.stdin); r=[a for a in d["models"]["assignments"] if a["agent"]=="verify"][0]; print("assigned=%s record_present=%s diagnostic=%s" % (r["assigned"], r.get("record_present"), r.get("diagnostic")))' )"
1474
+ assert_eq "P266:读侧把这一行报成 assigned=false 且 record_present=true(诊断只留给机器)" \
1475
+ "$pol_json_verify" "assigned=False record_present=True diagnostic=legacy/unknown assignment_version"
1476
+ rm -f "$state/verify.env"
1511
1477
  # ④ 一次类别直写:picker 用项目自己的词表,写走 set-task-model 的 dry-run → --yes
1512
1478
  filter_to 类别
1513
1479
  sleep 0.5
@@ -1534,8 +1500,7 @@ scn_policy() {
1534
1500
  fi
1535
1501
  cap_to policy-written
1536
1502
  assert_not "$tmp/$current/policy-written.txt" "确认:" "值条目直写没有确认帧"
1537
- assert_has "$tmp/$current/policy-written.txt" "只影响新任务" "回执说明只影响新任务"
1538
- assert_has "$tmp/$current/policy-written.txt" "没有重启任何进程" "回执说明没有进程被重启"
1503
+ assert_has "$tmp/$current/policy-written.txt" "只影响以后派的新任务" "回执说明只影响以后派的新任务"
1539
1504
  argv_since "$pol_argv" "$tmp/$current/policy-argv.log"
1540
1505
  assert_match "$tmp/$current/policy-argv.log" 'config set-task-model routine xai/grok-4.6 --actor panel --dry-run --fingerprint [0-9a-f]{64}' "argv 记录 set-task-model --dry-run"
1541
1506
  assert_match "$tmp/$current/policy-argv.log" 'config set-task-model routine xai/grok-4.6 --actor panel --yes --fingerprint [0-9a-f]{64}' "argv 记录 set-task-model 的写入"
@@ -1602,7 +1567,6 @@ scn_categories() {
1602
1567
  if wait_cap pm-written "已写入 PM 模型"; then ok "PM 编辑落盘"; else bad "PM 的写入回执没有出现"; fi
1603
1568
  cap_to pm-written
1604
1569
  assert_has "$tmp/$current/pm-written.txt" "fresh-pm" "PM 回执点名换模型的 fresh-pm 守卫"
1605
- assert_has "$tmp/$current/pm-written.txt" "没有重启任何进程" "PM 回执说明没有进程被重启"
1606
1570
  assert_match "$(argv_log)" 'config set TEAM_PM_MODEL kimi-coding/k3-256k --actor panel --dry-run --fingerprint [0-9a-f]{64}' "argv 记录 PM 的 --dry-run"
1607
1571
  assert_match "$(argv_log)" 'config set TEAM_PM_MODEL kimi-coding/k3-256k --actor panel --yes --fingerprint [0-9a-f]{64}' "argv 记录 PM 的写入"
1608
1572
  assert_eq "PM 写入审计长一行" "$(audit_lines)" "$((pm_audit + 1))"
@@ -1624,15 +1588,15 @@ scn_categories() {
1624
1588
  || bad "整映射删除 routine 失败"
1625
1589
  reopen_view
1626
1590
  filter_to dev
1627
- wait_row cat-kept "删类别后 dev 的派单行仍在" 'xai/grok-4.6' 'SID sid-dev-232' \
1628
- || bad "删类别后派单行没有在预算内出现"
1629
- assert_match "$tmp/$current/cat-kept.txt" 'dev +xai/grok-4.6 · 只读' "删类别后记录模型仍是记录里的值"
1630
- assert_has "$tmp/$current/cat-kept.txt" "SID sid-dev-232" "删类别后 SID 原样"
1591
+ wait_row cat-kept "删类别后 dev 的派单行仍在" 'xai/grok-4.6' '会话 sid-dev-232' \
1592
+ || bad "删类别后派单行没等到(超过等待上限)"
1593
+ assert_match "$tmp/$current/cat-kept.txt" 'dev +xai/grok-4.6 · 不可改' "删类别后记录模型仍是记录里的值"
1594
+ assert_has "$tmp/$current/cat-kept.txt" "会话 sid-dev-232" "删类别后会话号原样"
1631
1595
  filter_to 类别
1632
1596
  cap_to cat-deleted
1633
1597
  assert_not "$tmp/$current/cat-deleted.txt" "类别 routine" "被删的类别不再有策略行"
1634
1598
  assert_match "$tmp/$current/cat-deleted.txt" '类别 (analysis|verify)' "其余类别照旧在策略块里"
1635
- assert_match "$tmp/$current/cat-deleted.txt" '^│ ── 任务类别(未来策略) ─+' "类别块本身还在(只删了 routine)"
1599
+ assert_match "$tmp/$current/cat-deleted.txt" '^│ ── 下一次派任务会用的模型 ─+' "类别块本身还在(只删了 routine)"
1636
1600
  # ⑥ 无 spawn/重启:整段没有任何 dispatch/resume/restart,窗口集合不变
1637
1601
  argv_since "$scn_argv" "$tmp/$current/categories-argv.log"
1638
1602
  assert_not "$tmp/$current/categories-argv.log" "dispatch" "整个场景没有 dispatch"
@@ -1647,21 +1611,21 @@ scn_categories() {
1647
1611
  open_view
1648
1612
  # 诊断行按 头…尾 换行(不截断路线):命令原文可能跨两行,所以断言的是路线的**词**都在屏幕上
1649
1613
  # (升级命令名 + 它的参数),而不是一整串连续子串。
1650
- wait_row legacy-diagnosis "遗留配置的迁移诊断" '策略迁移诊断' '含退休键' 'upgrade-models' \
1651
- || bad "遗留配置的迁移诊断没有在预算内出现"
1614
+ wait_row legacy-diagnosis "遗留配置的迁移诊断" '旧设置需要升级' '含退休键' 'upgrade-models' \
1615
+ || bad "遗留配置的迁移诊断没等到(超过等待上限)"
1652
1616
  assert_has "$tmp/$current/legacy-diagnosis.txt" "upgrade-models" "诊断给出 CLI 升级命令(命令名可见)"
1653
1617
  assert_has "$tmp/$current/legacy-diagnosis.txt" "--task-models" "诊断给出升级命令的参数(不被截掉)"
1654
1618
  assert_has "$tmp/$current/legacy-diagnosis.txt" "--dry-run" "诊断给出升级命令的预览步骤(不被截掉)"
1655
1619
  assert_has "$tmp/$current/legacy-diagnosis.txt" "TEAM_DEFAULT_MODEL" "诊断点名退休键"
1656
1620
  local legacy_cat_heading
1657
- legacy_cat_heading="$(cap_line_heading "$tmp/$current/legacy-diagnosis.txt" '任务类别(未来策略)')"
1621
+ legacy_cat_heading="$(cap_line_heading "$tmp/$current/legacy-diagnosis.txt" '下一次派任务会用的模型')"
1658
1622
  assert_eq "遗留配置没有可编辑的类别块(没有假的可编辑策略)" "$legacy_cat_heading" "0"
1659
1623
  filter_to TEAM_DEFAULT_MODEL
1660
1624
  # 筛选也匹配行内注释(M49 的既有口径),而 TEAM_PM_MODEL 的初始化注释里就写着 TEAM_DEFAULT_MODEL ——
1661
1625
  # 所以这里必须先把光标走到退休键那一行,否则回车打到的是 PM 行(第一遍就是这么红的)。
1662
1626
  if focus_row '› TEAM_DEFAULT_MODEL'; then :; else bad "没能把焦点移到退休键行"; fi
1663
1627
  cap_to legacy-key
1664
- assert_match "$tmp/$current/legacy-key.txt" 'TEAM_DEFAULT_MODEL +.*未知键' "退休键变成只读的未知键行(没有席位默认编辑器)"
1628
+ assert_match "$tmp/$current/legacy-key.txt" 'TEAM_DEFAULT_MODEL +.*不认识' "退休键变成只读的未知键行(没有席位默认编辑器)"
1665
1629
  keys Enter
1666
1630
  if wait_cap legacy-route "不是已知的项目设置"; then ok "退休键的回执点名它不在 schema 里(不给编辑)"; else bad "退休键的回执没有出现"; fi
1667
1631
  cap_to legacy-route
@@ -1751,6 +1715,29 @@ scn_readonly() {
1751
1715
  fi
1752
1716
  # The only `team` invocations the wrapper logged are reads (the block readers).
1753
1717
  assert_not "$(argv_log)" "config set" "wrapper 里没有 config set(这一轮没有写动作)"
1718
+
1719
+ # ── P318(D-3):未绑定键扫一遍 ───────────────────────────────────────────────────────────────
1720
+ # 键打完之后**除控制台自己的三个文件之外**零写入;再加一条正向对照,证明这个签名不是恒真。
1721
+ local sweep_before sweep_after
1722
+ sweep_before="$(sweep_manifest)"
1723
+ sweep_keys
1724
+ sleep 0.6
1725
+ sweep_after="$(sweep_manifest)"
1726
+ if [ "$sweep_after" = "$sweep_before" ]; then
1727
+ ok "未绑定键扫一遍:除控制台自己的三个文件外,state / docs / 契约零改动"
1728
+ else
1729
+ bad "未绑定键扫一遍:控制台动了别人的文件:$(diff <(printf '%s\n' "$sweep_before") <(printf '%s\n' "$sweep_after") | sed -n 's/^[<>] //p' | awk '{print $1}' | sort -u | tr '\n' ' ')"
1730
+ fi
1731
+ # 正向对照(与 D-2 同一口径:仪器不许静默瞎掉):在允许集之外造一次写入,同一个 sweep_manifest 必须看见。
1732
+ : > "$state/zz-p318-probe"
1733
+ assert_eq "正向对照:sweep_manifest 看得见允许集之外的写入" \
1734
+ "$([ "$(sweep_manifest)" = "$sweep_before" ] && echo blind || echo sees)" "sees"
1735
+ rm -f "$state/zz-p318-probe"
1736
+ if pty_wait_frame "$tmp/$current/readonly-sweep.txt" "未绑定键之后控制台还在" 'teamsmith pulse'; then
1737
+ ok "未绑定键扫一遍之后控制台仍是活的(帧还在画)"
1738
+ else
1739
+ bad "未绑定键扫一遍之后控制台不在了(某个键被当成了动作)"
1740
+ fi
1754
1741
  }
1755
1742
 
1756
1743
  # ---------------------------------------------------------------- P30(settings-view-groups)
@@ -1843,11 +1830,18 @@ foot = next((i for i, l in enumerate(lines) if i > bot and ('\u5199\u4fe1' in l
1843
1830
  if top < 0 or bot < 0 or foot < 0:
1844
1831
  print('-1 -1 -1 -1'); sys.exit(0)
1845
1832
  interior = lines[top + 1:bot]
1846
- audit = next((i for i, l in enumerate(interior) if '\u5ba1\u8ba1\uff08\u6700\u8fd1\uff09' in l or 'Audit' in l), -1)
1847
- if audit < 3:
1833
+ # P266:尾部只剩聚焦行的 CLI 提示行(有迁移诊断时还有它那一块)——不再有审计块。内容的最后一条
1834
+ # 非空行就是提示行(或诊断的最后一行);诊断存在时,尾部从诊断标题那一行开始(提示行在它上面,也
1835
+ # 属于尾部)。
1836
+ content = [i for i, l in enumerate(interior) if l.strip('\u2502 ').rstrip()]
1837
+ if not content:
1848
1838
  print('-1 -1 -1 -1'); sys.exit(0)
1849
- # 尾部固定占位:CLI 提示行、空行、审计标题(audit-2 起),所以行只可能在 audit-2 之前。
1850
- tail_start = audit - 2
1839
+ diag = next((i for i, l in enumerate(interior) if '\u65e7\u8bbe\u7f6e\u9700\u8981\u5347\u7ea7' in l or 'need an upgrade' in l), -1)
1840
+ if diag >= 0:
1841
+ above = [i for i in content if i < diag]
1842
+ tail_start = above[-1] if above else diag
1843
+ else:
1844
+ tail_start = content[-1]
1851
1845
  rows = up = down = 0
1852
1846
  for i, l in enumerate(interior):
1853
1847
  b = l.strip('\u2502 ').rstrip()
@@ -1953,7 +1947,9 @@ walk_to_tail() { # <capture name>
1953
1947
  for i in $(seq 1 140); do keys Down; sleep 0.01; done
1954
1948
  for i in $(seq 1 12); do
1955
1949
  cap_to "$name"
1956
- if grep -q '任务类别' "$tmp/$current/$name.txt" && grep -q '›' "$tmp/$current/$name.txt"; then hit=1; break; fi
1950
+ # P266:类别块的标题改成普通话(两种语言各一条)——尾部的“到了”判据跟着标题走。
1951
+ if { grep -q '下一次派任务会用的模型' "$tmp/$current/$name.txt" || grep -q 'The model the next task will use' "$tmp/$current/$name.txt"; } \
1952
+ && grep -q '›' "$tmp/$current/$name.txt"; then hit=1; break; fi
1957
1953
  sleep 0.4 # 块被 TTL 重读换成摘要行(已知现象)→ 等它回来,必要时再走一轮
1958
1954
  done
1959
1955
  [ "$hit" = 1 ] && break
@@ -1979,7 +1975,6 @@ scn_groups() {
1979
1975
  assert_has "$tmp/$current/view.txt" "身份与账本布局" "第一组标题是 identity 的功能域名"
1980
1976
  # P32(用户的第一条反馈):标题与选项行必须在渲染上可区分。标题是分节线(── 标题 ────),
1981
1977
  # 键行不带分节线;标题行同时把两组隔开(上一行=上一组最后一条,下一行=本组第一条)。
1982
- assert_match "$tmp/$current/view.txt" '^│ ── 身份与账本布局 ─+' "分组标题是分节线(不是缩进的普通行)"
1983
1978
  assert_no_match "$tmp/$current/view.txt" '^│ [› ] 项目名.*─' "键行不带分节线(标题/行在渲染上可区分)"
1984
1979
  assert_heading_rule "$tmp/$current/view.txt" "分支与 forge" "契约文件" "分支命名模式" "组间可见分隔:标题是分节线且夹在两组之间"
1985
1980
  # 读取顺序:identity 的 12 条走完,下一组标题就是 branch(窗口跟着焦点,标题只在它的行进窗时画)。
@@ -2006,43 +2001,41 @@ scn_groups() {
2006
2001
  # ③ 类徽章是词 + tone(D4):三类各过滤一行;词在,tone = 调色板里该类的 tone,值必须是 text tone。
2007
2002
  filter_to TEAM_MODEL_LIMITS
2008
2003
  wait_row tone-apply "apply 徽章行" '模型并发上限' '立即生效' \
2009
- || bad "apply 行没有在预算内出现"
2004
+ || bad "apply 行没等到(超过等待上限)"
2010
2005
  cap_e_to tone-apply-e
2011
2006
  assert_match "$tmp/$current/tone-apply.txt" '模型并发上限 +.*立即生效' "apply 行的徽章词仍在(颜色不是唯一通道)"
2012
2007
  assert_badge_tone "$tmp/$current/tone-apply-e.txt" '模型并发上限' '立即生效' 'text' "apply 徽章 = 普通文本 tone"
2013
2008
  filter_to TEAM_PULSE_INTERVAL
2014
2009
  wait_row tone-restart "restart 徽章行" '巡检周期' '需重启' \
2015
- || bad "restart 行没有在预算内出现"
2010
+ || bad "restart 行没等到(超过等待上限)"
2016
2011
  cap_e_to tone-restart-e
2017
2012
  assert_match "$tmp/$current/tone-restart.txt" '巡检周期 +.*需重启' "restart 行的徽章词仍在"
2018
2013
  assert_badge_tone "$tmp/$current/tone-restart-e.txt" '巡检周期' '需重启' 'warn' "restart 徽章 = warn tone"
2019
2014
  filter_to TEAM_PROJECT
2020
- wait_row tone-refuse "refuse 徽章行" '项目名' 'root · 只读' \
2021
- || bad "refuse 行没有在预算内出现"
2015
+ wait_row tone-refuse "refuse 徽章行" '项目名' 'root · 不可改' \
2016
+ || bad "refuse 行没等到(超过等待上限)"
2022
2017
  cap_e_to tone-refuse-e
2023
- assert_match "$tmp/$current/tone-refuse.txt" '项目名 +root · 只读' "refuse 行的徽章词仍在"
2024
- assert_badge_tone "$tmp/$current/tone-refuse-e.txt" '项目名' '只读' 'dim' "refuse 徽章 = dim tone"
2018
+ assert_match "$tmp/$current/tone-refuse.txt" '项目名 +root · 不可改' "refuse 行的徽章词仍在"
2019
+ assert_badge_tone "$tmp/$current/tone-refuse-e.txt" '项目名' '不可改' 'dim' "refuse 徽章 = dim tone"
2025
2020
  # ④ 可见降级:schema 不认识的键落在「未分组」,且「未分组」在席位块之前(走到列表末尾看)。
2026
2021
  filter_to TEAM_HAND_ADDED
2027
- wait_row hand-added "未分组里的手加未知键行" 'TEAM_HAND_ADDED' 'hand · 未知键' \
2028
- || bad "未知键的行没有在预算内出现"
2029
- assert_match "$tmp/$current/hand-added.txt" 'TEAM_HAND_ADDED +hand · 未知键' "未知键的行仍在(没有消失)"
2030
- assert_has "$tmp/$current/hand-added.txt" "未知键:TEAM_HAND_ADDED" "未知键仍按原始键点名"
2022
+ wait_row hand-added "未分组里的手加未知键行" 'TEAM_HAND_ADDED' 'hand · 不认识' \
2023
+ || bad "未知键的行没等到(超过等待上限)"
2024
+ assert_match "$tmp/$current/hand-added.txt" 'TEAM_HAND_ADDED +hand · 不认识' "未知键的行仍在(没有消失)"
2025
+ assert_has "$tmp/$current/hand-added.txt" "TEAM_HAND_ADDED:这个设置在文件里" "未知键仍按原始键点名"
2031
2026
  [ "$(cap_line_heading "$tmp/$current/hand-added.txt" '未分组')" -gt 0 ] \
2032
2027
  && ok "未知键落在可见的「未分组」标题下" || bad "未知键没有落在「未分组」标题下"
2033
- assert_match "$tmp/$current/hand-added.txt" '^│ ── 未分组 ─+' "降级组标题也是同一种分节线(标题体系一致)"
2034
2028
  filter_clear
2035
2029
  sleep 0.4
2036
2030
  walk_to_tail tail
2037
2031
  local n_ungrouped n_categories
2038
2032
  n_ungrouped="$(cap_line_heading "$tmp/$current/tail.txt" '未分组')"
2039
- n_categories="$(cap_line_heading "$tmp/$current/tail.txt" '任务类别')"
2033
+ n_categories="$(cap_line_heading "$tmp/$current/tail.txt" '下一次派任务会用的模型')"
2040
2034
  if [ "$n_ungrouped" -gt 0 ] && [ "$n_categories" -gt 0 ] && [ "$n_ungrouped" -lt "$n_categories" ]; then
2041
2035
  ok "「未分组」在类别块之前(未分组=$n_ungrouped < 任务类别=$n_categories)"
2042
2036
  else
2043
2037
  bad "尾部顺序不对(未分组=$n_ungrouped 任务类别=$n_categories)"
2044
2038
  fi
2045
- assert_match "$tmp/$current/tail.txt" '^│ ── 任务类别(未来策略) ─+' "类别块标题也是同一种分节线(标题体系一致)"
2046
2039
  # ⑤ 无键→域表:scratch CLI 让 TEAM_ZZZ_TEST 带 workflow、把 TEAM_GATES 移到 meeting;
2047
2040
  # 提交的那份 bundle 必须跟着两个标题走(bundle 里没有第二张键表/组表)。
2048
2041
  local scratch="$tmp/$current/scratch"
@@ -2073,12 +2066,12 @@ EOF2
2073
2066
  open_view
2074
2067
  filter_to TEAM_ZZZ_TEST
2075
2068
  wait_row zzz-group "scratch 新增键落在 workflow 域标题下" '工作流与门禁' 'TEAM_ZZZ_TEST' \
2076
- || bad "新键的域标题/行没有在预算内出现"
2069
+ || bad "新键的域标题/行没等到(超过等待上限)"
2077
2070
  assert_has "$tmp/$current/zzz-group.txt" "工作流与门禁" "schema 新增键落在它声明的 workflow 域下(bundle 未重建)"
2078
2071
  assert_match "$tmp/$current/zzz-group.txt" 'TEAM_ZZZ_TEST +未设 · 默认 zzz-default' "新键的行完整(值/默认来自 schema)"
2079
2072
  filter_to TEAM_GATES
2080
2073
  wait_row gates-moved "TEAM_GATES 跟到 meeting 域标题下" '跨项目会议' '门禁命令' \
2081
- || bad "TEAM_GATES 的新域标题/行没有在预算内出现"
2074
+ || bad "TEAM_GATES 的新域标题/行没等到(超过等待上限)"
2082
2075
  assert_has "$tmp/$current/gates-moved.txt" "跨项目会议" "TEAM_GATES 的 token 改成 meeting 后跟到新标题下(bundle 里没有键→域表)"
2083
2076
  assert_match "$tmp/$current/gates-moved.txt" '门禁命令 +true · 立即生效' "同一行仍按 schema 渲染(标签/值/徽章)"
2084
2077
  assert_eq "三次运行之间 bundle 逐字节不变" "$(sha "$panel")" "$bundle_sha"
@@ -2097,7 +2090,7 @@ PY
2097
2090
  open_view
2098
2091
  filter_to TEAM_GATES
2099
2092
  wait_row gates-fallback "畸形 schema 行落在「未分组」里" '未分组' '门禁命令' \
2100
- || bad "降级组的行没有在预算内出现"
2093
+ || bad "降级组的行没等到(超过等待上限)"
2101
2094
  unset P21_CLI
2102
2095
  assert_has "$tmp/$current/gates-fallback.txt" "未分组" "第 10 列缺失的 schema 行落在可见的降级组里(不消失)"
2103
2096
  assert_match "$tmp/$current/gates-fallback.txt" '门禁命令 +true · 立即生效' "降级组里的行仍完整(标签/值/徽章)"
@@ -2110,7 +2103,7 @@ PY
2110
2103
  assert_has "$tmp/$current/tail-scratch.txt" "门禁命令" "降级组里畸形行同屏(schema 行可见)"
2111
2104
  local n_u n_s
2112
2105
  n_u="$(cap_line_heading "$tmp/$current/tail-scratch.txt" '未分组')"
2113
- n_s="$(cap_line_heading "$tmp/$current/tail-scratch.txt" '任务类别')"
2106
+ n_s="$(cap_line_heading "$tmp/$current/tail-scratch.txt" '下一次派任务会用的模型')"
2114
2107
  if [ "$n_u" -gt 0 ] && [ "$n_s" -gt 0 ] && [ "$n_u" -lt "$n_s" ]; then
2115
2108
  ok "scratch 尾部:「未分组」仍在类别块之前($n_u < $n_s)"
2116
2109
  else
@@ -2144,7 +2137,7 @@ PY
2144
2137
  # ② 视图里的滚轮:一格一行、焦点不动、顶部计数行跟随(先下滚 3 格,再上滚回顶部)。
2145
2138
  open_view
2146
2139
  cap_to wheel-before
2147
- assert_match "$tmp/$current/wheel-before.txt" '› 项目名 +.*只读' "视图开屏焦点在第一行(identity 第一条)"
2140
+ assert_match "$tmp/$current/wheel-before.txt" '› 项目名 +.*不可改' "视图开屏焦点在第一行(identity 第一条)"
2148
2141
  wheel_at down 20 10 3
2149
2142
  local i
2150
2143
  for i in $(seq 1 20); do
@@ -2155,7 +2148,8 @@ PY
2155
2148
  assert_match "$tmp/$current/wheel-down.txt" '↑3' "下滚 3 格:顶部计数行读出 ↑3(窗口正好移 3 行)"
2156
2149
  assert_not "$tmp/$current/wheel-down.txt" "项目名" "下滚 3 格:原本第一行(项目名)已出窗"
2157
2150
  assert_has "$tmp/$current/wheel-down.txt" "名册" "下滚 3 格:后面的行进窗(窗口第一行 = 第 4 条)"
2158
- assert_has "$tmp/$current/wheel-down.txt" "只读:手改 .pi/team/config.sh 里的 TEAM_PROJECT" "下滚 3 格:焦点没动(命令行仍点名 TEAM_PROJECT)"
2151
+ assert_no_match "$tmp/$current/wheel-down.txt" '›' "下滚 3 格:焦点没动(光标落在已出窗的项目名上,窗口里没有光标行)"
2152
+ assert_has "$tmp/$current/wheel-down.txt" "这个值要改项目配置文件 .pi/team/config.sh,界面不能改" "下滚 3 格:命令行提示仍在"
2159
2153
  wheel_at up 20 10 3
2160
2154
  for i in $(seq 1 20); do
2161
2155
  cap_to wheel-up
@@ -2177,7 +2171,7 @@ PY
2177
2171
  || bad "↓ 之后窗口没有被推到聚焦行上"
2178
2172
  assert_match "$tmp/$current/wheel-push.txt" '↑1' "↓ 之后窗口被推到聚焦行上(顶部计数行 = ↑1)"
2179
2173
  assert_match "$tmp/$current/wheel-push.txt" '› 会话名' "光标落在下一条(会话名)"
2180
- assert_has "$tmp/$current/wheel-push.txt" "只读:手改 .pi/team/config.sh 里的 TEAM_SESSION" "命令行与光标同一行(焦点在会话名上)"
2174
+ assert_has "$tmp/$current/wheel-push.txt" "这个值要改项目配置文件 .pi/team/config.sh,界面不能改" "命令行提示与光标同一屏(焦点在会话名上)"
2181
2175
  keys Up
2182
2176
  # `↑` 计数行消失(字面 needle:`!↑1` = 刚才那条 ↑1 不再在屏幕上;pty-wait 是 grep -F,不吃正则,
2183
2177
  # 所以不能用原断言的 `↑[0-9]+`;下面的 assert_no_match 仍守住正则面)。
@@ -2186,8 +2180,8 @@ PY
2186
2180
  assert_match "$tmp/$current/wheel-push-back.txt" '› 项目名' "↑ 之后光标回到第一条"
2187
2181
  assert_no_match "$tmp/$current/wheel-push-back.txt" '↑[0-9]+' "窗口跟着回到顶部(计数行消失)"
2188
2182
  keys Enter
2189
- if wait_cap wheel-enter "只读:手改 .pi/team/config.sh 里的 TEAM_PROJECT"; then
2190
- ok "enter 打开的行 = 命令行点名的行(TEAM_PROJECT 的只读路线)"
2183
+ if wait_cap wheel-enter "只能改项目配置文件 .pi/team/config.sh 里的这一行"; then
2184
+ ok "enter 打开的行 = 回执点名的那一行(项目名的只读路线)"
2191
2185
  else
2192
2186
  bad "enter 之后没有出现聚焦行的路线回执"
2193
2187
  fi
@@ -2261,15 +2255,9 @@ PY
2261
2255
  printf '\033[1m== panel-p21 · 项目设置视图(P22) ==\033[0m\n'
2262
2256
  for s in "${SECTIONS[@]}"; do
2263
2257
  mkdir -p "$tmp/$s"
2264
- # P48:每个场景在自己的子 shell 里跑。等待耗尽且归因于机器时 pty_on_skip 直接 exit 4,只结束
2265
- # 这个场景(后面的场景照跑);父 shell 的 EXIT 清扫有自己的 BASHPID 守卫,不会被重复触发。
2258
+ # 每个场景在自己的子 shell 里跑(父 shell 的 EXIT 清扫有自己的 BASHPID 守卫,不会被重复触发)。
2266
2259
  (
2267
2260
  trap - EXIT INT TERM
2268
- p21_premise_line "$s" # 前提行:每个场景第一个断言之前(真读数;只打不判)
2269
- if ! p21_entry_guard; then # 粗闸门:超顶就在第一个等待之前停下这个场景
2270
- p21_entry_skip_line "$s"
2271
- exit 4
2272
- fi
2273
2261
  case "$s" in
2274
2262
  settings) scn_settings ;;
2275
2263
  groups) scn_groups ;;
@@ -2288,15 +2276,13 @@ for s in "${SECTIONS[@]}"; do
2288
2276
  rc=$?
2289
2277
  case "$rc" in
2290
2278
  0) ;;
2291
- 3) exit 3 ;; # 搭建失败(server_up/未知场景)照旧
2292
- 4) SKIP=$((SKIP + 1)) ;; # 可见 SKIP:无失败、无结论
2279
+ 3) exit 3 ;; # 搭建失败(server_up/未知场景)
2293
2280
  *) ;; # 1 = 断言失败,最后按 FAIL 退出
2294
2281
  esac
2295
2282
  done
2296
2283
 
2297
2284
  PASS="$(p21_count_of "$_p21_count/ok")"
2298
2285
  FAIL="$(p21_count_of "$_p21_count/bad")"
2299
- printf '\n\033[1m== 结果 ==\033[0m ✓ %s ✗ %s SKIP %s\n' "$PASS" "$FAIL" "$SKIP"
2286
+ printf '\n\033[1m== 结果 ==\033[0m ✓ %s ✗ %s\n' "$PASS" "$FAIL"
2300
2287
  [ "$FAIL" -gt 0 ] && exit 1
2301
- [ "$SKIP" -gt 0 ] && exit 4
2302
2288
  exit 0