teamsmith 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/package.json +1 -1
- package/skills/teamsmith/CHANGELOG.md +28 -0
- package/skills/teamsmith/SKILL.md +14 -7
- package/skills/teamsmith/extension/team-notify.ts +37 -6
- package/skills/teamsmith/extension/team.ts +438 -0
- package/skills/teamsmith/references/config.md +39 -6
- package/skills/teamsmith/references/migration.md +197 -47
- package/skills/teamsmith/references/protocol.md +176 -19
- package/skills/teamsmith/references/troubleshooting.md +124 -7
- package/skills/teamsmith/references/workflows.md +36 -2
- package/skills/teamsmith/scripts/lib/cmd-agents.sh +318 -23
- package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +2 -2
- package/skills/teamsmith/scripts/lib/cmd-config.sh +349 -67
- package/skills/teamsmith/scripts/lib/cmd-draft.sh +4 -4
- package/skills/teamsmith/scripts/lib/cmd-help.sh +677 -0
- package/skills/teamsmith/scripts/lib/cmd-init.sh +157 -5
- package/skills/teamsmith/scripts/lib/cmd-interrupt.sh +461 -0
- package/skills/teamsmith/scripts/lib/cmd-meeting.sh +2 -25
- package/skills/teamsmith/scripts/lib/cmd-project.sh +30 -103
- package/skills/teamsmith/scripts/lib/cmd-reap.sh +277 -0
- package/skills/teamsmith/scripts/lib/cmd-reply.sh +3 -3
- package/skills/teamsmith/scripts/lib/cmd-review.sh +175 -30
- package/skills/teamsmith/scripts/lib/cmd-status.sh +226 -17
- package/skills/teamsmith/scripts/lib/cmd-update.sh +36 -7
- package/skills/teamsmith/scripts/lib/cmd-watch.sh +564 -46
- package/skills/teamsmith/scripts/lib/common.sh +773 -48
- package/skills/teamsmith/scripts/lib/gate-lock.sh +544 -0
- package/skills/teamsmith/scripts/panel/draft-send.sh +11 -1
- package/skills/teamsmith/scripts/panel/panel.js +207 -207
- package/skills/teamsmith/scripts/panel/src/App.tsx +58 -21
- package/skills/teamsmith/scripts/panel/src/clipboard.ts +11 -5
- package/skills/teamsmith/scripts/panel/src/compose.ts +6 -3
- package/skills/teamsmith/scripts/panel/src/data.ts +11 -3
- package/skills/teamsmith/scripts/panel/src/layout.ts +209 -69
- package/skills/teamsmith/scripts/panel/src/main.tsx +33 -8
- package/skills/teamsmith/scripts/panel/src/strings/en.ts +39 -29
- package/skills/teamsmith/scripts/panel/src/strings/zh.ts +41 -31
- package/skills/teamsmith/scripts/panel/src/types.ts +28 -3
- package/skills/teamsmith/scripts/replies.mjs +4 -1
- package/skills/teamsmith/scripts/shim/tmux +18 -0
- package/skills/teamsmith/scripts/strings/commands.tsv +86 -0
- package/skills/teamsmith/scripts/strings/help.en.tsv +503 -0
- package/skills/teamsmith/scripts/strings/help.zh.tsv +489 -0
- package/skills/teamsmith/scripts/team +19 -6
- package/skills/teamsmith/templates/AGENTS.section.md.tmpl +8 -1
- package/skills/teamsmith/templates/config.sh.tmpl +20 -1
- package/skills/teamsmith/templates/pm-prompt.md.tmpl +21 -0
- package/skills/teamsmith/tests/bg-ledger-harness.mjs +464 -40
- package/skills/teamsmith/tests/bg-ledger.sh +168 -10
- package/skills/teamsmith/tests/checkout-shape-probe.sh +3 -1
- package/skills/teamsmith/tests/config-cli.sh +160 -14
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +7 -1
- package/skills/teamsmith/tests/fixtures/p287/lint-good.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p287/lint-hardcoded.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p287/lint-no-ns.sh.in +3 -0
- package/skills/teamsmith/tests/fixtures/p55/flip-p49.sh +18 -6
- package/skills/teamsmith/tests/flip-m33.sh +5 -3
- package/skills/teamsmith/tests/flip-m37.sh +4 -1
- package/skills/teamsmith/tests/flip-m4.3.sh +4 -1
- package/skills/teamsmith/tests/flip-m6.3.sh +4 -1
- package/skills/teamsmith/tests/flip-m6.5.sh +4 -1
- package/skills/teamsmith/tests/flip-m7.2.sh +4 -1
- package/skills/teamsmith/tests/flip-p158.sh +2 -1
- package/skills/teamsmith/tests/flip-p210.sh +4 -1
- package/skills/teamsmith/tests/flip-p217.sh +4 -1
- package/skills/teamsmith/tests/flip-p287-lock.sh +342 -0
- package/skills/teamsmith/tests/flip-p287-name.sh +279 -0
- package/skills/teamsmith/tests/flip-p304-read-side.sh +98 -0
- package/skills/teamsmith/tests/flip-p308-skip-not-pass.sh +151 -0
- package/skills/teamsmith/tests/flip-p309-p162-deep.sh +122 -0
- package/skills/teamsmith/tests/flip-p310-lock.sh +216 -0
- package/skills/teamsmith/tests/flip-p310-socket.sh +125 -0
- package/skills/teamsmith/tests/help-surface.sh +1664 -0
- package/skills/teamsmith/tests/install-shape.sh +279 -20
- package/skills/teamsmith/tests/key-replies-pty.sh +9 -10
- package/skills/teamsmith/tests/key-replies-ui.sh +0 -7
- package/skills/teamsmith/tests/key-replies.sh +240 -1
- package/skills/teamsmith/tests/ledger-ban.sh +5 -4
- package/skills/teamsmith/tests/ledger-claim.sh +2 -1
- package/skills/teamsmith/tests/lib/bounded-spin.sh +90 -0
- package/skills/teamsmith/tests/lib/model-policy.sh +4 -0
- package/skills/teamsmith/tests/lib/model-routing-flips.py +51 -0
- package/skills/teamsmith/tests/lib/reply-fixture.sh +4 -9
- package/skills/teamsmith/tests/lib/section-guard.sh +258 -13
- package/skills/teamsmith/tests/lib/tmp-root.sh +139 -27
- package/skills/teamsmith/tests/lib/tmux-cap.sh +10 -1
- package/skills/teamsmith/tests/lib/tmux-iso.sh +31 -13
- package/skills/teamsmith/tests/loop-inventory.tsv +59 -47
- package/skills/teamsmith/tests/panel-b2.sh +106 -3
- package/skills/teamsmith/tests/panel-b3-stub.sh +112 -4
- package/skills/teamsmith/tests/panel-b3.sh +175 -19
- package/skills/teamsmith/tests/panel-choices.sh +11 -6
- package/skills/teamsmith/tests/panel-cpu.sh +2 -1
- package/skills/teamsmith/tests/panel-knobs.sh +7 -1
- package/skills/teamsmith/tests/panel-p21.sh +156 -73
- package/skills/teamsmith/tests/panel-snapshots.sh +41 -225
- package/skills/teamsmith/tests/panel-strings.mjs +33 -18
- package/skills/teamsmith/tests/perf.sh +121 -30
- package/skills/teamsmith/tests/routes.sh +327 -93
- package/skills/teamsmith/tests/seat-interrupt.sh +1002 -0
- package/skills/teamsmith/tests/seat-visibility.sh +675 -0
- package/skills/teamsmith/tests/section-budgets.tsv +20 -10
- package/skills/teamsmith/tests/section-guard.sh +6 -1
- package/skills/teamsmith/tests/section-needs-audit.sh +24 -7
- package/skills/teamsmith/tests/section-paths.tsv +19 -13
- package/skills/teamsmith/tests/section-select.sh +8 -1
- package/skills/teamsmith/tests/slash-team-e2e.sh +323 -0
- package/skills/teamsmith/tests/slash-team.sh +617 -0
- package/skills/teamsmith/tests/smoke.sh +2972 -440
- package/skills/teamsmith/tests/task-model-routing.sh +507 -10
- package/skills/teamsmith/tests/tmp-hygiene.sh +782 -45
- package/skills/teamsmith/tests/tmux-identity-leak.sh +773 -0
- package/skills/teamsmith/tests/tmux-lint-legacy.txt +12 -18
- package/skills/teamsmith/tests/upgrade-recipe.sh +537 -0
- package/skills/teamsmith-init/SKILL.md +12 -12
- package/skills/teamsmith-init/references/bootstrap.md +3 -3
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# TEAM_INSTALL_KEEP=1 bash ... # keep the fixture directory
|
|
7
7
|
# TEAM_INSTALL_TREE=<tree> bash ... # run against another checkout (the flip section builds scratch trees)
|
|
8
8
|
#
|
|
9
|
-
# Sections: surfaces install conflict shell pack doctor flip
|
|
9
|
+
# Sections: surfaces install conflict shell pack doctor extension flip
|
|
10
10
|
# Exit: 0 every selected section green, 1 at least one assertion failed, 3 setup failure.
|
|
11
11
|
#
|
|
12
12
|
# Nothing here touches the caller's project: every fixture is a fresh git repo under $TMPDIR, the caller's
|
|
@@ -62,7 +62,7 @@ assert_link_to() { [ -L "$1" ] && [ "$(readlink -f "$1" 2>/dev/null)" = "$2" ] &
|
|
|
62
62
|
|| bad "$3($1 → $(readlink -f "$1" 2>/dev/null || echo '不是软链'),期望 $2)"; }
|
|
63
63
|
|
|
64
64
|
SECTIONS=("$@")
|
|
65
|
-
[ "${#SECTIONS[@]}" -gt 0 ] || SECTIONS=(surfaces install conflict shell pack doctor flip)
|
|
65
|
+
[ "${#SECTIONS[@]}" -gt 0 ] || SECTIONS=(surfaces install conflict shell pack doctor extension flip)
|
|
66
66
|
want() { local s; for s in "${SECTIONS[@]}"; do [ "$s" = "$1" ] && return 0; done; return 1; }
|
|
67
67
|
|
|
68
68
|
# ---------------------------------------------------------------- helpers
|
|
@@ -280,24 +280,124 @@ chk_bootstrap_installs() { # <tree> <已初始化但删掉 .pi/skills 的仓库>
|
|
|
280
280
|
if [ "$(readlink -f "$p/.pi/skills/teamsmith")" != "$t/skills/teamsmith" ]; then printf '软链目标不对\n'; return 1; fi
|
|
281
281
|
h2="$(file_hash "$p/.pi/team/config.sh")"
|
|
282
282
|
if [ "$h1" != "$h2" ]; then printf 'config.sh 被改了\n'; return 1; fi
|
|
283
|
-
if !
|
|
284
|
-
printf 'bootstrap
|
|
283
|
+
if ! chk_trust_hint "$out" >/dev/null; then
|
|
284
|
+
printf 'bootstrap 升级路径的信任提示行不达标:[%s]\n' "$(printf '%s\n' "$out" | grep -F -- 'pi --approve' | head -1)"
|
|
285
|
+
return 1
|
|
285
286
|
fi
|
|
286
|
-
printf '已存在配置也装了 skill,config.sh
|
|
287
|
+
printf '已存在配置也装了 skill,config.sh 未动,信任提示行也在(同一行契约)\n'
|
|
288
|
+
return 0
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
# ---------------------------------------------------------------- P270 · `/team` 扩展安装面(同一张冲突表,单文件形状)
|
|
292
|
+
chk_ext_installed_link() { # <tree> <repo>:装成指向运行树的软链
|
|
293
|
+
local t="$1" p="$2"
|
|
294
|
+
local dest="$p/.pi/extensions/team.ts"
|
|
295
|
+
[ -L "$dest" ] || { printf '没有把 /team 扩展装成软链(%s)\n' "$dest"; return 1; }
|
|
296
|
+
[ "$(readlink -f "$dest")" = "$t/skills/teamsmith/extension/team.ts" ] \
|
|
297
|
+
|| { printf '软链目标不对:%s\n' "$(readlink -f "$dest")"; return 1; }
|
|
298
|
+
printf '扩展软链指向运行树\n'
|
|
299
|
+
return 0
|
|
300
|
+
}
|
|
301
|
+
chk_ext_unmarked_survives() { # <tree> <repo(.pi/extensions/team.ts 是不带标记的普通文件)>
|
|
302
|
+
local t="$1" p="$2"
|
|
303
|
+
local dest="$p/.pi/extensions/team.ts" before after out rc
|
|
304
|
+
before="$(file_hash "$dest")"
|
|
305
|
+
out="$(init_proj "$t" "$p")"; rc=$?
|
|
306
|
+
[ "$rc" -ne 0 ] || { printf '未标记的扩展文件居然 rc=0\n'; return 1; }
|
|
307
|
+
case "$out" in *红线*|*不认识的条目*) ;; *) printf '没说明红线:[%s]\n' "$(printf '%s' "$out" | tail -2 | tr '\n' ' ')"; return 1 ;; esac
|
|
308
|
+
after="$(file_hash "$dest")"
|
|
309
|
+
[ "$before" = "$after" ] || { printf '拒绝时把字节改了\n'; return 1; }
|
|
310
|
+
out="$(init_proj "$t" "$p" --force)"; rc=$?
|
|
311
|
+
[ "$rc" -ne 0 ] || { printf '--force 下未标记的扩展文件居然 rc=0\n'; return 1; }
|
|
312
|
+
after="$(file_hash "$dest")"
|
|
313
|
+
[ "$before" = "$after" ] || { printf '--force 把未标记的扩展文件动了\n'; return 1; }
|
|
314
|
+
printf '拒绝且连 --force 都不删(rc=%s)\n' "$rc"
|
|
315
|
+
return 0
|
|
316
|
+
}
|
|
317
|
+
chk_ext_marked_copy_force() { # <tree> <repo(扩展是带标记、改坏了一行的副本)>
|
|
318
|
+
local t="$1" p="$2"
|
|
319
|
+
local dest="$p/.pi/extensions/team.ts" before out rc
|
|
320
|
+
before="$(file_hash "$dest")"
|
|
321
|
+
out="$(init_proj "$t" "$p")"; rc=$?
|
|
322
|
+
[ "$rc" -ne 0 ] || { printf '带标记的漂移副本居然 rc=0\n'; return 1; }
|
|
323
|
+
[ "$(file_hash "$dest")" = "$before" ] || { printf '拒绝时把漂移副本改了\n'; return 1; }
|
|
324
|
+
init_proj "$t" "$p" --force >/dev/null 2>&1; rc=$?
|
|
325
|
+
[ "$rc" -eq 0 ] || { printf '--force 退出 %s\n' "$rc"; return 1; }
|
|
326
|
+
cmp -s "$t/skills/teamsmith/extension/team.ts" "$dest" || { printf '--force 后字节与源不同\n'; return 1; }
|
|
327
|
+
printf '带标记的漂移副本:默认拒绝、--force 换成源\n'
|
|
328
|
+
return 0
|
|
329
|
+
}
|
|
330
|
+
chk_ext_foreign_link_force() { # <tree> <repo(扩展软链指向 $tmp/foreign-ext.ts)>
|
|
331
|
+
local t="$1" p="$2"
|
|
332
|
+
local dest="$p/.pi/extensions/team.ts" out rc
|
|
333
|
+
out="$(init_proj "$t" "$p")"; rc=$?
|
|
334
|
+
[ "$rc" -ne 0 ] || { printf '别源软链居然 rc=0\n'; return 1; }
|
|
335
|
+
[ "$(readlink "$dest")" = "$tmp/foreign-ext.ts" ] || { printf '拒绝时被重指了\n'; return 1; }
|
|
336
|
+
init_proj "$t" "$p" --force >/dev/null 2>&1; rc=$?
|
|
337
|
+
[ "$rc" -eq 0 ] || { printf '--force 退出 %s\n' "$rc"; return 1; }
|
|
338
|
+
[ "$(readlink -f "$dest")" = "$t/skills/teamsmith/extension/team.ts" ] || { printf '--force 没重指到运行树\n'; return 1; }
|
|
339
|
+
printf '别源软链:默认拒绝、--force 重指\n'
|
|
340
|
+
return 0
|
|
341
|
+
}
|
|
342
|
+
chk_bootstrap_installs_ext() { # <tree> <已初始化但删掉 .pi/extensions 的仓库>
|
|
343
|
+
local t="$1" p="$2" h1 h2 out rc dest
|
|
344
|
+
dest="$p/.pi/extensions/team.ts"
|
|
345
|
+
h1="$(file_hash "$p/.pi/team/config.sh")"
|
|
346
|
+
out="$(run_tree "$t" "$p" bootstrap --no-pulse --agents dev)"; rc=$?
|
|
347
|
+
[ "$rc" -eq 0 ] || { printf 'bootstrap rc=%s:[%s]\n' "$rc" "$(printf '%s' "$out" | tail -2 | tr '\n' ' ')"; return 1; }
|
|
348
|
+
[ -L "$dest" ] || { printf 'bootstrap 没装回扩展\n'; return 1; }
|
|
349
|
+
[ "$(readlink -f "$dest")" = "$t/skills/teamsmith/extension/team.ts" ] || { printf '软链目标不对\n'; return 1; }
|
|
350
|
+
h2="$(file_hash "$p/.pi/team/config.sh")"
|
|
351
|
+
[ "$h1" = "$h2" ] || { printf 'config.sh 被改了\n'; return 1; }
|
|
352
|
+
printf '已存在配置也装了扩展,config.sh 未动\n'
|
|
353
|
+
return 0
|
|
354
|
+
}
|
|
355
|
+
ext_doctor_row() { # <captured 输出> → `/team 扩展安装` 行(没有则空)
|
|
356
|
+
printf '%s\n' "$1" | grep -F '/team 扩展安装' | head -1
|
|
357
|
+
}
|
|
358
|
+
chk_ext_doctor_missing() { # <tree> <repo(扩展被删掉)>
|
|
359
|
+
local out rc row
|
|
360
|
+
out="$(run_doctor "$1" "$2")"; rc=$?
|
|
361
|
+
[ "$rc" -eq 0 ] || { printf 'doctor 因 install 行以外的东西非 0(rc=%s)\n' "$rc"; return 1; }
|
|
362
|
+
row="$(ext_doctor_row "$out")"
|
|
363
|
+
case "$row" in *'!'*'.pi/extensions/team.ts'*'team init'*) ;; *) printf '缺失行的形状不对:[%s]\n' "$row"; return 1 ;; esac
|
|
364
|
+
case "$row" in *'--force'*) printf '缺失不该给 --force:[%s]\n' "$row"; return 1 ;; esac
|
|
365
|
+
printf '缺失:warn 点名路径与修法 team init\n'
|
|
366
|
+
return 0
|
|
367
|
+
}
|
|
368
|
+
chk_ext_doctor_drift() { # <tree> <repo(扩展副本改坏一行)>
|
|
369
|
+
local out rc row
|
|
370
|
+
out="$(run_doctor "$1" "$2")"; rc=$?
|
|
371
|
+
[ "$rc" -eq 0 ] || { printf 'doctor 因 install 行以外的东西非 0(rc=%s)\n' "$rc"; return 1; }
|
|
372
|
+
row="$(ext_doctor_row "$out")"
|
|
373
|
+
case "$row" in *'!'*'.pi/extensions/team.ts'*'team init --force'*) ;; *) printf '漂移行的形状不对:[%s]\n' "$row"; return 1 ;; esac
|
|
374
|
+
printf '漂移:warn 点名路径与修法 team init --force\n'
|
|
375
|
+
return 0
|
|
376
|
+
}
|
|
377
|
+
chk_ext_no_install_silent() { # <tree> <没有项目本地安装的仓库>
|
|
378
|
+
local out rc
|
|
379
|
+
out="$(run_doctor "$1" "$2")"; rc=$?
|
|
380
|
+
[ "$rc" -eq 0 ] || { printf 'doctor 因 install 行以外的东西非 0(rc=%s)\n' "$rc"; return 1; }
|
|
381
|
+
if printf '%s\n' "$out" | grep -qF '/team 扩展安装'; then printf '没有项目本地安装却刷了 /team 行\n'; return 1; fi
|
|
382
|
+
printf '没有项目本地安装:一行都不打\n'
|
|
287
383
|
return 0
|
|
288
384
|
}
|
|
289
385
|
|
|
290
|
-
# P59:安装步的信任提示行 ——
|
|
291
|
-
#
|
|
386
|
+
# P59 + P299:安装步的信任提示行 —— 同一行必须点名**两处**触发资源(.pi/skills/ 与 .pi/extensions/)
|
|
387
|
+
# 与三条出路(pi --approve / /trust / team init --no-skills),而且只能出现一次。
|
|
292
388
|
chk_trust_hint() { # <init 捕获输出>
|
|
293
|
-
local line n
|
|
389
|
+
local line n t miss=""
|
|
294
390
|
line="$(printf '%s\n' "$1" | grep -F -- 'pi --approve' | head -1)"
|
|
295
391
|
if [ -z "$line" ]; then
|
|
296
|
-
printf '输出里没有信任提示行(要一行点名 .pi/skills/ + pi --approve + /trust + team init --no-skills)\n'
|
|
392
|
+
printf '输出里没有信任提示行(要一行点名 .pi/skills/ + .pi/extensions/ + pi --approve + /trust + team init --no-skills)\n'
|
|
297
393
|
return 1
|
|
298
394
|
fi
|
|
299
|
-
|
|
300
|
-
|
|
395
|
+
for t in '.pi/skills/' '.pi/extensions/' 'pi --approve' '/trust' 'team init --no-skills'; do
|
|
396
|
+
case "$line" in *"$t"*) ;; *) miss="$miss [$t]" ;; esac
|
|
397
|
+
done
|
|
398
|
+
if [ -n "$miss" ]; then
|
|
399
|
+
printf '提示行缺要点:%s —— 行原文:[%s]\n' "$miss" "$line"; return 1
|
|
400
|
+
fi
|
|
301
401
|
n="$(printf '%s' "$1" | grep -cF -- 'pi --approve' || true)"
|
|
302
402
|
if [ "$n" != "1" ]; then printf '提示行不是恰好一行(%s 行)\n' "$n"; return 1; fi
|
|
303
403
|
printf '信任提示行打了一次:[%s]\n' "$(printf '%s' "$line" | LC_ALL=C sed 's/^[[:space:]]*//' | cut -c1-56)"
|
|
@@ -318,6 +418,20 @@ chk_no_skills_silent() { # <tree> <repo>:--no-skills 下不许出现这一行
|
|
|
318
418
|
return 0
|
|
319
419
|
}
|
|
320
420
|
|
|
421
|
+
# P299(init-skill 场景 3 的红侧面):两处 init 文档必须**同页**点名「触发资源 + 三条答案」——
|
|
422
|
+
# 判据用稳定 token(不是整句),删掉任一个 token 必红。五个 token = 两处触发资源 + 三条出路。
|
|
423
|
+
chk_init_docs_fact() { # <tree>
|
|
424
|
+
local d t miss=""
|
|
425
|
+
for d in skills/teamsmith-init/SKILL.md skills/teamsmith-init/references/bootstrap.md; do
|
|
426
|
+
for t in '.pi/skills/' '.pi/extensions/' 'pi --approve' '/trust' 'team init --no-skills'; do
|
|
427
|
+
grep -qF -- "$t" "$1/$d" || miss="$miss $d[$t]"
|
|
428
|
+
done
|
|
429
|
+
done
|
|
430
|
+
if [ -n "$miss" ]; then printf 'init 文档没同页点名触发资源/答案:%s\n' "$miss"; return 1; fi
|
|
431
|
+
printf '两处 init 文档都同页点名 .pi/skills/ + .pi/extensions/ + pi --approve + /trust + team init --no-skills\n'
|
|
432
|
+
return 0
|
|
433
|
+
}
|
|
434
|
+
|
|
321
435
|
chk_pack_manifest() { # <tree>:声明面 —— 恰好一个 bin 键,files 带着 bin/
|
|
322
436
|
python3 - "$1/package.json" <<'PYMANI'
|
|
323
437
|
import json, sys
|
|
@@ -416,17 +530,19 @@ if want surfaces; then
|
|
|
416
530
|
bad "init SKILL 行序不对:npm=[$n_npm] init=[$n_init] bootstrap=[$n_boot]"
|
|
417
531
|
fi
|
|
418
532
|
grep -qF '.pi/skills/' "$init_skill" && ok "init SKILL 点名项目目标 .pi/skills/" || bad "init SKILL 没点名 .pi/skills/"
|
|
533
|
+
# P299:两处 init 文档都要同页带「触发资源 + 三条答案」的稳定 token(红侧在 flip ⑨)
|
|
534
|
+
check_holds "P299 两处 init 文档同页点名触发资源与答案" chk_init_docs_fact "$tree"
|
|
419
535
|
grep -qF 'pi install' "$init_skill" && grep -qF 'install.sh' "$init_skill" \
|
|
420
536
|
&& ok "init SKILL 同时保留两条替代路线(pi install / install.sh)" \
|
|
421
537
|
|| bad "init SKILL 少了替代路线"
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
case "$
|
|
425
|
-
ok "team help
|
|
426
|
-
*) bad "team help
|
|
538
|
+
# P260 起帮助面分三级:init / bootstrap 的用法行与说明在各自的命令页上(读整页,不再截三行窗口)
|
|
539
|
+
help_out="$(bash "$team_cli" help init 2>&1)"
|
|
540
|
+
case "$help_out" in *'.pi/skills'*'--copy'*'--no-skills'*)
|
|
541
|
+
ok "team help init 页点名 .pi/skills / --copy / --no-skills" ;;
|
|
542
|
+
*) bad "team help init 页没说全($(printf '%s' "$help_out" | tr '\n' ' ' | cut -c1-200))" ;;
|
|
427
543
|
esac
|
|
428
|
-
printf '%s\n' "$
|
|
429
|
-
&& ok "team help
|
|
544
|
+
printf '%s\n' "$(bash "$team_cli" help bootstrap 2>&1)" | grep -qF '.pi/skills' \
|
|
545
|
+
&& ok "team help bootstrap 页点名装 skill 一步" || bad "team help bootstrap 页没点名装 skill"
|
|
430
546
|
grep -F '| Init / self-check |' "$daily_skill" | grep -qF '.pi/skills/' \
|
|
431
547
|
&& ok "日常 skill 的命令表 init 行点名项目 skill 安装" || bad "日常 skill 的命令表 init 行没点名安装"
|
|
432
548
|
n_r_npm="$(grep -nF 'npm install -g teamsmith' "$tree/README.md" | head -1 | cut -d: -f1)"
|
|
@@ -476,7 +592,9 @@ if want install; then
|
|
|
476
592
|
case "$out" in *'--no-skills'*) ok "--no-skills 明说跳过了这一步" ;; *) bad "--no-skills 没有说明" ;; esac
|
|
477
593
|
check_holds "P59 --no-skills 不打信任提示行" chk_no_skills_silent "$tree" "$p"
|
|
478
594
|
assert_not_file "$p/.pi/skills" "--no-skills 没建 .pi/skills/"
|
|
595
|
+
assert_not_file "$p/.pi/extensions" "--no-skills 也没建 .pi/extensions/"
|
|
479
596
|
assert_eq ".gitignore 没被塞进 .pi/skills/" "$(grep -cxF '.pi/skills/' "$p/.gitignore" || true)" "0"
|
|
597
|
+
assert_eq ".gitignore 没被塞进 .pi/extensions/" "$(grep -cxF '.pi/extensions/' "$p/.gitignore" || true)" "0"
|
|
480
598
|
|
|
481
599
|
# ③ --copy:真目录、字节相等、不带 node_modules/.git
|
|
482
600
|
p="$tmp/p-copy"; git_new "$p"; assert_isolated "$tree" "$p"
|
|
@@ -498,6 +616,7 @@ if want install; then
|
|
|
498
616
|
assert_eq "worktree 里 init 退出码 0" "$rc" "0"
|
|
499
617
|
assert_link_to "$p/.pi/skills/teamsmith" "$tree/skills/teamsmith" "安装落在主工作树的 .pi/skills/"
|
|
500
618
|
assert_not_file "$p/.worktrees/wt/.pi/skills" "worktree 侧没有安装条目"
|
|
619
|
+
assert_not_file "$p/.worktrees/wt/.pi/extensions" "worktree 侧也没有 /team 扩展(席位不需要斜杠命令)"
|
|
501
620
|
|
|
502
621
|
# ⑤ bootstrap 升级路径(配置已存在、.pi/skills 缺席)
|
|
503
622
|
p="$tmp/p-boot"; git_new "$p"; assert_isolated "$tree" "$p"
|
|
@@ -511,6 +630,7 @@ if want install; then
|
|
|
511
630
|
out="$(run_tree "$tree" "$p" bootstrap --no-pulse --print)"; rc=$?
|
|
512
631
|
assert_eq "bootstrap --print 退出码 0" "$rc" "0"
|
|
513
632
|
case "$out" in *'.pi/skills/'*) ok "--print 的计划点名装 skill 一步" ;; *) bad "--print 没点名装 skill 一步" ;; esac
|
|
633
|
+
case "$out" in *'.pi/extensions/'*) ok "--print 的计划同时点名 /team 扩展一步" ;; *) bad "--print 没点名 /team 扩展一步" ;; esac
|
|
514
634
|
assert_not_file "$p/.pi/skills" "--print 没写 .pi/skills/"
|
|
515
635
|
assert_not_file "$p/.pi/team/config.sh" "--print 没写配置"
|
|
516
636
|
assert_eq "--print 没动仓库(.git 指纹不变)" "$(files_hash "$p/.git")" "$before"
|
|
@@ -610,6 +730,80 @@ if want doctor; then
|
|
|
610
730
|
assert_eq "别源软链:warn 不改退出码(doctor 0)" "$DOC_RC" "0"
|
|
611
731
|
init_proj "$tree" "$p" --force >/dev/null 2>&1
|
|
612
732
|
assert_link_to "$p/.pi/skills/teamsmith" "$tree/skills/teamsmith" "别源软链:--force 修复到运行树"
|
|
733
|
+
# ⑤ P270:扩展 link → pass 行点名路径与源;不 warn
|
|
734
|
+
p="$tmp/d-ext-link"; git_new "$p"; init_proj "$tree" "$p" >/dev/null 2>&1
|
|
735
|
+
doctor_capture "$tree" "$p"; row="$(ext_doctor_row "$DOC_OUT")"
|
|
736
|
+
case "$row" in *'✓'*"$p/.pi/extensions/team.ts"*"$tree/skills/teamsmith/extension/team.ts"*)
|
|
737
|
+
ok "/team 扩展 link:pass 行点名入口与源" ;; *) bad "/team 扩展 link:行不对($row)" ;; esac
|
|
738
|
+
case "$row" in *'!'*) bad "/team 扩展 link:居然 warn" ;; *) ok "/team 扩展 link:不 warn" ;; esac
|
|
739
|
+
assert_eq "/team 扩展 link:doctor 退出 0" "$DOC_RC" "0"
|
|
740
|
+
# ⑥ 扩展缺失 → warn 点名路径与修法 team init;修复后回到 pass
|
|
741
|
+
p="$tmp/d-ext-missing"; git_new "$p"; init_proj "$tree" "$p" >/dev/null 2>&1; rm -f "$p/.pi/extensions/team.ts"
|
|
742
|
+
check_holds "扩展缺失:warn 点名路径与修法 team init" chk_ext_doctor_missing "$tree" "$p"
|
|
743
|
+
init_proj "$tree" "$p" >/dev/null 2>&1
|
|
744
|
+
doctor_capture "$tree" "$p"; row="$(ext_doctor_row "$DOC_OUT")"
|
|
745
|
+
case "$row" in *'✓'*) ok "扩展缺失修复:team init 后回到 pass" ;; *) bad "扩展缺失修复后行不对($row)" ;; esac
|
|
746
|
+
# ⑦ 副本漂移 → warn 点名路径与修法 team init --force;--force 之后回到 pass
|
|
747
|
+
p="$tmp/d-ext-drift"; git_new "$p"; init_proj "$tree" "$p" --copy >/dev/null 2>&1
|
|
748
|
+
printf '\n// drift\n' >> "$p/.pi/extensions/team.ts"
|
|
749
|
+
check_holds "扩展漂移:warn 点名路径与修法 team init --force" chk_ext_doctor_drift "$tree" "$p"
|
|
750
|
+
init_proj "$tree" "$p" --force >/dev/null 2>&1
|
|
751
|
+
doctor_capture "$tree" "$p"; row="$(ext_doctor_row "$DOC_OUT")"
|
|
752
|
+
case "$row" in *'✓'*"$tree/skills/teamsmith/extension/team.ts"*) ok "扩展漂移修复:--force 后回到 pass" ;; *) bad "扩展漂移修复后行不对($row)" ;; esac
|
|
753
|
+
# ⑧ 没有项目本地安装 → 一行都不打
|
|
754
|
+
p="$tmp/d-ext-absent"; git_new "$p"; init_proj "$tree" "$p" --no-skills >/dev/null 2>&1
|
|
755
|
+
check_holds "没有项目本地安装:/team 行一行都不打" chk_ext_no_install_silent "$tree" "$p"
|
|
756
|
+
fi
|
|
757
|
+
|
|
758
|
+
# ---------------------------------------------------------------- extension · P270
|
|
759
|
+
if want extension; then
|
|
760
|
+
section "extension · /team 扩展安装面(link/copy/冲突表/--no-skills/bootstrap)"
|
|
761
|
+
# ① 默认 link:逐条一行 + .gitignore + 目标指向运行树
|
|
762
|
+
p="$tmp/x-link"; git_new "$p"; assert_isolated "$tree" "$p"
|
|
763
|
+
out="$(init_proj "$tree" "$p")"; rc=$?
|
|
764
|
+
assert_eq "init 退出码 0" "$rc" "0"
|
|
765
|
+
case "$out" in *"link $p/.pi/extensions/team.ts → $tree/skills/teamsmith/extension/team.ts"*)
|
|
766
|
+
ok "输出逐条一行:扩展 link 行(含目标与源)" ;;
|
|
767
|
+
*) bad "扩展 link 行形状不对:$(printf '%s' "$out" | grep extensions | tr '\n' ' ')" ;; esac
|
|
768
|
+
check_holds "扩展装成指向运行树的软链" chk_ext_installed_link "$tree" "$p"
|
|
769
|
+
assert_eq ".gitignore 有 .pi/extensions/ 且只一条" "$(grep -cxF '.pi/extensions/' "$p/.gitignore" || true)" "1"
|
|
770
|
+
# ② 幂等:第二次 init 报 skip;--copy 对着已有软链也 skip,目标不变
|
|
771
|
+
x1="$(readlink -f "$p/.pi/extensions/team.ts")"
|
|
772
|
+
out2="$(init_proj "$tree" "$p")"; rc2=$?
|
|
773
|
+
assert_eq "第二次 init 退出码 0" "$rc2" "0"
|
|
774
|
+
case "$out2" in *"skip $p/.pi/extensions/team.ts("*) ok "第二次 init 报扩展 skip" ;; *) bad "第二次 init 没有扩展 skip 行" ;; esac
|
|
775
|
+
assert_eq "第二次 init 后扩展目标不变" "$(readlink -f "$p/.pi/extensions/team.ts")" "$x1"
|
|
776
|
+
out3="$(init_proj "$tree" "$p" --copy)"; rc3=$?
|
|
777
|
+
assert_eq "--copy 对着已有扩展软链退出 0(skip,不覆盖)" "$rc3" "0"
|
|
778
|
+
assert_eq "--copy 后仍是同一软链目标" "$(readlink -f "$p/.pi/extensions/team.ts")" "$x1"
|
|
779
|
+
# ③ --copy:真文件、字节相等
|
|
780
|
+
p="$tmp/x-copy"; git_new "$p"; init_proj "$tree" "$p" --copy >/dev/null 2>&1
|
|
781
|
+
[ -f "$p/.pi/extensions/team.ts" ] && [ ! -L "$p/.pi/extensions/team.ts" ] \
|
|
782
|
+
&& ok "--copy 装的是真文件(不是软链)" || bad "--copy 装的扩展不是文件"
|
|
783
|
+
assert_eq "--copy 的扩展与源逐字节相等" \
|
|
784
|
+
"$(cmp -s "$tree/skills/teamsmith/extension/team.ts" "$p/.pi/extensions/team.ts" && echo same || echo differ)" "same"
|
|
785
|
+
# ④ --no-skills:两个目录都不建
|
|
786
|
+
p="$tmp/x-noskills"; git_new "$p"; init_proj "$tree" "$p" --no-skills >/dev/null 2>&1
|
|
787
|
+
assert_not_file "$p/.pi/skills" "--no-skills 没建 .pi/skills/"
|
|
788
|
+
assert_not_file "$p/.pi/extensions" "--no-skills 也没建 .pi/extensions/"
|
|
789
|
+
assert_eq ".gitignore 没被塞进 .pi/extensions/" "$(grep -cxF '.pi/extensions/' "$p/.gitignore" || true)" "0"
|
|
790
|
+
# ⑤ 冲突表:不带标记的普通文件 —— 拒绝且连 --force 都不删(红线)
|
|
791
|
+
p="$tmp/x-unmarked"; git_new "$p"; init_proj "$tree" "$p" --no-skills >/dev/null 2>&1
|
|
792
|
+
mkdir -p "$p/.pi/extensions"; printf 'not the extension\n' > "$p/.pi/extensions/team.ts"
|
|
793
|
+
check_holds "未标记的普通文件:拒绝且连 --force 都不删" chk_ext_unmarked_survives "$tree" "$p"
|
|
794
|
+
# ⑥ 带标记的漂移副本:默认拒绝、--force 换源
|
|
795
|
+
p="$tmp/x-marked"; git_new "$p"; init_proj "$tree" "$p" --copy >/dev/null 2>&1
|
|
796
|
+
printf '\n// drift\n' >> "$p/.pi/extensions/team.ts"
|
|
797
|
+
check_holds "带标记的漂移副本:默认拒绝、--force 换源" chk_ext_marked_copy_force "$tree" "$p"
|
|
798
|
+
# ⑦ 别源软链:默认拒绝、--force 重指
|
|
799
|
+
p="$tmp/x-foreign"; git_new "$p"; init_proj "$tree" "$p" --no-skills >/dev/null 2>&1
|
|
800
|
+
mkdir -p "$p/.pi/extensions"
|
|
801
|
+
printf '// teamsmith /team extension\n' > "$tmp/foreign-ext.ts"
|
|
802
|
+
ln -s "$tmp/foreign-ext.ts" "$p/.pi/extensions/team.ts"
|
|
803
|
+
check_holds "别源软链:默认拒绝、--force 重指" chk_ext_foreign_link_force "$tree" "$p"
|
|
804
|
+
# ⑧ bootstrap 升级路径(配置已存在、扩展缺席)
|
|
805
|
+
p="$tmp/x-boot"; git_new "$p"; init_proj "$tree" "$p" >/dev/null 2>&1; rm -rf "$p/.pi/extensions"
|
|
806
|
+
check_holds "bootstrap 对已存在的项目装回扩展" chk_bootstrap_installs_ext "$tree" "$p"
|
|
613
807
|
fi
|
|
614
808
|
|
|
615
809
|
# ---------------------------------------------------------------- flip
|
|
@@ -711,16 +905,81 @@ PYTRUST
|
|
|
711
905
|
import sys
|
|
712
906
|
p = sys.argv[1]
|
|
713
907
|
s = open(p, encoding='utf-8').read()
|
|
714
|
-
old = " printf ' skip %s(--no-skills:只做配置/文档,没装项目本地 skill
|
|
908
|
+
old = " printf ' skip %s 与 %s(--no-skills:只做配置/文档,没装项目本地 skill/扩展)\\n' \\\n \"$target\" \"$(team_project_extension_target)\"\n return 0"
|
|
715
909
|
if old not in s:
|
|
716
910
|
print("没找到 --no-skills 分支"); sys.exit(1)
|
|
717
|
-
new = old.replace(' return 0', ' team_dim " 提示:.pi/skills/ pi --approve /trust team init --no-skills"\n return 0')
|
|
911
|
+
new = old.replace(' return 0', ' team_dim " 提示:.pi/skills/ 与 .pi/extensions/ pi --approve /trust team init --no-skills"\n return 0')
|
|
718
912
|
open(p, "w", encoding="utf-8").write(s.replace(old, new, 1))
|
|
719
913
|
PYTRUST2
|
|
720
914
|
pg2="$tmp/f-trust-noskills-green"; git_new "$pg2"
|
|
721
915
|
pf2="$tmp/f-trust-noskills-red"; git_new "$pf2"
|
|
722
916
|
check_holds "⑦b 对照:真实树 --no-skills 安静" chk_no_skills_silent "$tree" "$pg2"
|
|
723
917
|
check_breaks "⑦b 翻转:提示行也打进 --no-skills 分支" chk_no_skills_silent "$ft2" "$pf2"
|
|
918
|
+
# ⑦c P299:只删输出行里的 `.pi/extensions/`(其余原样)→ 判据必须红并点名那一行
|
|
919
|
+
ft="$tmp/f-trust-extline"; scratch_tree "$ft"
|
|
920
|
+
python3 - "$ft/skills/teamsmith/scripts/lib/cmd-init.sh" <<'PYTRUSTEXT'
|
|
921
|
+
import sys
|
|
922
|
+
p = sys.argv[1]
|
|
923
|
+
s = open(p, encoding='utf-8').read()
|
|
924
|
+
old = ' team_dim " 提示:.pi/skills/ 与 .pi/extensions/'
|
|
925
|
+
new = ' team_dim " 提示:.pi/skills/ 与 '
|
|
926
|
+
if old not in s:
|
|
927
|
+
print("没找到信任提示行"); sys.exit(1)
|
|
928
|
+
open(p, "w", encoding="utf-8").write(s.replace(old, new, 1))
|
|
929
|
+
PYTRUSTEXT
|
|
930
|
+
pg3="$tmp/f-trust-extline-green"; git_new "$pg3"
|
|
931
|
+
pf3="$tmp/f-trust-extline-red"; git_new "$pf3"
|
|
932
|
+
check_holds "⑦c 对照:真实树信任行点名两处资源" chk_trust_hint_case "$tree" "$pg3"
|
|
933
|
+
check_breaks "⑦c 翻转:信任行删掉 .pi/extensions/" chk_trust_hint_case "$ft" "$pf3"
|
|
934
|
+
# ⑨ P299:两处 init 文档的稳定 token(场景 3 的红侧:删掉 token → 同一判据红)
|
|
935
|
+
ft="$tmp/f-docs-skill"; scratch_tree "$ft"
|
|
936
|
+
python3 - "$ft/skills/teamsmith-init/SKILL.md" <<'PYDOCSKILL'
|
|
937
|
+
import sys
|
|
938
|
+
p = sys.argv[1]
|
|
939
|
+
s = open(p, encoding='utf-8').read()
|
|
940
|
+
if '.pi/extensions/' not in s:
|
|
941
|
+
print("SKILL.md 里找不到 .pi/extensions/"); sys.exit(1)
|
|
942
|
+
open(p, "w", encoding="utf-8").write(s.replace('.pi/extensions/', '', 1))
|
|
943
|
+
PYDOCSKILL
|
|
944
|
+
check_holds "⑨a 对照:两处 init 文档的 token 都在" chk_init_docs_fact "$tree"
|
|
945
|
+
check_breaks "⑨a 翻转:SKILL.md 删掉 .pi/extensions/ token" chk_init_docs_fact "$ft"
|
|
946
|
+
ft2="$tmp/f-docs-boot"; scratch_tree "$ft2"
|
|
947
|
+
python3 - "$ft2/skills/teamsmith-init/references/bootstrap.md" <<'PYDOCBOOT'
|
|
948
|
+
import sys
|
|
949
|
+
p = sys.argv[1]
|
|
950
|
+
s = open(p, encoding='utf-8').read()
|
|
951
|
+
if '/trust' not in s:
|
|
952
|
+
print("bootstrap.md 里找不到 /trust"); sys.exit(1)
|
|
953
|
+
open(p, "w", encoding="utf-8").write(s.replace('/trust', '', 1))
|
|
954
|
+
PYDOCBOOT
|
|
955
|
+
check_breaks "⑨b 翻转:bootstrap.md 删掉 /trust token" chk_init_docs_fact "$ft2"
|
|
956
|
+
# ⑧ P270:扩展红线(不带标记的普通文件连 --force 都不删)与 /team 的 doctor 行
|
|
957
|
+
ft="$tmp/f-ext-refuse"; scratch_tree "$ft"
|
|
958
|
+
python3 - "$ft/skills/teamsmith/scripts/lib/cmd-init.sh" <<'PYEXT'
|
|
959
|
+
import sys
|
|
960
|
+
p = sys.argv[1]
|
|
961
|
+
s = open(p, encoding='utf-8').read()
|
|
962
|
+
old = ('team_extension_install_refuse_unknown() { # <dest>:普通文件/目录但没有源的标记行 —— 红线:--force 也不删\n'
|
|
963
|
+
' local dest="$1"\n')
|
|
964
|
+
new = ('team_extension_install_refuse_unknown() { # <dest>:普通文件/目录但没有源的标记行 —— 红线:--force 也不删\n'
|
|
965
|
+
' local dest="$1"\n rm -f "$dest"\n')
|
|
966
|
+
if old not in s:
|
|
967
|
+
print("没找到扩展红线函数"); sys.exit(1)
|
|
968
|
+
open(p, "w", encoding="utf-8").write(s.replace(old, new, 1))
|
|
969
|
+
PYEXT
|
|
970
|
+
pg="$tmp/f-ext-refuse-green"; git_new "$pg"; init_proj "$tree" "$pg" --no-skills >/dev/null 2>&1
|
|
971
|
+
mkdir -p "$pg/.pi/extensions"; printf 'not the extension\n' > "$pg/.pi/extensions/team.ts"
|
|
972
|
+
pf="$tmp/f-ext-refuse-red"; git_new "$pf"; init_proj "$ft" "$pf" --no-skills >/dev/null 2>&1
|
|
973
|
+
mkdir -p "$pf/.pi/extensions"; printf 'not the extension\n' > "$pf/.pi/extensions/team.ts"
|
|
974
|
+
check_holds "⑧a 对照:真实树拒绝未标记的扩展文件" chk_ext_unmarked_survives "$tree" "$pg"
|
|
975
|
+
check_breaks "⑧a 翻转:红线函数改成 rm -f(未标记的文件被删)" chk_ext_unmarked_survives "$ft" "$pf"
|
|
976
|
+
ft="$tmp/f-ext-doctor"; scratch_tree "$ft"
|
|
977
|
+
printf '\n# FLIP:把 /team 扩展的 doctor 行静默掉\nteam_project_extension_install_row() { return 0; }\n' \
|
|
978
|
+
>> "$ft/skills/teamsmith/scripts/lib/cmd-init.sh"
|
|
979
|
+
pg="$tmp/f-ext-doctor-green"; git_new "$pg"; init_proj "$tree" "$pg" >/dev/null 2>&1; rm -f "$pg/.pi/extensions/team.ts"
|
|
980
|
+
pf="$tmp/f-ext-doctor-red"; git_new "$pf"; init_proj "$ft" "$pf" >/dev/null 2>&1; rm -f "$pf/.pi/extensions/team.ts"
|
|
981
|
+
check_holds "⑧b 对照:真实树报扩展缺失" chk_ext_doctor_missing "$tree" "$pg"
|
|
982
|
+
check_breaks "⑧b 翻转:/team 的 doctor 行被静默" chk_ext_doctor_missing "$ft" "$pf"
|
|
724
983
|
# ⑥ 真实树没被夹具动过:git status 指纹前后一致
|
|
725
984
|
porcelain_after="$(cd "$tree" && git status --porcelain | sha256sum)"
|
|
726
985
|
assert_eq "⑥ 夹具没碰真实树(git status 指纹不变)" "$porcelain_after" "$porcelain_before"
|
|
@@ -61,7 +61,8 @@ kr_group_pages() {
|
|
|
61
61
|
fixture_up pages "dev2|完整结论与取舍|$b1" "verify|第二份回复|$b2"
|
|
62
62
|
start_panel || { bad "pages:面板起不来"; return 1; }
|
|
63
63
|
keys "5"; sleep 0.6
|
|
64
|
-
want_frame list5 "pages:第 5
|
|
64
|
+
want_frame list5 "pages:第 5 页列表帧(编号/标题/发布者标签)" "#2 第二份回复" "#1 完整结论与取舍" "关键回复"
|
|
65
|
+
assert_has "$tmp/$current/list5.txt" "「这条回复是写给谁的?」" "pages:第 5 页说明行带着判据的自测题(删整行或只删自测题都会红)"
|
|
65
66
|
assert_has "$tmp/$current/list5.txt" "个编号槽位" "pages:列表带编号槽位计数"
|
|
66
67
|
assert_has "$tmp/$current/list5.txt" "更早" "pages:Older 控件可见"
|
|
67
68
|
ev_save "$tmp/$current/list5.txt" "pty-pages-list5.txt"
|
|
@@ -112,15 +113,14 @@ PYT
|
|
|
112
113
|
case "$kinds" in *page*) ok "overview:总览带页面目标(含第 5 页)" ;; *) bad "overview:总览没有页面目标(kinds=$kinds)" ;; esac
|
|
113
114
|
"${clean_env[@]}" node "$panel" --root "$ROOT" --team-cli "$team_cli" --snapshot --page 1 \
|
|
114
115
|
--width 120 --height 28 --lang zh 2>/dev/null | sed -e 's/\x1b\[[0-9;]*m//g' >"$tmp/ov-snap.txt"
|
|
115
|
-
assert_has "$tmp/ov-snap.txt" "最新关键回复" "overview:总览摘要行带标题标签"
|
|
116
116
|
assert_has "$tmp/ov-snap.txt" "#1 总览入口标题" "overview:总览摘要行显示最新编号与标题"
|
|
117
|
-
assert_has "$tmp/ov-snap.txt" "dev2" "overview
|
|
117
|
+
assert_has "$tmp/ov-snap.txt" "dev2" "overview:总览摘要行显示发布者标签"
|
|
118
118
|
start_panel || { bad "overview:面板起不来"; return 1; }
|
|
119
119
|
want_frame ov_pane "overview:面板总览上的摘要行" "#1 总览入口标题" "最新关键回复"
|
|
120
120
|
keys "5"; sleep 0.6
|
|
121
121
|
want_frame ov_page5 "overview:按 5 到第 5 页最新列表" "#1 总览入口标题" "个编号槽位"
|
|
122
122
|
keys Enter; sleep 0.6
|
|
123
|
-
want_frame ov_body "overview:列表上 Enter 用同一正文视窗打开" "总览入口回复" "只读 ·
|
|
123
|
+
want_frame ov_body "overview:列表上 Enter 用同一正文视窗打开" "总览入口回复" "只读 · 按发布的原文显示"
|
|
124
124
|
ev_save "$tmp/$current/ov_pane.txt" "pty-overview-summary.txt"
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -145,7 +145,7 @@ kr_group_list() {
|
|
|
145
145
|
sleep 0.4
|
|
146
146
|
want_frame focus_last "list:连续 ↓ 把焦点移到最旧的 #1(末端夹住,光标在 #1 行)" "› #1 第 1 号"
|
|
147
147
|
keys Enter; sleep 0.8
|
|
148
|
-
want_frame first_body "list:打开最旧的 #1,全文可读" "#1 关键回复" "批量回复正文" "只读 ·
|
|
148
|
+
want_frame first_body "list:打开最旧的 #1,全文可读" "#1 关键回复" "批量回复正文" "只读 · 按发布的原文显示"
|
|
149
149
|
keys "q"; sleep 0.6
|
|
150
150
|
want_frame back_ctx "list:q 返回列表且仍是同一页与同一焦点" "› #1 第 1 号"
|
|
151
151
|
keys Right; sleep 1.2
|
|
@@ -163,7 +163,7 @@ kr_group_body() {
|
|
|
163
163
|
fixture_up body "dev2|长正文|$long"
|
|
164
164
|
start_panel || { bad "body:面板起不来"; return 1; }
|
|
165
165
|
keys "5"; sleep 0.6; keys Enter; sleep 0.8
|
|
166
|
-
want_frame top "body:视窗打开在文首" "长正文" "
|
|
166
|
+
want_frame top "body:视窗打开在文首" "长正文" "来自 dev2"
|
|
167
167
|
assert_not "$tmp/$current/top.txt" "END-MARKER-P234" "body:打开时不在结尾(长文不是一次铺满)"
|
|
168
168
|
keys End; sleep 0.6
|
|
169
169
|
want_frame end "body:End 到结尾,END-MARKER 可见" "END-MARKER-P234"
|
|
@@ -217,7 +217,7 @@ kr_group_mouse() {
|
|
|
217
217
|
--hint "#38 鼠标 38 号" --out "$tmp/m-open.bin" >"$tmp/m-open.log" 2>&1
|
|
218
218
|
rc=$?
|
|
219
219
|
if [ "$rc" = "0" ]; then ok "mouse:第二点注入成功"; else bad "mouse:第二点注入失败(rc=$rc)"; fi
|
|
220
|
-
want_frame m_open "mouse:再点同一行打开该号正文(第二次点击才是打开)" "鼠标夹具正文" "只读 ·
|
|
220
|
+
want_frame m_open "mouse:再点同一行打开该号正文(第二次点击才是打开)" "鼠标夹具正文" "只读 · 按发布的原文显示" "#38 关键回复"
|
|
221
221
|
# Back 芯片:单击返回
|
|
222
222
|
python3 "$SELF_DIR/panel-b3-pty-tmux-mouse.py" --sock "$sock" --session "$sess" --pane "$sess:panel" \
|
|
223
223
|
--hint "返回" --out "$tmp/m-back.bin" >"$tmp/m-back.log" 2>&1
|
|
@@ -281,8 +281,7 @@ kr_group_language() {
|
|
|
281
281
|
printf 'lang=en\n' >"$state/panel.conf"
|
|
282
282
|
start_panel || { bad "language:面板起不来"; return 1; }
|
|
283
283
|
keys "5"; sleep 0.6
|
|
284
|
-
want_frame en "language:en 表下第 5
|
|
285
|
-
assert_has "$tmp/$current/en.txt" "numbered slots" "language:en 表下槽位计数文案"
|
|
284
|
+
want_frame en "language:en 表下第 5 页标签与路由完整(含说明行的自测题)" "key replies" "Older" "Older" '"who is this reply written for?"'
|
|
286
285
|
printf 'lang=zh\n' >"$state/panel.conf"
|
|
287
286
|
start_panel || bad "language:重启失败"
|
|
288
287
|
keys "5"; sleep 0.6
|
|
@@ -312,7 +311,7 @@ kr_group_async() {
|
|
|
312
311
|
# ③ 打开正文 → 一个带编号的 body 调用
|
|
313
312
|
reset_argv
|
|
314
313
|
keys Enter; sleep 1.2
|
|
315
|
-
want_frame body "async:正文视窗渲染" "只读 ·
|
|
314
|
+
want_frame body "async:正文视窗渲染" "只读 · 按发布的原文显示"
|
|
316
315
|
assert_match "$(kr_argv)" 'reply_body.*--no [0-9]+' "async:body 调用带要读的编号"
|
|
317
316
|
# ④ 返回 → 不再请求 body;离开第 5 页 → list/body 都不再请求
|
|
318
317
|
reset_argv
|
|
@@ -57,7 +57,6 @@ kr_group_blocks() {
|
|
|
57
57
|
kr_panel_snapshot 1 --width 120 --height 28 --lang zh >"$tmp/bl-ov.txt"
|
|
58
58
|
assert_eq "blocks:--page 1 快照里 list 调用为 0" "$(block_calls reply_list)" "0"
|
|
59
59
|
assert_eq "blocks:--page 1 快照里 body 调用为 0" "$(block_calls reply_body)" "0"
|
|
60
|
-
assert_has "$tmp/bl-ov.txt" "最新关键回复" "blocks:总览摘要行渲染(默认语言)"
|
|
61
60
|
# ② 第 5 页:list 恰好一次且带 newest 形态;body 仍为 0
|
|
62
61
|
reset_argv
|
|
63
62
|
kr_panel_snapshot 5 --width 120 --height 28 --lang zh >"$tmp/bl-list.txt"
|
|
@@ -94,7 +93,6 @@ FLOOD
|
|
|
94
93
|
"${clean_env[@]}" node "$panel" --root "$ROOT" \
|
|
95
94
|
--team-cli "$tmp/$current/bin/flood-team" --snapshot --page 1 --width 120 --height 24 --lang zh \
|
|
96
95
|
| sed -e 's/\x1b\[[0-9;]*m//g' >"$tmp/bl-flood.txt" 2>/dev/null
|
|
97
|
-
assert_has "$tmp/bl-flood.txt" "最新关键回复" "blocks:泛滥源只让摘要行降级,帧仍然渲染"
|
|
98
96
|
ev_save "$tmp/bl-flood.txt" "ui-blocks-flood.txt"
|
|
99
97
|
}
|
|
100
98
|
|
|
@@ -182,10 +180,8 @@ PYW
|
|
|
182
180
|
# 状态:summary 行 / 空 store / 坏 store / cursor 续页 / 长文视窗
|
|
183
181
|
kr_panel_snapshot 1 --width 160 --height 30 --lang zh >"$tmp/snap-summary.txt"
|
|
184
182
|
assert_has "$tmp/snap-summary.txt" "#60 槽位 58" "snapshots:总览摘要显示最新编号与标题"
|
|
185
|
-
assert_has "$tmp/snap-summary.txt" "最新关键回复" "snapshots:总览摘要标题标签"
|
|
186
183
|
kr_panel_snapshot 5 --reply-before 10 --width 120 --height 24 --lang zh >"$tmp/snap-cont.txt"
|
|
187
184
|
assert_has "$tmp/snap-cont.txt" "#1 " "snapshots:更旧页 cursor 到达 #1"
|
|
188
|
-
assert_has "$tmp/snap-cont.txt" "个编号槽位" "snapshots:更旧页仍带槽位计数"
|
|
189
185
|
kr_panel_snapshot 5 --reply-no 2 --width 120 --height 24 --lang zh >"$tmp/snap-view.txt"
|
|
190
186
|
assert_has "$tmp/snap-view.txt" "长文快照" "snapshots:长文视窗渲染标题"
|
|
191
187
|
local KR="$state/key-replies" size
|
|
@@ -195,9 +191,6 @@ PYW
|
|
|
195
191
|
assert_has "$tmp/snap-corrupt.txt" "不可用" "snapshots:坏槽位在快照里是不可用行"
|
|
196
192
|
mv "$KR" "$tmp/store-parked"
|
|
197
193
|
kr_panel_snapshot 5 --width 99 --height 20 --lang zh >"$tmp/snap-empty.txt"
|
|
198
|
-
assert_has "$tmp/snap-empty.txt" "(还没有关键回复)" "snapshots:空 store 是显式空状态"
|
|
199
|
-
assert_has "$tmp/snap-empty.txt" "关键回复" "snapshots:空 store 时页面身份仍在"
|
|
200
|
-
assert_not "$tmp/snap-empty.txt" "个编号槽位" "snapshots:空 store 不伪装成有槽位"
|
|
201
194
|
mv "$tmp/store-parked" "$KR"
|
|
202
195
|
# 半截帧守卫:一次性写出器(`--snapshot`/`--print`/`--json`)走的是同步 raw fd 写,
|
|
203
196
|
# fd 1 是管道时可能只写进去一部分——每个快照都必须是完整 UTF-8 且以换行结尾。
|