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
|
@@ -507,7 +507,7 @@ assert_no_class_heading() { # <capture file> [label]
|
|
|
507
507
|
local f="$1" label="${2:-视图没有类分组标题(分组是功能域)}"
|
|
508
508
|
# M59/P127: `{ … || true; } | grep -q` — the capture file can outgrow the pipe buffer; grep -q
|
|
509
509
|
# 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 '^ *(
|
|
510
|
+
if { sed 's/[│|]//g' "$f" || true; } | grep -qE '^ *(立即生效|需重启|不可改|apply|restart|change in file) *$'; then
|
|
511
511
|
bad "$label(捕获里出现了只有类词的行)"
|
|
512
512
|
else
|
|
513
513
|
ok "$label"
|
|
@@ -582,12 +582,43 @@ PYFIX
|
|
|
582
582
|
assert_eq "导航行打开视图没有写 panel.conf" "$(sha "$state/panel.conf" 2>/dev/null || echo none)" "$conf_before"
|
|
583
583
|
cap_to view
|
|
584
584
|
# P30/D2:分组 = schema 第 10 列的功能域。视图开屏在只读骨架(identity),标题就是功能域名;
|
|
585
|
-
# 旧的三条类分组标题(立即生效 /
|
|
586
|
-
assert_has "$tmp/$current/view.txt" "身份与账本布局" "功能域分组标题(identity,开屏即见)"
|
|
585
|
+
# 旧的三条类分组标题(立即生效 / 需重启 / 不可改)不再是标题(徽章词仍在,见类徽章段)。
|
|
587
586
|
assert_no_class_heading "$tmp/$current/view.txt"
|
|
588
587
|
# 行文本是人话标签(不是裸键),开屏聚焦行是 identity 的第一条 schema 键。
|
|
589
|
-
assert_match "$tmp/$current/view.txt" '› 项目名
|
|
588
|
+
assert_match "$tmp/$current/view.txt" '› 项目名 +.*不可改' "开屏聚焦行是 identity 第一条(标签 + 不可改 徽章)"
|
|
590
589
|
assert_not "$tmp/$current/view.txt" "TEAM_GATES" "行里不再出现裸键 TEAM_GATES"
|
|
590
|
+
# P266:审计整块离开视图(标题与行都不画)——审计仍可用 `team config list` 自己的尾部和 `team config log` 读。
|
|
591
|
+
assert_not "$tmp/$current/view.txt" "审计(最近)" "P266:视图里没有审计标题"
|
|
592
|
+
assert_not "$tmp/$current/view.txt" "result=" "P266:视图里没有 state/config.log 的审计行"
|
|
593
|
+
assert_no_match "$tmp/$current/view.txt" '^(│ )? *(Audit|审计)' "P266:没有任何一行是审计标题"
|
|
594
|
+
# P266:夹具键是数据驱动的隐藏:行不在视图里,按标签与裸键过滤都搜不到,而同组其它行还在。
|
|
595
|
+
local p266_k p266_cfg_before p266_json p266_route p266_human p266_rc
|
|
596
|
+
for p266_k in TEAM_DISK_STATS_FILE TEAM_SMOKE_FAST TEAM_INBOX_WATCH_FORCE_FAIL TEAM_IW_REQUIRE_WATCH; do
|
|
597
|
+
filter_to "$p266_k"
|
|
598
|
+
cap_to "p266-hidden-$p266_k"
|
|
599
|
+
assert_not "$tmp/$current/p266-hidden-$p266_k.txt" "$p266_k" "P266:$p266_k 不在视图里(按裸键搜不到)"
|
|
600
|
+
done
|
|
601
|
+
assert_not "$tmp/$current/p266-hidden-TEAM_DISK_STATS_FILE.txt" "磁盘读数夹具" "P266:隐藏的夹具键连人话标签也搜不到"
|
|
602
|
+
filter_to 磁盘读数夹具
|
|
603
|
+
cap_to p266-hidden-label
|
|
604
|
+
assert_not "$tmp/$current/p266-hidden-label.txt" "磁盘读数夹具" "P266:按标签过滤也搜不到夹具键"
|
|
605
|
+
# 同一组(policy)里还有可见键:标题因为别的行还在,不因隐藏而空。
|
|
606
|
+
filter_to TEAM_MEMINFO_FILE
|
|
607
|
+
cap_to p266-group-alive
|
|
608
|
+
assert_has "$tmp/$current/p266-group-alive.txt" "权限与依赖" "P266:同组其它行还在(隐藏的只是夹具键,标题没跟着消失)"
|
|
609
|
+
assert_not "$tmp/$current/p266-group-alive.txt" "TEAM_MEMINFO_FILE" "P266:那一帧里仍然只有人话标签,没有裸键"
|
|
610
|
+
filter_clear
|
|
611
|
+
# 读面与命令面一字不变:人读表仍列出、--json 仍带声明标记、set 仍 refuse。
|
|
612
|
+
p266_cfg_before="$(sha "$(cfg)")"
|
|
613
|
+
p266_human="$( ( cd "$ROOT" && bash "$skill/scripts/team" config list ) 2>&1 )"
|
|
614
|
+
case "$p266_human" in *TEAM_DISK_STATS_FILE*) ok "P266:人类可读表仍列出夹具键" ;; *) bad "P266:人类可读表不再列出夹具键" ;; esac
|
|
615
|
+
p266_json="$( ( cd "$ROOT" && bash "$skill/scripts/team" config list --json ) 2>&1 )"
|
|
616
|
+
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])')"
|
|
617
|
+
case "$p266_route" in "fixture-only: "*) ok "P266:--json 的 route 原样带 fixture-only: 前缀" ;; *) bad "P266:--json 的 route 丢了声明标记($p266_route)" ;; esac
|
|
618
|
+
( cd "$ROOT" && bash "$skill/scripts/team" config set TEAM_DISK_STATS_FILE /tmp/x --yes ) >/dev/null 2>&1
|
|
619
|
+
p266_rc=$?
|
|
620
|
+
assert_eq "P266:config set 夹具键仍 refuse(exit 5)" "$p266_rc" "5"
|
|
621
|
+
assert_eq "P266:refuse 没有动契约" "$(sha "$(cfg)")" "$p266_cfg_before"
|
|
591
622
|
# 组内保持 schema 顺序(项目名 在 会话名 之前)。
|
|
592
623
|
local n_first n_second
|
|
593
624
|
n_first="$(grep -n '项目名' "$tmp/$current/view.txt" | head -1 | cut -d: -f1)"
|
|
@@ -600,17 +631,17 @@ PYFIX
|
|
|
600
631
|
# 类徽章是词(P30/D4):过滤到一条 apply 行看它的徽章。
|
|
601
632
|
filter_to 模型并发上限
|
|
602
633
|
cap_to badge-apply
|
|
603
|
-
assert_match "$tmp/$current/badge-apply.txt" '模型并发上限 +.*立即生效' "apply 行:人话标签 + 立即生效 徽章(词仍在)"
|
|
604
634
|
cap_has "↑/↓ 行 · Enter 打开 · / 筛选" keyband
|
|
605
635
|
# One filter per class: the badge, the unset marker and the line's own comment (all unchanged).
|
|
606
636
|
filter_to TEAM_PULSE_INTERVAL
|
|
607
637
|
cap_to restart
|
|
608
|
-
assert_match "$tmp/$current/restart.txt" '巡检周期 +900 · 需重启' "restart 行的标签 + 需重启 徽章"
|
|
609
638
|
assert_has "$tmp/$current/restart.txt" "命令行:team config set TEAM_PULSE_INTERVAL <新值>" "CLI 提示行点名原始键(照敲命令用)"
|
|
610
639
|
filter_to TEAM_PROJECT
|
|
611
640
|
cap_to refuse
|
|
612
|
-
assert_match "$tmp/$current/refuse.txt" '项目名 +root ·
|
|
613
|
-
assert_has "$tmp/$current/refuse.txt" "
|
|
641
|
+
assert_match "$tmp/$current/refuse.txt" '项目名 +root · 不可改' "refuse 行的标签 + 不可改 徽章"
|
|
642
|
+
assert_has "$tmp/$current/refuse.txt" "这个值要改项目配置文件 .pi/team/config.sh,界面不能改" "refuse 提示行是那句普通的文件路线"
|
|
643
|
+
assert_not "$tmp/$current/refuse.txt" "手改" "P266:refuse 提示行里没有「手改」"
|
|
644
|
+
assert_not "$tmp/$current/refuse.txt" "只读" "P266:refuse 行的徽章不再写「只读」"
|
|
614
645
|
# P32:短列表(一条过滤结果)也把卡片填满 —— 空白留在卡片**里面**,卡片下边框仍紧贴键栏。
|
|
615
646
|
cap_visible_to filter-fill
|
|
616
647
|
fstats="$(settings_window_stats "$tmp/$current/filter-fill.txt")"
|
|
@@ -626,11 +657,11 @@ PYFIX
|
|
|
626
657
|
filter_to TEAM_PULSE_NUDGE_GAP
|
|
627
658
|
cap_to comment
|
|
628
659
|
assert_match "$tmp/$current/comment.txt" '重复提醒间隔 +900 · 立即生效 +# 15min' "行内注释原样渲染"
|
|
629
|
-
# M49 回退:schema 不认识的键没有标签 →
|
|
660
|
+
# M49 回退:schema 不认识的键没有标签 → 行的主文本就是原始键(「不认识」徽章 + 提示行)。
|
|
630
661
|
filter_to TEAM_HAND_ADDED
|
|
631
662
|
cap_to unknown
|
|
632
|
-
assert_match "$tmp/$current/unknown.txt" 'TEAM_HAND_ADDED +hand ·
|
|
633
|
-
assert_has "$tmp/$current/unknown.txt" "
|
|
663
|
+
assert_match "$tmp/$current/unknown.txt" 'TEAM_HAND_ADDED +hand · 不认识' "schema 不认识的键回退显示原始键"
|
|
664
|
+
assert_has "$tmp/$current/unknown.txt" "TEAM_HAND_ADDED:这个设置在文件里,工具不认识它" "未知键的提示行说清楚为什么没有标签"
|
|
634
665
|
# The filter matches the label (M49), key or value; esc clears it without closing the view.
|
|
635
666
|
filter_to 巡检周期
|
|
636
667
|
cap_to filter-label
|
|
@@ -703,33 +734,23 @@ PYFIX
|
|
|
703
734
|
local before; before="$(sha "$(cfg)")"
|
|
704
735
|
filter_to TEAM_SESSION
|
|
705
736
|
sleep 0.3
|
|
706
|
-
if focus_row '会话名
|
|
737
|
+
if focus_row '会话名 +.*不可改'; then
|
|
707
738
|
keys Enter
|
|
708
739
|
else
|
|
709
740
|
bad "没能把焦点移到 refuse 行"
|
|
710
741
|
fi
|
|
711
|
-
if wait_cap refuse-route "
|
|
742
|
+
if wait_cap refuse-route "只能改项目配置文件"; then ok "refuse 行的回执点名普通路线(不是命令行黑话)"; else bad "refuse 行的回执没出现"; fi
|
|
712
743
|
assert_eq "refuse 行没有写契约" "$(sha "$(cfg)")" "$before"
|
|
713
|
-
# P144:磁盘底线的两行
|
|
714
|
-
#
|
|
744
|
+
# P144:磁盘底线的两行 —— 行主文本是标签(不是裸键),类徽章照旧。P266:夹具缝行已经**不在视图里**
|
|
745
|
+
# (上面刚证过),它的读面与命令面由那里的断言守住。
|
|
715
746
|
filter_to 临时根空间底线
|
|
716
747
|
cap_to p144-mb
|
|
717
748
|
assert_match "$tmp/$current/p144-mb.txt" '› 临时根空间底线 +未设 · 默认 1024 · 立即生效' \
|
|
718
|
-
"P144:临时根空间底线 行是人话标签 + apply 徽章"
|
|
719
749
|
assert_not "$tmp/$current/p144-mb.txt" '临时根空间底线 +TEAM_' "P144:字节底线行主文本不是裸键"
|
|
720
750
|
filter_to inode 底线
|
|
721
751
|
if focus_row '临时根 inode 底线 +未设 · 默认 100000'; then :; else bad "P144:没能把焦点移到 inode 底线行"; fi
|
|
722
752
|
cap_to p144-ino
|
|
723
753
|
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
754
|
# M59: the navigation esc is state-checked too — it fires only while the settings view is on a
|
|
734
755
|
# settled frame, so a drifted scene gets a named red instead of a blind key.
|
|
735
756
|
pty_key_when "esc 回浮层" '╭─ 项目设置' Escape || bad "esc 前设置视图已经不在屏幕上"
|
|
@@ -758,10 +779,10 @@ PYFIX
|
|
|
758
779
|
import sys
|
|
759
780
|
p = sys.argv[1]
|
|
760
781
|
s = open(p, encoding='utf-8').read()
|
|
761
|
-
s = s.replace('TEAM_GATES|apply|cmd||plain||-|', 'TEAM_GATES|refuse|cmd||plain
|
|
782
|
+
s = s.replace('TEAM_GATES|apply|cmd||plain||-|', 'TEAM_GATES|refuse|cmd||plain||-|改门禁要改项目配置文件(scratch 夹具)')
|
|
762
783
|
anchor = 'TEAM_INSTALL_CMD|apply|cmd||plain||-|||workflow'
|
|
763
784
|
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)
|
|
785
|
+
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
786
|
open(p, 'w', encoding='utf-8').write(s)
|
|
766
787
|
PYFIX
|
|
767
788
|
cat > "$tmp/$current-scratch-wrapper.sh" <<EOF2
|
|
@@ -778,11 +799,47 @@ EOF2
|
|
|
778
799
|
wait_row scratch-key "scratch 视图里的 TEAM_ZZZ_TEST 行" 'TEAM_ZZZ_TEST' '未设 · 默认 zzz-default' \
|
|
779
800
|
|| bad "scratch CLI 新增的键行没有在预算内出现"
|
|
780
801
|
assert_match "$tmp/$current/scratch-key.txt" 'TEAM_ZZZ_TEST +未设 · 默认 zzz-default' "scratch CLI 新增的键出现在视图里(不重建 panel.js;无标签→回退裸键)"
|
|
802
|
+
# P266(设计表 248):同一张 scratch schema 里再添一行**带标记**的新键 → 它不进渲染(隐藏规则读标记,
|
|
803
|
+
# 不是 bundle 里写死的四个键名;这一行是 fixture 里从没出现过的名字)。
|
|
804
|
+
filter_to TEAM_ZZZ_FIXTURE
|
|
805
|
+
cap_to scratch-marked
|
|
806
|
+
assert_not "$tmp/$current/scratch-marked.txt" "TEAM_ZZZ_FIXTURE" "P266:带 fixture-only 标记的新键被隐藏(规则是数据,不是名单)"
|
|
807
|
+
filter_clear
|
|
781
808
|
filter_to TEAM_GATES
|
|
782
|
-
wait_row scratch-class "scratch 视图里的 TEAM_GATES
|
|
809
|
+
wait_row scratch-class "scratch 视图里的 TEAM_GATES 行(类改成不可改)" '门禁命令' 'true · 不可改' \
|
|
783
810
|
|| bad "scratch CLI 改过的类行没有在预算内出现"
|
|
784
|
-
assert_match "$tmp/$current/scratch-class.txt" '门禁命令 +true ·
|
|
785
|
-
assert_has "$tmp/$current/scratch-class.txt" "
|
|
811
|
+
assert_match "$tmp/$current/scratch-class.txt" '门禁命令 +true · 不可改' "scratch CLI 改过的类跟着变(bundle 没有第二张键表)"
|
|
812
|
+
assert_has "$tmp/$current/scratch-class.txt" "这个值要改项目配置文件 .pi/team/config.sh" "scratch CLI 的 refuse 提示行仍是那句普通路线"
|
|
813
|
+
if focus_row '门禁命令 +true · 不可改'; then keys Enter; else bad "P266:没能把焦点移到 scratch 的 refuse 行"; fi
|
|
814
|
+
if wait_cap scratch-route "改门禁要改项目配置文件(scratch 夹具)"; then
|
|
815
|
+
ok "P266:scratch CLI 自己写的备注原样上屏(路线不是写死的)"
|
|
816
|
+
else
|
|
817
|
+
bad "P266:scratch CLI 的备注没有上屏"
|
|
818
|
+
fi
|
|
819
|
+
# P266 红侧(数据驱动):把 scratch 树里夹具键的声明标记删掉 → 那一行回到视图;还原 → 又消失。
|
|
820
|
+
local marker_red_cfg
|
|
821
|
+
marker_red_cfg="$scratch/skills/teamsmith/scripts/lib/cmd-config.sh"
|
|
822
|
+
python3 - "$marker_red_cfg" <<'PYFIX'
|
|
823
|
+
import sys
|
|
824
|
+
p = sys.argv[1]
|
|
825
|
+
s = open(p, encoding='utf-8').read()
|
|
826
|
+
mark = 'fixture-only: 只在测试套件里用(磁盘读数夹具)'
|
|
827
|
+
assert mark in s, '找不到夹具键的声明标记'
|
|
828
|
+
s = s.replace('|' + mark + '||policy', '|||policy', 1)
|
|
829
|
+
open(p, 'w', encoding='utf-8').write(s)
|
|
830
|
+
PYFIX
|
|
831
|
+
P21_CLI="$tmp/$current-scratch-wrapper.sh" start_panel
|
|
832
|
+
open_view
|
|
833
|
+
filter_to 磁盘读数夹具
|
|
834
|
+
wait_row p266-marker-red "标记删掉后夹具键回到视图" '磁盘读数夹具' '不可改' \
|
|
835
|
+
|| bad "P266 红侧:删掉声明标记后那一行没有回到视图"
|
|
836
|
+
assert_match "$tmp/$current/p266-marker-red.txt" '磁盘读数夹具 +.*不可改' "P266 红侧:行回来了(隐藏跟着读侧的数据走)"
|
|
837
|
+
cp -a "$skill/scripts/lib/cmd-config.sh" "$marker_red_cfg"
|
|
838
|
+
P21_CLI="$tmp/$current-scratch-wrapper.sh" start_panel
|
|
839
|
+
open_view
|
|
840
|
+
filter_to 磁盘读数夹具
|
|
841
|
+
cap_to p266-marker-green
|
|
842
|
+
assert_not "$tmp/$current/p266-marker-green.txt" "磁盘读数夹具" "P266 还原:标记加回后那一行再次消失"
|
|
786
843
|
# M49:另一种语言的人话标签(同一张表切换,标签不是渲染时的硬编码)。
|
|
787
844
|
conf_set "lang=en" "page=1" "activity=1" "mouse=1" "density=comfortable" "theme=auto"
|
|
788
845
|
start_panel
|
|
@@ -791,6 +848,13 @@ EOF2
|
|
|
791
848
|
cap_to en
|
|
792
849
|
assert_match "$tmp/$current/en.txt" '› Patrol interval' "en 行的人话标签(行不是裸键)"
|
|
793
850
|
assert_has "$tmp/$current/en.txt" "CLI: team config set TEAM_PULSE_INTERVAL <value>" "en 的 CLI 提示行同样点名原始键"
|
|
851
|
+
# P266:两种语言的样张都要能给评审直接读(报告里贴的就是这些帧):走到尾部,两个块标题 + 席位原因。
|
|
852
|
+
filter_clear
|
|
853
|
+
sleep 0.4
|
|
854
|
+
walk_to_tail en-tail
|
|
855
|
+
assert_has "$tmp/$current/en-tail.txt" "The model the next task will use" "en 的类别块标题(下一次派任务会用的模型)"
|
|
856
|
+
assert_has "$tmp/$current/en-tail.txt" "The model running tasks actually use" "en 的席位块标题(正在运行的任务实际使用的模型)"
|
|
857
|
+
assert_has "$tmp/$current/en-tail.txt" "this seat has not been given a task yet" "en 的「这个席位还没有派过任务」(席位没有记录)"
|
|
794
858
|
|
|
795
859
|
# ── P32:视图用满窗口高度(用户实测 45 行里 16 行空白)+ 行数记账诚实 ──
|
|
796
860
|
# 同一条契约、同一个面板,只改 pane 行高:① 内容结尾(卡片下边框)到键栏的空白 ≤1 行;
|
|
@@ -802,8 +866,9 @@ EOF2
|
|
|
802
866
|
start_panel
|
|
803
867
|
open_view
|
|
804
868
|
local want_count
|
|
869
|
+
# P266:视图里的行 = schema 键(减去被声明为 fixture-only 的键)+ 类别 + 席位 + PM 启动记录。
|
|
805
870
|
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",{});
|
|
871
|
+
| 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
872
|
[ "${want_count:-0}" -gt 0 ] || bad "读数拿不到键数(前提不成立)"
|
|
808
873
|
local h s rows up down gap prev_rows=""
|
|
809
874
|
for h in 45 33 30 25; do
|
|
@@ -897,8 +962,8 @@ JSON
|
|
|
897
962
|
fi
|
|
898
963
|
cap_to bool
|
|
899
964
|
assert_match "$tmp/$current/bool.txt" '› 保持未设' "未设键的首个条目是保持未设(并且是焦点)"
|
|
900
|
-
assert_has "$tmp/$current/bool.txt" "
|
|
901
|
-
assert_has "$tmp/$current/bool.txt" "
|
|
965
|
+
assert_has "$tmp/$current/bool.txt" "(1) · 默认" "1 是默认条目,带表里的 on 词"
|
|
966
|
+
assert_has "$tmp/$current/bool.txt" "(0)" "0 是另一个条目,带表里的 off 词"
|
|
902
967
|
assert_not "$tmp/$current/bool.txt" "…(自由输入)" "bool 是封闭域:没有自由输入项"
|
|
903
968
|
local bool_sha bool_audit
|
|
904
969
|
bool_sha="$(sha "$(cfg)")"; bool_audit="$(audit_lines)"
|
|
@@ -1025,7 +1090,7 @@ PY2
|
|
|
1025
1090
|
keys Enter
|
|
1026
1091
|
wait_picker TEAM_PULSE_INTERVAL '› 保持未设' || bad "数值键的选择器没有打开"
|
|
1027
1092
|
cap_to numeric
|
|
1028
|
-
assert_has "$tmp/$current/numeric.txt" "
|
|
1093
|
+
assert_has "$tmp/$current/numeric.txt" "60–∞" "数值键显示命令给的接受区间(上界空 = 无界)"
|
|
1029
1094
|
assert_match "$tmp/$current/numeric.txt" '› 保持未设' "未设的数值键也以保持未设开头"
|
|
1030
1095
|
assert_has "$tmp/$current/numeric.txt" "900 · 默认" "建议值里的默认值带默认标记"
|
|
1031
1096
|
assert_has "$tmp/$current/numeric.txt" "1800" "建议值原样给出"
|
|
@@ -1335,7 +1400,6 @@ PY
|
|
|
1335
1400
|
sleep 0.4
|
|
1336
1401
|
keys Enter
|
|
1337
1402
|
if wait_cap confirm "→ 1200"; then ok "第一次 Enter 只给确认行(没写)"; else bad "确认行没有出现(见 confirm.txt)"; fi
|
|
1338
|
-
assert_has "$tmp/$current/confirm.txt" "下一个读取它的进程生效" "确认行说明 apply 的时机"
|
|
1339
1403
|
assert_eq "确认阶段契约未变" "$(sha "$(cfg)")" "$(sha "$tmp/$current/before.cfg")"
|
|
1340
1404
|
keys Enter
|
|
1341
1405
|
if wait_cap written "✓ 已写入 TEAM_PULSE_NUDGE_GAP = 1200"; then
|
|
@@ -1379,7 +1443,6 @@ PY
|
|
|
1379
1443
|
local b1; b1="$(sha "$(cfg)")"
|
|
1380
1444
|
keys Enter
|
|
1381
1445
|
if wait_cap invalid "最小 60"; then ok "越界数值的拒绝点名最小 60"; else bad "越界数值的拒绝没出现"; fi
|
|
1382
|
-
assert_has "$tmp/$current/invalid.txt" "不合法" "非法值的回执说明被拒"
|
|
1383
1446
|
assert_eq "非法值契约不变" "$(sha "$(cfg)")" "$b1"
|
|
1384
1447
|
cap_has "TEAM_PULSE_INTERVAL" draft-kept
|
|
1385
1448
|
leave_editor TEAM_PULSE_INTERVAL || bad "非法值用例的 esc 发了但编辑器还在"
|
|
@@ -1486,7 +1549,7 @@ scn_policy() {
|
|
|
1486
1549
|
open_view
|
|
1487
1550
|
# ① 类别行:未来策略 + 「新任务」徽章 + 命令行点名 set-task-model
|
|
1488
1551
|
filter_to 类别
|
|
1489
|
-
wait_row policy-cat "类别 routine 行(策略模型 + 新任务徽章)" '
|
|
1552
|
+
wait_row policy-cat "类别 routine 行(策略模型 + 新任务徽章)" '下一次派任务会用的模型' '类别 routine' 'kimi-coding/k3-256k' \
|
|
1490
1553
|
|| bad "类别行没有在预算内出现"
|
|
1491
1554
|
# 视图的快照行、命令行提示行都跟着**焦点**走:先把光标移到类别行,再看这一行的两半(M49)。
|
|
1492
1555
|
if focus_row '› 类别 routine'; then :; else bad "没能把焦点移到类别 routine 行"; fi
|
|
@@ -1495,19 +1558,34 @@ scn_policy() {
|
|
|
1495
1558
|
assert_has "$tmp/$current/policy-cat.txt" "team config set-task-model routine <model>" "命令行点名 set-task-model(唯一写者)"
|
|
1496
1559
|
# ② 策略 ≠ 实际:dev 的只读行显示**记录**里的模型,行里不出现策略模型
|
|
1497
1560
|
filter_to dev
|
|
1498
|
-
wait_row policy-dev "dev 的只读派单行" '
|
|
1561
|
+
wait_row policy-dev "dev 的只读派单行" '正在运行的任务实际使用的模型' 'xai/grok-4.6' \
|
|
1499
1562
|
|| bad "dev 的派单行没有在预算内出现"
|
|
1500
1563
|
if focus_row '› dev '; then :; else bad "没能把焦点移到 dev 的派单行"; fi
|
|
1501
1564
|
cap_to policy-dev
|
|
1502
|
-
assert_match "$tmp/$current/policy-dev.txt" 'dev +xai/grok-4.6 ·
|
|
1565
|
+
assert_match "$tmp/$current/policy-dev.txt" 'dev +xai/grok-4.6 · 不可改' "记录模型逐字显示(不是策略模型)"
|
|
1503
1566
|
assert_not "$tmp/$current/policy-dev.txt" "kimi-coding/k3-256k" "派单行里不出现未来策略的模型"
|
|
1504
|
-
assert_has "$tmp/$current/policy-dev.txt" "
|
|
1505
|
-
assert_has "$tmp/$current/policy-dev.txt" "只读:实际模型来自已提交的派单记录" "命令行说明这是派单决定的只读面"
|
|
1567
|
+
assert_has "$tmp/$current/policy-dev.txt" "会话 sid-dev-232" "派单行带已提交的会话号"
|
|
1506
1568
|
# ③ 没有记录的席位:不借策略模型
|
|
1507
1569
|
filter_to verify
|
|
1508
|
-
wait_row policy-verify "verify
|
|
1570
|
+
wait_row policy-verify "verify 的「还没有派过任务」行" 'verify' '这个席位还没有派过任务' \
|
|
1509
1571
|
|| bad "无记录席位行没有在预算内出现"
|
|
1510
1572
|
assert_not "$tmp/$current/policy-verify.txt" "kimi-coding/k3-256k" "无记录席位行不借未来策略的模型"
|
|
1573
|
+
# ③b P266(设计表的红侧第二格):同一个席位换成一份「存在、但读不出来」的记录(旧格式:版本不是 1)
|
|
1574
|
+
# → 说法换成另一句。面板从读侧的 record_present 事实选措辞(无文件 = 没派过;有文件 = 读不出来),
|
|
1575
|
+
# 不解析诊断字符串。
|
|
1576
|
+
printf 'assignment_version=0\nseat=verify\nmodel=vendor/legacy\n' > "$state/verify.env"
|
|
1577
|
+
reopen_view
|
|
1578
|
+
filter_to verify
|
|
1579
|
+
wait_row policy-unreadable "record_present=true:有记录但读不出来" 'verify' '这个席位派过任务,但它的记录读不出来' \
|
|
1580
|
+
|| bad "「读不出来」的席位行没有在预算内出现"
|
|
1581
|
+
assert_not "$tmp/$current/policy-unreadable.txt" "还没有派过任务" "P266:有记录但读不出来时不说「还没派过任务」(两个原因分得开)"
|
|
1582
|
+
assert_not "$tmp/$current/policy-unreadable.txt" "legacy/unknown assignment_version" "P266:命令的诊断字符串不上屏"
|
|
1583
|
+
local pol_json_verify
|
|
1584
|
+
pol_json_verify="$( ( cd "$ROOT" && bash "$skill/scripts/team" config list --json ) \
|
|
1585
|
+
| 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")))' )"
|
|
1586
|
+
assert_eq "P266:读侧把这一行报成 assigned=false 且 record_present=true(诊断只留给机器)" \
|
|
1587
|
+
"$pol_json_verify" "assigned=False record_present=True diagnostic=legacy/unknown assignment_version"
|
|
1588
|
+
rm -f "$state/verify.env"
|
|
1511
1589
|
# ④ 一次类别直写:picker 用项目自己的词表,写走 set-task-model 的 dry-run → --yes
|
|
1512
1590
|
filter_to 类别
|
|
1513
1591
|
sleep 0.5
|
|
@@ -1534,8 +1612,7 @@ scn_policy() {
|
|
|
1534
1612
|
fi
|
|
1535
1613
|
cap_to policy-written
|
|
1536
1614
|
assert_not "$tmp/$current/policy-written.txt" "确认:" "值条目直写没有确认帧"
|
|
1537
|
-
assert_has "$tmp/$current/policy-written.txt" "
|
|
1538
|
-
assert_has "$tmp/$current/policy-written.txt" "没有重启任何进程" "回执说明没有进程被重启"
|
|
1615
|
+
assert_has "$tmp/$current/policy-written.txt" "只影响以后派的新任务" "回执说明只影响以后派的新任务"
|
|
1539
1616
|
argv_since "$pol_argv" "$tmp/$current/policy-argv.log"
|
|
1540
1617
|
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
1618
|
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 +1679,6 @@ scn_categories() {
|
|
|
1602
1679
|
if wait_cap pm-written "已写入 PM 模型"; then ok "PM 编辑落盘"; else bad "PM 的写入回执没有出现"; fi
|
|
1603
1680
|
cap_to pm-written
|
|
1604
1681
|
assert_has "$tmp/$current/pm-written.txt" "fresh-pm" "PM 回执点名换模型的 fresh-pm 守卫"
|
|
1605
|
-
assert_has "$tmp/$current/pm-written.txt" "没有重启任何进程" "PM 回执说明没有进程被重启"
|
|
1606
1682
|
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
1683
|
assert_match "$(argv_log)" 'config set TEAM_PM_MODEL kimi-coding/k3-256k --actor panel --yes --fingerprint [0-9a-f]{64}' "argv 记录 PM 的写入"
|
|
1608
1684
|
assert_eq "PM 写入审计长一行" "$(audit_lines)" "$((pm_audit + 1))"
|
|
@@ -1624,15 +1700,15 @@ scn_categories() {
|
|
|
1624
1700
|
|| bad "整映射删除 routine 失败"
|
|
1625
1701
|
reopen_view
|
|
1626
1702
|
filter_to dev
|
|
1627
|
-
wait_row cat-kept "删类别后 dev 的派单行仍在" 'xai/grok-4.6' '
|
|
1703
|
+
wait_row cat-kept "删类别后 dev 的派单行仍在" 'xai/grok-4.6' '会话 sid-dev-232' \
|
|
1628
1704
|
|| bad "删类别后派单行没有在预算内出现"
|
|
1629
|
-
assert_match "$tmp/$current/cat-kept.txt" 'dev +xai/grok-4.6 ·
|
|
1630
|
-
assert_has "$tmp/$current/cat-kept.txt" "
|
|
1705
|
+
assert_match "$tmp/$current/cat-kept.txt" 'dev +xai/grok-4.6 · 不可改' "删类别后记录模型仍是记录里的值"
|
|
1706
|
+
assert_has "$tmp/$current/cat-kept.txt" "会话 sid-dev-232" "删类别后会话号原样"
|
|
1631
1707
|
filter_to 类别
|
|
1632
1708
|
cap_to cat-deleted
|
|
1633
1709
|
assert_not "$tmp/$current/cat-deleted.txt" "类别 routine" "被删的类别不再有策略行"
|
|
1634
1710
|
assert_match "$tmp/$current/cat-deleted.txt" '类别 (analysis|verify)' "其余类别照旧在策略块里"
|
|
1635
|
-
assert_match "$tmp/$current/cat-deleted.txt" '^│ ──
|
|
1711
|
+
assert_match "$tmp/$current/cat-deleted.txt" '^│ ── 下一次派任务会用的模型 ─+' "类别块本身还在(只删了 routine)"
|
|
1636
1712
|
# ⑥ 无 spawn/重启:整段没有任何 dispatch/resume/restart,窗口集合不变
|
|
1637
1713
|
argv_since "$scn_argv" "$tmp/$current/categories-argv.log"
|
|
1638
1714
|
assert_not "$tmp/$current/categories-argv.log" "dispatch" "整个场景没有 dispatch"
|
|
@@ -1647,21 +1723,21 @@ scn_categories() {
|
|
|
1647
1723
|
open_view
|
|
1648
1724
|
# 诊断行按 头…尾 换行(不截断路线):命令原文可能跨两行,所以断言的是路线的**词**都在屏幕上
|
|
1649
1725
|
# (升级命令名 + 它的参数),而不是一整串连续子串。
|
|
1650
|
-
wait_row legacy-diagnosis "遗留配置的迁移诊断" '
|
|
1726
|
+
wait_row legacy-diagnosis "遗留配置的迁移诊断" '旧设置需要升级' '含退休键' 'upgrade-models' \
|
|
1651
1727
|
|| bad "遗留配置的迁移诊断没有在预算内出现"
|
|
1652
1728
|
assert_has "$tmp/$current/legacy-diagnosis.txt" "upgrade-models" "诊断给出 CLI 升级命令(命令名可见)"
|
|
1653
1729
|
assert_has "$tmp/$current/legacy-diagnosis.txt" "--task-models" "诊断给出升级命令的参数(不被截掉)"
|
|
1654
1730
|
assert_has "$tmp/$current/legacy-diagnosis.txt" "--dry-run" "诊断给出升级命令的预览步骤(不被截掉)"
|
|
1655
1731
|
assert_has "$tmp/$current/legacy-diagnosis.txt" "TEAM_DEFAULT_MODEL" "诊断点名退休键"
|
|
1656
1732
|
local legacy_cat_heading
|
|
1657
|
-
legacy_cat_heading="$(cap_line_heading "$tmp/$current/legacy-diagnosis.txt" '
|
|
1733
|
+
legacy_cat_heading="$(cap_line_heading "$tmp/$current/legacy-diagnosis.txt" '下一次派任务会用的模型')"
|
|
1658
1734
|
assert_eq "遗留配置没有可编辑的类别块(没有假的可编辑策略)" "$legacy_cat_heading" "0"
|
|
1659
1735
|
filter_to TEAM_DEFAULT_MODEL
|
|
1660
1736
|
# 筛选也匹配行内注释(M49 的既有口径),而 TEAM_PM_MODEL 的初始化注释里就写着 TEAM_DEFAULT_MODEL ——
|
|
1661
1737
|
# 所以这里必须先把光标走到退休键那一行,否则回车打到的是 PM 行(第一遍就是这么红的)。
|
|
1662
1738
|
if focus_row '› TEAM_DEFAULT_MODEL'; then :; else bad "没能把焦点移到退休键行"; fi
|
|
1663
1739
|
cap_to legacy-key
|
|
1664
|
-
assert_match "$tmp/$current/legacy-key.txt" 'TEAM_DEFAULT_MODEL
|
|
1740
|
+
assert_match "$tmp/$current/legacy-key.txt" 'TEAM_DEFAULT_MODEL +.*不认识' "退休键变成只读的未知键行(没有席位默认编辑器)"
|
|
1665
1741
|
keys Enter
|
|
1666
1742
|
if wait_cap legacy-route "不是已知的项目设置"; then ok "退休键的回执点名它不在 schema 里(不给编辑)"; else bad "退休键的回执没有出现"; fi
|
|
1667
1743
|
cap_to legacy-route
|
|
@@ -1843,11 +1919,18 @@ foot = next((i for i, l in enumerate(lines) if i > bot and ('\u5199\u4fe1' in l
|
|
|
1843
1919
|
if top < 0 or bot < 0 or foot < 0:
|
|
1844
1920
|
print('-1 -1 -1 -1'); sys.exit(0)
|
|
1845
1921
|
interior = lines[top + 1:bot]
|
|
1846
|
-
|
|
1847
|
-
|
|
1922
|
+
# P266:尾部只剩聚焦行的 CLI 提示行(有迁移诊断时还有它那一块)——不再有审计块。内容的最后一条
|
|
1923
|
+
# 非空行就是提示行(或诊断的最后一行);诊断存在时,尾部从诊断标题那一行开始(提示行在它上面,也
|
|
1924
|
+
# 属于尾部)。
|
|
1925
|
+
content = [i for i, l in enumerate(interior) if l.strip('\u2502 ').rstrip()]
|
|
1926
|
+
if not content:
|
|
1848
1927
|
print('-1 -1 -1 -1'); sys.exit(0)
|
|
1849
|
-
|
|
1850
|
-
|
|
1928
|
+
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)
|
|
1929
|
+
if diag >= 0:
|
|
1930
|
+
above = [i for i in content if i < diag]
|
|
1931
|
+
tail_start = above[-1] if above else diag
|
|
1932
|
+
else:
|
|
1933
|
+
tail_start = content[-1]
|
|
1851
1934
|
rows = up = down = 0
|
|
1852
1935
|
for i, l in enumerate(interior):
|
|
1853
1936
|
b = l.strip('\u2502 ').rstrip()
|
|
@@ -1953,7 +2036,9 @@ walk_to_tail() { # <capture name>
|
|
|
1953
2036
|
for i in $(seq 1 140); do keys Down; sleep 0.01; done
|
|
1954
2037
|
for i in $(seq 1 12); do
|
|
1955
2038
|
cap_to "$name"
|
|
1956
|
-
|
|
2039
|
+
# P266:类别块的标题改成普通话(两种语言各一条)——尾部的“到了”判据跟着标题走。
|
|
2040
|
+
if { grep -q '下一次派任务会用的模型' "$tmp/$current/$name.txt" || grep -q 'The model the next task will use' "$tmp/$current/$name.txt"; } \
|
|
2041
|
+
&& grep -q '›' "$tmp/$current/$name.txt"; then hit=1; break; fi
|
|
1957
2042
|
sleep 0.4 # 块被 TTL 重读换成摘要行(已知现象)→ 等它回来,必要时再走一轮
|
|
1958
2043
|
done
|
|
1959
2044
|
[ "$hit" = 1 ] && break
|
|
@@ -1979,7 +2064,6 @@ scn_groups() {
|
|
|
1979
2064
|
assert_has "$tmp/$current/view.txt" "身份与账本布局" "第一组标题是 identity 的功能域名"
|
|
1980
2065
|
# P32(用户的第一条反馈):标题与选项行必须在渲染上可区分。标题是分节线(── 标题 ────),
|
|
1981
2066
|
# 键行不带分节线;标题行同时把两组隔开(上一行=上一组最后一条,下一行=本组第一条)。
|
|
1982
|
-
assert_match "$tmp/$current/view.txt" '^│ ── 身份与账本布局 ─+' "分组标题是分节线(不是缩进的普通行)"
|
|
1983
2067
|
assert_no_match "$tmp/$current/view.txt" '^│ [› ] 项目名.*─' "键行不带分节线(标题/行在渲染上可区分)"
|
|
1984
2068
|
assert_heading_rule "$tmp/$current/view.txt" "分支与 forge" "契约文件" "分支命名模式" "组间可见分隔:标题是分节线且夹在两组之间"
|
|
1985
2069
|
# 读取顺序:identity 的 12 条走完,下一组标题就是 branch(窗口跟着焦点,标题只在它的行进窗时画)。
|
|
@@ -2017,32 +2101,30 @@ scn_groups() {
|
|
|
2017
2101
|
assert_match "$tmp/$current/tone-restart.txt" '巡检周期 +.*需重启' "restart 行的徽章词仍在"
|
|
2018
2102
|
assert_badge_tone "$tmp/$current/tone-restart-e.txt" '巡检周期' '需重启' 'warn' "restart 徽章 = warn tone"
|
|
2019
2103
|
filter_to TEAM_PROJECT
|
|
2020
|
-
wait_row tone-refuse "refuse 徽章行" '项目名' 'root ·
|
|
2104
|
+
wait_row tone-refuse "refuse 徽章行" '项目名' 'root · 不可改' \
|
|
2021
2105
|
|| bad "refuse 行没有在预算内出现"
|
|
2022
2106
|
cap_e_to tone-refuse-e
|
|
2023
|
-
assert_match "$tmp/$current/tone-refuse.txt" '项目名 +root ·
|
|
2024
|
-
assert_badge_tone "$tmp/$current/tone-refuse-e.txt" '项目名' '
|
|
2107
|
+
assert_match "$tmp/$current/tone-refuse.txt" '项目名 +root · 不可改' "refuse 行的徽章词仍在"
|
|
2108
|
+
assert_badge_tone "$tmp/$current/tone-refuse-e.txt" '项目名' '不可改' 'dim' "refuse 徽章 = dim tone"
|
|
2025
2109
|
# ④ 可见降级:schema 不认识的键落在「未分组」,且「未分组」在席位块之前(走到列表末尾看)。
|
|
2026
2110
|
filter_to TEAM_HAND_ADDED
|
|
2027
|
-
wait_row hand-added "未分组里的手加未知键行" 'TEAM_HAND_ADDED' 'hand ·
|
|
2111
|
+
wait_row hand-added "未分组里的手加未知键行" 'TEAM_HAND_ADDED' 'hand · 不认识' \
|
|
2028
2112
|
|| bad "未知键的行没有在预算内出现"
|
|
2029
|
-
assert_match "$tmp/$current/hand-added.txt" 'TEAM_HAND_ADDED +hand ·
|
|
2030
|
-
assert_has "$tmp/$current/hand-added.txt" "
|
|
2113
|
+
assert_match "$tmp/$current/hand-added.txt" 'TEAM_HAND_ADDED +hand · 不认识' "未知键的行仍在(没有消失)"
|
|
2114
|
+
assert_has "$tmp/$current/hand-added.txt" "TEAM_HAND_ADDED:这个设置在文件里" "未知键仍按原始键点名"
|
|
2031
2115
|
[ "$(cap_line_heading "$tmp/$current/hand-added.txt" '未分组')" -gt 0 ] \
|
|
2032
2116
|
&& ok "未知键落在可见的「未分组」标题下" || bad "未知键没有落在「未分组」标题下"
|
|
2033
|
-
assert_match "$tmp/$current/hand-added.txt" '^│ ── 未分组 ─+' "降级组标题也是同一种分节线(标题体系一致)"
|
|
2034
2117
|
filter_clear
|
|
2035
2118
|
sleep 0.4
|
|
2036
2119
|
walk_to_tail tail
|
|
2037
2120
|
local n_ungrouped n_categories
|
|
2038
2121
|
n_ungrouped="$(cap_line_heading "$tmp/$current/tail.txt" '未分组')"
|
|
2039
|
-
n_categories="$(cap_line_heading "$tmp/$current/tail.txt" '
|
|
2122
|
+
n_categories="$(cap_line_heading "$tmp/$current/tail.txt" '下一次派任务会用的模型')"
|
|
2040
2123
|
if [ "$n_ungrouped" -gt 0 ] && [ "$n_categories" -gt 0 ] && [ "$n_ungrouped" -lt "$n_categories" ]; then
|
|
2041
2124
|
ok "「未分组」在类别块之前(未分组=$n_ungrouped < 任务类别=$n_categories)"
|
|
2042
2125
|
else
|
|
2043
2126
|
bad "尾部顺序不对(未分组=$n_ungrouped 任务类别=$n_categories)"
|
|
2044
2127
|
fi
|
|
2045
|
-
assert_match "$tmp/$current/tail.txt" '^│ ── 任务类别(未来策略) ─+' "类别块标题也是同一种分节线(标题体系一致)"
|
|
2046
2128
|
# ⑤ 无键→域表:scratch CLI 让 TEAM_ZZZ_TEST 带 workflow、把 TEAM_GATES 移到 meeting;
|
|
2047
2129
|
# 提交的那份 bundle 必须跟着两个标题走(bundle 里没有第二张键表/组表)。
|
|
2048
2130
|
local scratch="$tmp/$current/scratch"
|
|
@@ -2110,7 +2192,7 @@ PY
|
|
|
2110
2192
|
assert_has "$tmp/$current/tail-scratch.txt" "门禁命令" "降级组里畸形行同屏(schema 行可见)"
|
|
2111
2193
|
local n_u n_s
|
|
2112
2194
|
n_u="$(cap_line_heading "$tmp/$current/tail-scratch.txt" '未分组')"
|
|
2113
|
-
n_s="$(cap_line_heading "$tmp/$current/tail-scratch.txt" '
|
|
2195
|
+
n_s="$(cap_line_heading "$tmp/$current/tail-scratch.txt" '下一次派任务会用的模型')"
|
|
2114
2196
|
if [ "$n_u" -gt 0 ] && [ "$n_s" -gt 0 ] && [ "$n_u" -lt "$n_s" ]; then
|
|
2115
2197
|
ok "scratch 尾部:「未分组」仍在类别块之前($n_u < $n_s)"
|
|
2116
2198
|
else
|
|
@@ -2144,7 +2226,7 @@ PY
|
|
|
2144
2226
|
# ② 视图里的滚轮:一格一行、焦点不动、顶部计数行跟随(先下滚 3 格,再上滚回顶部)。
|
|
2145
2227
|
open_view
|
|
2146
2228
|
cap_to wheel-before
|
|
2147
|
-
assert_match "$tmp/$current/wheel-before.txt" '› 项目名
|
|
2229
|
+
assert_match "$tmp/$current/wheel-before.txt" '› 项目名 +.*不可改' "视图开屏焦点在第一行(identity 第一条)"
|
|
2148
2230
|
wheel_at down 20 10 3
|
|
2149
2231
|
local i
|
|
2150
2232
|
for i in $(seq 1 20); do
|
|
@@ -2155,7 +2237,8 @@ PY
|
|
|
2155
2237
|
assert_match "$tmp/$current/wheel-down.txt" '↑3' "下滚 3 格:顶部计数行读出 ↑3(窗口正好移 3 行)"
|
|
2156
2238
|
assert_not "$tmp/$current/wheel-down.txt" "项目名" "下滚 3 格:原本第一行(项目名)已出窗"
|
|
2157
2239
|
assert_has "$tmp/$current/wheel-down.txt" "名册" "下滚 3 格:后面的行进窗(窗口第一行 = 第 4 条)"
|
|
2158
|
-
|
|
2240
|
+
assert_no_match "$tmp/$current/wheel-down.txt" '›' "下滚 3 格:焦点没动(光标落在已出窗的项目名上,窗口里没有光标行)"
|
|
2241
|
+
assert_has "$tmp/$current/wheel-down.txt" "这个值要改项目配置文件 .pi/team/config.sh,界面不能改" "下滚 3 格:命令行提示仍在"
|
|
2159
2242
|
wheel_at up 20 10 3
|
|
2160
2243
|
for i in $(seq 1 20); do
|
|
2161
2244
|
cap_to wheel-up
|
|
@@ -2177,7 +2260,7 @@ PY
|
|
|
2177
2260
|
|| bad "↓ 之后窗口没有被推到聚焦行上"
|
|
2178
2261
|
assert_match "$tmp/$current/wheel-push.txt" '↑1' "↓ 之后窗口被推到聚焦行上(顶部计数行 = ↑1)"
|
|
2179
2262
|
assert_match "$tmp/$current/wheel-push.txt" '› 会话名' "光标落在下一条(会话名)"
|
|
2180
|
-
assert_has "$tmp/$current/wheel-push.txt" "
|
|
2263
|
+
assert_has "$tmp/$current/wheel-push.txt" "这个值要改项目配置文件 .pi/team/config.sh,界面不能改" "命令行提示与光标同一屏(焦点在会话名上)"
|
|
2181
2264
|
keys Up
|
|
2182
2265
|
# `↑` 计数行消失(字面 needle:`!↑1` = 刚才那条 ↑1 不再在屏幕上;pty-wait 是 grep -F,不吃正则,
|
|
2183
2266
|
# 所以不能用原断言的 `↑[0-9]+`;下面的 assert_no_match 仍守住正则面)。
|
|
@@ -2186,8 +2269,8 @@ PY
|
|
|
2186
2269
|
assert_match "$tmp/$current/wheel-push-back.txt" '› 项目名' "↑ 之后光标回到第一条"
|
|
2187
2270
|
assert_no_match "$tmp/$current/wheel-push-back.txt" '↑[0-9]+' "窗口跟着回到顶部(计数行消失)"
|
|
2188
2271
|
keys Enter
|
|
2189
|
-
if wait_cap wheel-enter "
|
|
2190
|
-
ok "enter 打开的行 =
|
|
2272
|
+
if wait_cap wheel-enter "只能改项目配置文件 .pi/team/config.sh 里的这一行"; then
|
|
2273
|
+
ok "enter 打开的行 = 回执点名的那一行(项目名的只读路线)"
|
|
2191
2274
|
else
|
|
2192
2275
|
bad "enter 之后没有出现聚焦行的路线回执"
|
|
2193
2276
|
fi
|