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
|
@@ -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
|
-
#
|
|
18
|
-
#
|
|
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
|
-
#
|
|
64
|
-
|
|
65
|
-
#
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
#
|
|
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
|
|
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
|
|
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
|
-
# 标记 +
|
|
202
|
+
# 标记 + 轮数)。捕获仍写到 $tmp/$current/<name>.txt 供断言复用。
|
|
344
203
|
wait_row() { # <name> <label> <needle...>
|
|
345
204
|
local _name="$1" _label="$2"; shift 2
|
|
346
|
-
local
|
|
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
|
|
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 "
|
|
299
|
+
bad "项目设置视图没等到(超过等待上限)数据(marker=$marker)"
|
|
412
300
|
return 1
|
|
413
301
|
}
|
|
414
302
|
|
|
@@ -797,7 +685,7 @@ EOF2
|
|
|
797
685
|
filter_to TEAM_ZZZ_TEST
|
|
798
686
|
# P68:等那一行(值也在)出现在稳定帧上,不用固定 sleep 采样。
|
|
799
687
|
wait_row scratch-key "scratch 视图里的 TEAM_ZZZ_TEST 行" 'TEAM_ZZZ_TEST' '未设 · 默认 zzz-default' \
|
|
800
|
-
|| bad "scratch CLI
|
|
688
|
+
|| bad "scratch CLI 新增的键行没等到(超过等待上限)"
|
|
801
689
|
assert_match "$tmp/$current/scratch-key.txt" 'TEAM_ZZZ_TEST +未设 · 默认 zzz-default' "scratch CLI 新增的键出现在视图里(不重建 panel.js;无标签→回退裸键)"
|
|
802
690
|
# P266(设计表 248):同一张 scratch schema 里再添一行**带标记**的新键 → 它不进渲染(隐藏规则读标记,
|
|
803
691
|
# 不是 bundle 里写死的四个键名;这一行是 fixture 里从没出现过的名字)。
|
|
@@ -807,7 +695,7 @@ EOF2
|
|
|
807
695
|
filter_clear
|
|
808
696
|
filter_to TEAM_GATES
|
|
809
697
|
wait_row scratch-class "scratch 视图里的 TEAM_GATES 行(类改成不可改)" '门禁命令' 'true · 不可改' \
|
|
810
|
-
|| bad "scratch CLI
|
|
698
|
+
|| bad "scratch CLI 改过的类行没等到(超过等待上限)"
|
|
811
699
|
assert_match "$tmp/$current/scratch-class.txt" '门禁命令 +true · 不可改' "scratch CLI 改过的类跟着变(bundle 没有第二张键表)"
|
|
812
700
|
assert_has "$tmp/$current/scratch-class.txt" "这个值要改项目配置文件 .pi/team/config.sh" "scratch CLI 的 refuse 提示行仍是那句普通路线"
|
|
813
701
|
if focus_row '门禁命令 +true · 不可改'; then keys Enter; else bad "P266:没能把焦点移到 scratch 的 refuse 行"; fi
|
|
@@ -946,7 +834,7 @@ JSON
|
|
|
946
834
|
filter_to TEAM_NOTIFY_TMUX
|
|
947
835
|
# P68:断言那一行本身之前先等数据态(未设 bool 行 + 它的默认值)落定。
|
|
948
836
|
wait_row bool-row "未设 bool 行显示「未设 · 默认 1」" '走 tmux 投递' '未设 · 默认 1' \
|
|
949
|
-
|| bad "未设的 bool
|
|
837
|
+
|| bad "未设的 bool 行没等到显示默认值"
|
|
950
838
|
assert_match "$tmp/$current/bool-row.txt" '走 tmux 投递 +未设 · 默认 1' "未设的 bool 行显示 未设 · 默认 1"
|
|
951
839
|
gap0="$(argv_count)"
|
|
952
840
|
keys Enter
|
|
@@ -991,7 +879,7 @@ JSON
|
|
|
991
879
|
# P68:等那一行真的显示刚写下的规范值(accept 后的 settle 重读落定),再按 Enter ——
|
|
992
880
|
# 选择器是一次成形的快照(D43),不等读就会从旧块开(CI 那三条红就是这个形状)。
|
|
993
881
|
wait_row bool-set-row "写入后的 bool 行显示新值 0" '走 tmux 投递' '0 · 立即生效' \
|
|
994
|
-
|| bad "
|
|
882
|
+
|| bad "写入后的设置行没等到显示新值"
|
|
995
883
|
keys Enter
|
|
996
884
|
wait_picker TEAM_NOTIFY_TMUX '关(0) · 当前' || bad "bool 选择器第二次没有打开"
|
|
997
885
|
cap_to bool-set
|
|
@@ -1012,9 +900,9 @@ PY2
|
|
|
1012
900
|
filter_to TEAM_NOTIFY_TMUX
|
|
1013
901
|
# P68(本变更的主目标):等那一行**本身**显示手改后的值(视图打开时那次强制读落定)再按 Enter。
|
|
1014
902
|
# 等待名把被等的状态写清楚;耗尽时引擎打一行 `等待超时:数据态:…(缺 [走 tmux 投递 true · 立即生效])`,
|
|
1015
|
-
#
|
|
903
|
+
# 骨架标记(分组标题)与固定 sleep 都不再是证据。
|
|
1016
904
|
wait_row bool-spelling-row "设置行显示手改后的值 true" '走 tmux 投递' 'true · 立即生效' \
|
|
1017
|
-
|| bad "
|
|
905
|
+
|| bad "手改后的设置行没等到显示新值"
|
|
1018
906
|
keys Enter
|
|
1019
907
|
wait_picker TEAM_NOTIFY_TMUX 'true · 当前' || bad "非规范 bool 的选择器没有打开"
|
|
1020
908
|
cap_to bool-spelling
|
|
@@ -1049,7 +937,7 @@ PY2
|
|
|
1049
937
|
# ── (3) 未设键:编辑器开在「保持未设」上,接受 = 取消(不写、不留审计、不留临时文件);再接受 300 = 直写 ──
|
|
1050
938
|
filter_to TEAM_DEFER_TTL
|
|
1051
939
|
wait_row defer-row "未设 seconds 行显示「未设 · 默认 300」" '排队过期时间' '未设 · 默认 300' \
|
|
1052
|
-
|| bad "
|
|
940
|
+
|| bad "未设键的行没等到显示默认值"
|
|
1053
941
|
assert_match "$tmp/$current/defer-row.txt" '排队过期时间 +未设 · 默认 300' "未设键的行显示 未设 · 默认 300"
|
|
1054
942
|
local defer_sha defer_audit
|
|
1055
943
|
defer_sha="$(sha "$(cfg)")"; defer_audit="$(audit_lines)"
|
|
@@ -1333,7 +1221,7 @@ EOF2
|
|
|
1333
1221
|
open_view
|
|
1334
1222
|
filter_to TEAM_ZZZ_MODE
|
|
1335
1223
|
wait_row zzz-row "scratch 新增 enum 键的行(裸键 + red 默认)" 'TEAM_ZZZ_MODE' '未设 · 默认 red' \
|
|
1336
|
-
|| bad "scratch CLI 新增的 enum
|
|
1224
|
+
|| bad "scratch CLI 新增的 enum 键行没等到(超过等待上限)"
|
|
1337
1225
|
assert_has "$tmp/$current/zzz-row.txt" "TEAM_ZZZ_MODE" "scratch CLI 新增的 enum 键出现在视图里(无标签→回退裸键)"
|
|
1338
1226
|
assert_has "$tmp/$current/zzz-row.txt" "未设 · 默认 red" "新键的默认值来自 schema"
|
|
1339
1227
|
keys Enter
|
|
@@ -1360,7 +1248,7 @@ PY
|
|
|
1360
1248
|
open_view
|
|
1361
1249
|
filter_to TEAM_ZZZ_MODE
|
|
1362
1250
|
wait_row zzz-row2 "第二次起的面板仍显示 scratch 新增键" 'TEAM_ZZZ_MODE' \
|
|
1363
|
-
|| bad "第二次起的面板没有用 scratch CLI
|
|
1251
|
+
|| bad "第二次起的面板没有用 scratch CLI(新键没等到(超过等待上限))"
|
|
1364
1252
|
assert_has "$tmp/$current/zzz-row2.txt" "TEAM_ZZZ_MODE" "第二次起的面板仍用 scratch CLI(新键还在)"
|
|
1365
1253
|
keys Enter
|
|
1366
1254
|
wait_editor TEAM_ZZZ_MODE "没有选项集" || bad "去掉 constraints 后没有打开自由输入"
|
|
@@ -1550,7 +1438,7 @@ scn_policy() {
|
|
|
1550
1438
|
# ① 类别行:未来策略 + 「新任务」徽章 + 命令行点名 set-task-model
|
|
1551
1439
|
filter_to 类别
|
|
1552
1440
|
wait_row policy-cat "类别 routine 行(策略模型 + 新任务徽章)" '下一次派任务会用的模型' '类别 routine' 'kimi-coding/k3-256k' \
|
|
1553
|
-
|| bad "
|
|
1441
|
+
|| bad "类别行没等到(超过等待上限)"
|
|
1554
1442
|
# 视图的快照行、命令行提示行都跟着**焦点**走:先把光标移到类别行,再看这一行的两半(M49)。
|
|
1555
1443
|
if focus_row '› 类别 routine'; then :; else bad "没能把焦点移到类别 routine 行"; fi
|
|
1556
1444
|
cap_to policy-cat
|
|
@@ -1559,7 +1447,7 @@ scn_policy() {
|
|
|
1559
1447
|
# ② 策略 ≠ 实际:dev 的只读行显示**记录**里的模型,行里不出现策略模型
|
|
1560
1448
|
filter_to dev
|
|
1561
1449
|
wait_row policy-dev "dev 的只读派单行" '正在运行的任务实际使用的模型' 'xai/grok-4.6' \
|
|
1562
|
-
|| bad "dev
|
|
1450
|
+
|| bad "dev 的派单行没等到(超过等待上限)"
|
|
1563
1451
|
if focus_row '› dev '; then :; else bad "没能把焦点移到 dev 的派单行"; fi
|
|
1564
1452
|
cap_to policy-dev
|
|
1565
1453
|
assert_match "$tmp/$current/policy-dev.txt" 'dev +xai/grok-4.6 · 不可改' "记录模型逐字显示(不是策略模型)"
|
|
@@ -1568,7 +1456,7 @@ scn_policy() {
|
|
|
1568
1456
|
# ③ 没有记录的席位:不借策略模型
|
|
1569
1457
|
filter_to verify
|
|
1570
1458
|
wait_row policy-verify "verify 的「还没有派过任务」行" 'verify' '这个席位还没有派过任务' \
|
|
1571
|
-
|| bad "
|
|
1459
|
+
|| bad "无记录席位行没等到(超过等待上限)"
|
|
1572
1460
|
assert_not "$tmp/$current/policy-verify.txt" "kimi-coding/k3-256k" "无记录席位行不借未来策略的模型"
|
|
1573
1461
|
# ③b P266(设计表的红侧第二格):同一个席位换成一份「存在、但读不出来」的记录(旧格式:版本不是 1)
|
|
1574
1462
|
# → 说法换成另一句。面板从读侧的 record_present 事实选措辞(无文件 = 没派过;有文件 = 读不出来),
|
|
@@ -1577,7 +1465,7 @@ scn_policy() {
|
|
|
1577
1465
|
reopen_view
|
|
1578
1466
|
filter_to verify
|
|
1579
1467
|
wait_row policy-unreadable "record_present=true:有记录但读不出来" 'verify' '这个席位派过任务,但它的记录读不出来' \
|
|
1580
|
-
|| bad "
|
|
1468
|
+
|| bad "「读不出来」的席位行没等到(超过等待上限)"
|
|
1581
1469
|
assert_not "$tmp/$current/policy-unreadable.txt" "还没有派过任务" "P266:有记录但读不出来时不说「还没派过任务」(两个原因分得开)"
|
|
1582
1470
|
assert_not "$tmp/$current/policy-unreadable.txt" "legacy/unknown assignment_version" "P266:命令的诊断字符串不上屏"
|
|
1583
1471
|
local pol_json_verify
|
|
@@ -1701,7 +1589,7 @@ scn_categories() {
|
|
|
1701
1589
|
reopen_view
|
|
1702
1590
|
filter_to dev
|
|
1703
1591
|
wait_row cat-kept "删类别后 dev 的派单行仍在" 'xai/grok-4.6' '会话 sid-dev-232' \
|
|
1704
|
-
|| bad "
|
|
1592
|
+
|| bad "删类别后派单行没等到(超过等待上限)"
|
|
1705
1593
|
assert_match "$tmp/$current/cat-kept.txt" 'dev +xai/grok-4.6 · 不可改' "删类别后记录模型仍是记录里的值"
|
|
1706
1594
|
assert_has "$tmp/$current/cat-kept.txt" "会话 sid-dev-232" "删类别后会话号原样"
|
|
1707
1595
|
filter_to 类别
|
|
@@ -1724,7 +1612,7 @@ scn_categories() {
|
|
|
1724
1612
|
# 诊断行按 头…尾 换行(不截断路线):命令原文可能跨两行,所以断言的是路线的**词**都在屏幕上
|
|
1725
1613
|
# (升级命令名 + 它的参数),而不是一整串连续子串。
|
|
1726
1614
|
wait_row legacy-diagnosis "遗留配置的迁移诊断" '旧设置需要升级' '含退休键' 'upgrade-models' \
|
|
1727
|
-
|| bad "
|
|
1615
|
+
|| bad "遗留配置的迁移诊断没等到(超过等待上限)"
|
|
1728
1616
|
assert_has "$tmp/$current/legacy-diagnosis.txt" "upgrade-models" "诊断给出 CLI 升级命令(命令名可见)"
|
|
1729
1617
|
assert_has "$tmp/$current/legacy-diagnosis.txt" "--task-models" "诊断给出升级命令的参数(不被截掉)"
|
|
1730
1618
|
assert_has "$tmp/$current/legacy-diagnosis.txt" "--dry-run" "诊断给出升级命令的预览步骤(不被截掉)"
|
|
@@ -1827,6 +1715,29 @@ scn_readonly() {
|
|
|
1827
1715
|
fi
|
|
1828
1716
|
# The only `team` invocations the wrapper logged are reads (the block readers).
|
|
1829
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
|
|
1830
1741
|
}
|
|
1831
1742
|
|
|
1832
1743
|
# ---------------------------------------------------------------- P30(settings-view-groups)
|
|
@@ -2090,26 +2001,26 @@ scn_groups() {
|
|
|
2090
2001
|
# ③ 类徽章是词 + tone(D4):三类各过滤一行;词在,tone = 调色板里该类的 tone,值必须是 text tone。
|
|
2091
2002
|
filter_to TEAM_MODEL_LIMITS
|
|
2092
2003
|
wait_row tone-apply "apply 徽章行" '模型并发上限' '立即生效' \
|
|
2093
|
-
|| bad "apply
|
|
2004
|
+
|| bad "apply 行没等到(超过等待上限)"
|
|
2094
2005
|
cap_e_to tone-apply-e
|
|
2095
2006
|
assert_match "$tmp/$current/tone-apply.txt" '模型并发上限 +.*立即生效' "apply 行的徽章词仍在(颜色不是唯一通道)"
|
|
2096
2007
|
assert_badge_tone "$tmp/$current/tone-apply-e.txt" '模型并发上限' '立即生效' 'text' "apply 徽章 = 普通文本 tone"
|
|
2097
2008
|
filter_to TEAM_PULSE_INTERVAL
|
|
2098
2009
|
wait_row tone-restart "restart 徽章行" '巡检周期' '需重启' \
|
|
2099
|
-
|| bad "restart
|
|
2010
|
+
|| bad "restart 行没等到(超过等待上限)"
|
|
2100
2011
|
cap_e_to tone-restart-e
|
|
2101
2012
|
assert_match "$tmp/$current/tone-restart.txt" '巡检周期 +.*需重启' "restart 行的徽章词仍在"
|
|
2102
2013
|
assert_badge_tone "$tmp/$current/tone-restart-e.txt" '巡检周期' '需重启' 'warn' "restart 徽章 = warn tone"
|
|
2103
2014
|
filter_to TEAM_PROJECT
|
|
2104
2015
|
wait_row tone-refuse "refuse 徽章行" '项目名' 'root · 不可改' \
|
|
2105
|
-
|| bad "refuse
|
|
2016
|
+
|| bad "refuse 行没等到(超过等待上限)"
|
|
2106
2017
|
cap_e_to tone-refuse-e
|
|
2107
2018
|
assert_match "$tmp/$current/tone-refuse.txt" '项目名 +root · 不可改' "refuse 行的徽章词仍在"
|
|
2108
2019
|
assert_badge_tone "$tmp/$current/tone-refuse-e.txt" '项目名' '不可改' 'dim' "refuse 徽章 = dim tone"
|
|
2109
2020
|
# ④ 可见降级:schema 不认识的键落在「未分组」,且「未分组」在席位块之前(走到列表末尾看)。
|
|
2110
2021
|
filter_to TEAM_HAND_ADDED
|
|
2111
2022
|
wait_row hand-added "未分组里的手加未知键行" 'TEAM_HAND_ADDED' 'hand · 不认识' \
|
|
2112
|
-
|| bad "
|
|
2023
|
+
|| bad "未知键的行没等到(超过等待上限)"
|
|
2113
2024
|
assert_match "$tmp/$current/hand-added.txt" 'TEAM_HAND_ADDED +hand · 不认识' "未知键的行仍在(没有消失)"
|
|
2114
2025
|
assert_has "$tmp/$current/hand-added.txt" "TEAM_HAND_ADDED:这个设置在文件里" "未知键仍按原始键点名"
|
|
2115
2026
|
[ "$(cap_line_heading "$tmp/$current/hand-added.txt" '未分组')" -gt 0 ] \
|
|
@@ -2155,12 +2066,12 @@ EOF2
|
|
|
2155
2066
|
open_view
|
|
2156
2067
|
filter_to TEAM_ZZZ_TEST
|
|
2157
2068
|
wait_row zzz-group "scratch 新增键落在 workflow 域标题下" '工作流与门禁' 'TEAM_ZZZ_TEST' \
|
|
2158
|
-
|| bad "
|
|
2069
|
+
|| bad "新键的域标题/行没等到(超过等待上限)"
|
|
2159
2070
|
assert_has "$tmp/$current/zzz-group.txt" "工作流与门禁" "schema 新增键落在它声明的 workflow 域下(bundle 未重建)"
|
|
2160
2071
|
assert_match "$tmp/$current/zzz-group.txt" 'TEAM_ZZZ_TEST +未设 · 默认 zzz-default' "新键的行完整(值/默认来自 schema)"
|
|
2161
2072
|
filter_to TEAM_GATES
|
|
2162
2073
|
wait_row gates-moved "TEAM_GATES 跟到 meeting 域标题下" '跨项目会议' '门禁命令' \
|
|
2163
|
-
|| bad "TEAM_GATES
|
|
2074
|
+
|| bad "TEAM_GATES 的新域标题/行没等到(超过等待上限)"
|
|
2164
2075
|
assert_has "$tmp/$current/gates-moved.txt" "跨项目会议" "TEAM_GATES 的 token 改成 meeting 后跟到新标题下(bundle 里没有键→域表)"
|
|
2165
2076
|
assert_match "$tmp/$current/gates-moved.txt" '门禁命令 +true · 立即生效' "同一行仍按 schema 渲染(标签/值/徽章)"
|
|
2166
2077
|
assert_eq "三次运行之间 bundle 逐字节不变" "$(sha "$panel")" "$bundle_sha"
|
|
@@ -2179,7 +2090,7 @@ PY
|
|
|
2179
2090
|
open_view
|
|
2180
2091
|
filter_to TEAM_GATES
|
|
2181
2092
|
wait_row gates-fallback "畸形 schema 行落在「未分组」里" '未分组' '门禁命令' \
|
|
2182
|
-
|| bad "
|
|
2093
|
+
|| bad "降级组的行没等到(超过等待上限)"
|
|
2183
2094
|
unset P21_CLI
|
|
2184
2095
|
assert_has "$tmp/$current/gates-fallback.txt" "未分组" "第 10 列缺失的 schema 行落在可见的降级组里(不消失)"
|
|
2185
2096
|
assert_match "$tmp/$current/gates-fallback.txt" '门禁命令 +true · 立即生效' "降级组里的行仍完整(标签/值/徽章)"
|
|
@@ -2344,15 +2255,9 @@ PY
|
|
|
2344
2255
|
printf '\033[1m== panel-p21 · 项目设置视图(P22) ==\033[0m\n'
|
|
2345
2256
|
for s in "${SECTIONS[@]}"; do
|
|
2346
2257
|
mkdir -p "$tmp/$s"
|
|
2347
|
-
#
|
|
2348
|
-
# 这个场景(后面的场景照跑);父 shell 的 EXIT 清扫有自己的 BASHPID 守卫,不会被重复触发。
|
|
2258
|
+
# 每个场景在自己的子 shell 里跑(父 shell 的 EXIT 清扫有自己的 BASHPID 守卫,不会被重复触发)。
|
|
2349
2259
|
(
|
|
2350
2260
|
trap - EXIT INT TERM
|
|
2351
|
-
p21_premise_line "$s" # 前提行:每个场景第一个断言之前(真读数;只打不判)
|
|
2352
|
-
if ! p21_entry_guard; then # 粗闸门:超顶就在第一个等待之前停下这个场景
|
|
2353
|
-
p21_entry_skip_line "$s"
|
|
2354
|
-
exit 4
|
|
2355
|
-
fi
|
|
2356
2261
|
case "$s" in
|
|
2357
2262
|
settings) scn_settings ;;
|
|
2358
2263
|
groups) scn_groups ;;
|
|
@@ -2371,15 +2276,13 @@ for s in "${SECTIONS[@]}"; do
|
|
|
2371
2276
|
rc=$?
|
|
2372
2277
|
case "$rc" in
|
|
2373
2278
|
0) ;;
|
|
2374
|
-
3) exit 3 ;; # 搭建失败(server_up
|
|
2375
|
-
4) SKIP=$((SKIP + 1)) ;; # 可见 SKIP:无失败、无结论
|
|
2279
|
+
3) exit 3 ;; # 搭建失败(server_up/未知场景)
|
|
2376
2280
|
*) ;; # 1 = 断言失败,最后按 FAIL 退出
|
|
2377
2281
|
esac
|
|
2378
2282
|
done
|
|
2379
2283
|
|
|
2380
2284
|
PASS="$(p21_count_of "$_p21_count/ok")"
|
|
2381
2285
|
FAIL="$(p21_count_of "$_p21_count/bad")"
|
|
2382
|
-
printf '\n\033[1m== 结果 ==\033[0m ✓ %s ✗ %s
|
|
2286
|
+
printf '\n\033[1m== 结果 ==\033[0m ✓ %s ✗ %s\n' "$PASS" "$FAIL"
|
|
2383
2287
|
[ "$FAIL" -gt 0 ] && exit 1
|
|
2384
|
-
[ "$SKIP" -gt 0 ] && exit 4
|
|
2385
2288
|
exit 0
|