teamsmith 0.4.5 → 0.4.7
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 +6 -6
- package/package.json +1 -1
- package/skills/teamsmith/CHANGELOG.md +37 -1
- package/skills/teamsmith/SKILL.md +32 -23
- package/skills/teamsmith/extension/team-bg.ts +12 -11
- package/skills/teamsmith/extension/team-inbox-watch.ts +149 -5
- package/skills/teamsmith/extension/team-notify.ts +20 -13
- package/skills/teamsmith/extension/team-remind.ts +189 -0
- package/skills/teamsmith/extension/team-reply.ts +4 -7
- package/skills/teamsmith/references/migration.md +101 -0
- package/skills/teamsmith/references/openspec.md +43 -27
- package/skills/teamsmith/references/protocol.md +28 -18
- package/skills/teamsmith/references/reminders.md +133 -98
- package/skills/teamsmith/references/troubleshooting.md +12 -7
- package/skills/teamsmith/references/workflows.md +85 -34
- package/skills/teamsmith/scripts/lib/cmd-agents.sh +28 -5
- package/skills/teamsmith/scripts/lib/cmd-project.sh +100 -15
- package/skills/teamsmith/scripts/lib/cmd-remind.sh +135 -10
- package/skills/teamsmith/scripts/lib/cmd-review.sh +42 -4
- package/skills/teamsmith/scripts/lib/cmd-update.sh +90 -88
- package/skills/teamsmith/scripts/lib/cmd-watch.sh +322 -159
- package/skills/teamsmith/scripts/lib/common.sh +156 -26
- package/skills/teamsmith/scripts/panel/panel.js +182 -182
- package/skills/teamsmith/scripts/panel/src/data.ts +113 -6
- package/skills/teamsmith/scripts/panel/src/layout.ts +26 -4
- package/skills/teamsmith/scripts/panel/src/main.tsx +103 -14
- package/skills/teamsmith/scripts/remind-capability.mjs +261 -0
- package/skills/teamsmith/scripts/remind-store.mjs +404 -17
- package/skills/teamsmith/scripts/remind-tick.mjs +105 -0
- package/skills/teamsmith/scripts/reminder-delivery.mjs +76 -0
- package/skills/teamsmith/scripts/reply-capture.mjs +8 -9
- package/skills/teamsmith/scripts/state-authority.mjs +334 -20
- package/skills/teamsmith/scripts/strings/commands.tsv +3 -3
- package/skills/teamsmith/scripts/strings/help.en.tsv +12 -12
- package/skills/teamsmith/scripts/strings/help.zh.tsv +12 -12
- package/skills/teamsmith/scripts/team +4 -3
- package/skills/teamsmith/templates/AGENTS.section.md.tmpl +13 -11
- package/skills/teamsmith/templates/DECISIONS.md.tmpl +2 -2
- package/skills/teamsmith/templates/OWNERSHIP.md.tmpl +3 -3
- package/skills/teamsmith/templates/PROTOCOL.md.tmpl +19 -14
- package/skills/teamsmith/templates/memory-seed.md.tmpl +2 -2
- package/skills/teamsmith/templates/pm-prompt.md.tmpl +36 -18
- package/skills/teamsmith/templates/report.md.tmpl +33 -0
- package/skills/teamsmith/tests/bg-ledger-harness.mjs +217 -33
- package/skills/teamsmith/tests/bg-ledger.sh +24 -10
- package/skills/teamsmith/tests/checkout-shape-probe.sh +7 -6
- package/skills/teamsmith/tests/death-cause.sh +5 -0
- package/skills/teamsmith/tests/fixtures/remind-adversarial-delay.ts +27 -0
- package/skills/teamsmith/tests/fixtures/remind-tool-provider.ts +65 -0
- package/skills/teamsmith/tests/help-surface.sh +14 -151
- package/skills/teamsmith/tests/isolation-ledger.sh +89 -0
- package/skills/teamsmith/tests/key-replies-ui.sh +53 -0
- package/skills/teamsmith/tests/key-replies.sh +307 -106
- package/skills/teamsmith/tests/lib/main-team-fingerprint.sh +17 -1
- package/skills/teamsmith/tests/lib/routes-pages.sh +243 -0
- package/skills/teamsmith/tests/live-capture-probe.sh +12 -2
- package/skills/teamsmith/tests/loop-inventory.tsv +1 -0
- package/skills/teamsmith/tests/panel-b3-stub.sh +9 -2
- package/skills/teamsmith/tests/pulse-nudge-key.sh +5 -0
- package/skills/teamsmith/tests/remind-adversarial-faults.mjs +163 -0
- package/skills/teamsmith/tests/remind-adversarial-faults.sh +26 -0
- package/skills/teamsmith/tests/remind-adversarial-real.sh +27 -0
- package/skills/teamsmith/tests/remind-cli.sh +108 -3
- package/skills/teamsmith/tests/remind-delivery-node.mjs +189 -0
- package/skills/teamsmith/tests/remind-delivery.sh +699 -0
- package/skills/teamsmith/tests/remind-lifecycle.sh +197 -0
- package/skills/teamsmith/tests/remind-pulse.sh +199 -0
- package/skills/teamsmith/tests/remind-recovery-real.sh +5 -0
- package/skills/teamsmith/tests/remind-recovery-unit.sh +118 -0
- package/skills/teamsmith/tests/remind-tool-node.mjs +159 -0
- package/skills/teamsmith/tests/remind-tool-real.mjs +754 -0
- package/skills/teamsmith/tests/remind-tool-real.sh +5 -0
- package/skills/teamsmith/tests/reply-capture-real.mjs +93 -2
- package/skills/teamsmith/tests/routes.sh +213 -293
- package/skills/teamsmith/tests/section-paths.tsv +14 -12
- package/skills/teamsmith/tests/smoke.sh +876 -130
- package/skills/teamsmith/tests/state-authority.sh +392 -28
- package/skills/teamsmith/tests/team-inbox-watch-harness.mjs +58 -8
- package/skills/teamsmith/tests/tmux-identity-leak.sh +12 -16
- package/skills/teamsmith-init/SKILL.md +5 -5
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/__pycache__/judge-second.cpython-313.pyc +0 -0
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# remind-delivery.sh — P423(change: agent-self-reminder 3.1/3.2 · 4.1)的隔离夹具
|
|
3
|
+
#
|
|
4
|
+
# 它证的是「叫醒这条线」:到点入队 → 冻结一批 → 一条完整消息 → 匹配的回执 → 至多一次退待命 →
|
|
5
|
+
# 重启补发 / 不重发。全部在自己的临时根里(每个仓库先 git init、显式 --root 与 TEAM_STATE_DIR、
|
|
6
|
+
# HOME/TMPDIR 指向夹具自己的目录、继承来的 TEAM_* 与 tmux 身份一律清掉)。
|
|
7
|
+
#
|
|
8
|
+
# A 到期入队 不到点不入队;到点的只入一次(重复巡检不加第二条);取消的项不入队;
|
|
9
|
+
# overdue 的两种形状(到期早于本巡检实例 / 入队滞后超 30s),正常轮询延迟不标 overdue
|
|
10
|
+
# B 冻结批次 按入队顺序把当前成员全部冻结成一批;已有一批在飞时拒绝再冻(不重复送);
|
|
11
|
+
# 观察后下一批立即可发;成员记录带批次 id
|
|
12
|
+
# C 观察与待命 匹配的回执 → observed + 花掉唯一 right + 自动退当前代次 + 一条点名全部 id/来源的审计;
|
|
13
|
+
# 手动已 off → already-off;更新的代次 → 保留并报 ambiguous;重复事件不产生第二次 off;
|
|
14
|
+
# nonce/会话/成员不符(含同长度乱序)→ 拒绝且不消耗 right
|
|
15
|
+
# D 未送达 queued / intent / failed-unknown 都不清待命;只有真回执才清
|
|
16
|
+
# E 失败与确认 API 拒绝 → unknown(可见、不重发、attempts 记账);unknown 挡住下一批;
|
|
17
|
+
# resolve 必须显式 --ack-unknown;确认后成员 resolved、right 烧掉、下一批可以再冻
|
|
18
|
+
# F 重启恢复 queued 在新进程里照样被冻结送出;intent 超过 60s → unknown 且不重发;
|
|
19
|
+
# observed/resolved 不会被重新入队或重发
|
|
20
|
+
# G 投递面 reminderContent/details/matchesObservation 的契约 + 真扩展(假 Pi 宿主):一批一条
|
|
21
|
+
# followUp 消息、先 intent 后发、匹配事件观察一次、重复事件无效、shutdown 后不再发
|
|
22
|
+
# H 隔离 跑完主项目 `.pi/team` 的非白名单路径零变化(与 §66/§67 共用同一份判据)
|
|
23
|
+
#
|
|
24
|
+
# 红侧(`--flip=<id>`,每条都必须能红;不带参数时全跑):
|
|
25
|
+
# --flip=admit-any 入队不看到期时间 → A 的「不到点不入队」必须红
|
|
26
|
+
# --flip=intent-multi 不看已有一批在飞 → B 的「拒绝再冻」必须红
|
|
27
|
+
# --flip=observe-nogen 观察不再核对待命代次 → C 的「更新代次必须保留」必须红
|
|
28
|
+
# --flip=members-length 成员只比长度不比顺序 → C 的「同长度乱序必须拒绝」必须红
|
|
29
|
+
# --flip=off-on-queue 入队就把待命关掉 → D 的「未送达不得清待命」必须红
|
|
30
|
+
# --flip=unknown-resend unknown 不再挡住下一批 → E 的「unknown 挡住下一批」必须红
|
|
31
|
+
# 红侧跑在 scratch 副本上(只复制 state-authority.mjs + remind-store.mjs,import 关系与产品相同),
|
|
32
|
+
# 真树与产品文件不动;每条变异都先证明落地,再判它给出的是错误答案。
|
|
33
|
+
#
|
|
34
|
+
# 用法:bash tests/remind-delivery.sh [--flip=<id>]…
|
|
35
|
+
# 退出码:0 全绿 / 1 有失败 / 2 参数不认识 / 3 前提缺失(JS 运行时或 flock;可见跳过,不算通过)
|
|
36
|
+
set -uo pipefail
|
|
37
|
+
|
|
38
|
+
HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
39
|
+
SKILL="$(cd -P "$HERE/.." && pwd)"
|
|
40
|
+
TEAM_CLI="$SKILL/scripts/team"
|
|
41
|
+
|
|
42
|
+
FLIPS=()
|
|
43
|
+
for arg in "$@"; do
|
|
44
|
+
case "$arg" in
|
|
45
|
+
--flip=*)
|
|
46
|
+
case "${arg#--flip=}" in
|
|
47
|
+
admit-any|intent-multi|observe-nogen|members-length|off-on-queue|unknown-resend|batch-cap|batch-spacing) FLIPS+=("${arg#--flip=}") ;;
|
|
48
|
+
*) printf 'remind-delivery:不认识的 --flip 值 [%s]\n' "${arg#--flip=}" >&2; exit 2 ;;
|
|
49
|
+
esac ;;
|
|
50
|
+
-h|--help) sed -n '2,33p' "$0"; exit 0 ;;
|
|
51
|
+
*) printf 'remind-delivery:不认识的参数 [%s]\n' "$arg" >&2; exit 2 ;;
|
|
52
|
+
esac
|
|
53
|
+
done
|
|
54
|
+
arm_selected() {
|
|
55
|
+
[ "${#FLIPS[@]}" -eq 0 ] && return 0
|
|
56
|
+
local f; for f in "${FLIPS[@]}"; do [ "$f" = "$1" ] && return 0; done
|
|
57
|
+
return 1
|
|
58
|
+
}
|
|
59
|
+
FLIPS_RUN=""
|
|
60
|
+
|
|
61
|
+
# shellcheck source=lib/tmp-root.sh
|
|
62
|
+
. "$HERE/lib/tmp-root.sh"
|
|
63
|
+
# shellcheck source=lib/main-team-fingerprint.sh
|
|
64
|
+
. "$HERE/lib/main-team-fingerprint.sh"
|
|
65
|
+
|
|
66
|
+
RUNNER="$(team_js_runner)"
|
|
67
|
+
if [ -z "$RUNNER" ]; then
|
|
68
|
+
printf 'remind-delivery:前提缺失 —— 没有 JS 运行时;这是可见跳过,不是通过\n' >&2
|
|
69
|
+
exit 3
|
|
70
|
+
fi
|
|
71
|
+
if ! command -v flock >/dev/null 2>&1; then
|
|
72
|
+
printf 'remind-delivery:前提缺失 —— 这台机器没有 flock,权威层按设计拒绝工作(可见跳过,不是通过)\n' >&2
|
|
73
|
+
exit 3
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
ROOT="$(tmp_root_create remind-delivery)" || exit 3
|
|
77
|
+
trap 'tmp_root_reap_all' EXIT
|
|
78
|
+
mkdir -p "$ROOT/home" "$ROOT/tmp" "$ROOT/fx" "$ROOT/out" "$ROOT/script"
|
|
79
|
+
export HOME="$ROOT/home"
|
|
80
|
+
unset TEAM_ROOT TEAM_MAIN_ROOT TEAM_PROJECT TEAM_SESSION TEAM_SESSION_FROM TEAM_STATE_DIR TEAM_CONFIG_FILE \
|
|
81
|
+
TEAM_IDENTITY_LOCKED TEAM_IDENTITY_ROOT TEAM_IDENTITY_MAIN_ROOT TEAM_IDENTITY_PROJECT \
|
|
82
|
+
TEAM_IDENTITY_INHERIT_ROOT TEAM_IDENTITY_INHERIT_MAIN_ROOT TEAM_IDENTITY_INHERIT_PROJECT \
|
|
83
|
+
TEAM_IDENTITY_INHERIT_SESSION TEAM_ALLOW_FOREIGN_IDENTITY TMUX TMUX_PANE \
|
|
84
|
+
TEAM_INBOX_WATCH_TARGET TEAM_REMIND_POLL_MS 2>/dev/null || true
|
|
85
|
+
|
|
86
|
+
PASS=0; FAIL=0
|
|
87
|
+
ok() { printf ' \033[32m✓\033[0m %s\n' "$1"; PASS=$((PASS + 1)); }
|
|
88
|
+
bad() { printf ' \033[31m✗\033[0m %s\n' "$1"; FAIL=$((FAIL + 1)); }
|
|
89
|
+
note() { printf ' %s\n' "$1"; }
|
|
90
|
+
result() {
|
|
91
|
+
printf '\nflip 臂:%s\n' "${FLIPS_RUN:-none}"
|
|
92
|
+
printf '== remind-delivery 结果 == ✓%d ✗%d SKIP0\n' "$PASS" "$FAIL"
|
|
93
|
+
[ "$FAIL" -eq 0 ]
|
|
94
|
+
}
|
|
95
|
+
assert_eq() { [ "$2" = "$3" ] && ok "$1" || bad "$1(期望 [$3],实际 [$2])"; }
|
|
96
|
+
assert_has() { case "$2" in *"$3"*) ok "$1" ;; *) bad "$1(输出里没有 [$3]:$(printf '%s' "$2" | head -2 | tr '\n' '|' | cut -c1-140))" ;; esac; }
|
|
97
|
+
assert_no() { case "$2" in *"$3"*) bad "$1(输出里不该出现 [$3])" ;; *) ok "$1" ;; esac; }
|
|
98
|
+
|
|
99
|
+
# ---------------------------------------------------------------- small JSON helpers (no jq)
|
|
100
|
+
cat > "$ROOT/json-get.mjs" <<'JS'
|
|
101
|
+
import fs from 'node:fs';
|
|
102
|
+
const [file, dotted] = process.argv.slice(2);
|
|
103
|
+
let value = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
104
|
+
for (const key of dotted.split('.')) {
|
|
105
|
+
if (value == null) { value = undefined; break; }
|
|
106
|
+
if (Array.isArray(value) && /^-[0-9]+$/.test(key)) value = value[value.length + Number(key)];
|
|
107
|
+
else value = value[key];
|
|
108
|
+
}
|
|
109
|
+
if (value === undefined) process.exit(3);
|
|
110
|
+
process.stdout.write(typeof value === 'string' ? value : JSON.stringify(value));
|
|
111
|
+
JS
|
|
112
|
+
cat > "$ROOT/snapshot-edit.mjs" <<'JS'
|
|
113
|
+
// Hand-edit a snapshot the way an operator or a later process would. The fixture owns the repository,
|
|
114
|
+
// so editing the state file directly is legitimate preparation, not a second implementation.
|
|
115
|
+
import fs from 'node:fs';
|
|
116
|
+
const [file, script] = process.argv.slice(2);
|
|
117
|
+
const snap = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
118
|
+
new Function('snap', 'iso', fs.readFileSync(script, 'utf8'))(snap, ms => new Date(ms).toISOString());
|
|
119
|
+
fs.writeFileSync(file + '.edit', JSON.stringify(snap) + '\n');
|
|
120
|
+
fs.renameSync(file + '.edit', file);
|
|
121
|
+
JS
|
|
122
|
+
jfield() { "$RUNNER" "$ROOT/json-get.mjs" "$1" "$2"; }
|
|
123
|
+
reversed_members() { # <intent.json> → 同长度、逆序的成员 id JSON(不改写持久快照)
|
|
124
|
+
"$RUNNER" -e 'const fs=require("fs");const r=JSON.parse(fs.readFileSync(process.argv[1],"utf8"));process.stdout.write(JSON.stringify(r.batch.members.map(m=>m.id).reverse()))' "$1"
|
|
125
|
+
}
|
|
126
|
+
snapshot_of() { printf '%s/.pi/team/state/reminders/state.json\n' "$1"; }
|
|
127
|
+
edit_snapshot() { # <repo> <script-file>
|
|
128
|
+
"$RUNNER" "$ROOT/snapshot-edit.mjs" "$(snapshot_of "$1")" "$2"
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
# ---------------------------------------------------------------- fixture repositories
|
|
132
|
+
new_repo() { # <名字> → path(自己的 git 仓库;绝不落在别人的检出里)
|
|
133
|
+
local dir="$ROOT/fx/$1"
|
|
134
|
+
rm -rf "$dir"; mkdir -p "$dir"
|
|
135
|
+
git -C "$dir" init -q || return 1
|
|
136
|
+
git -C "$dir" -c user.email=fixture@example.invalid -c user.name=Fixture commit -q --allow-empty -m fixture || return 1
|
|
137
|
+
printf '%s\n' "$dir"
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
# One place where a child is stripped of inherited identity and given explicit roots.
|
|
141
|
+
child_env() { # <repo> [VAR=VAL…] -- <command…>
|
|
142
|
+
local repo="$1"; shift
|
|
143
|
+
local envs=()
|
|
144
|
+
while [ "$#" -gt 0 ] && [ "$1" != "--" ]; do envs+=("$1"); shift; done
|
|
145
|
+
[ "${1:-}" = "--" ] && shift
|
|
146
|
+
( cd "$repo" && env -u TEAM_ROOT -u TEAM_MAIN_ROOT -u TEAM_PROJECT -u TEAM_SESSION -u TEAM_SESSION_FROM \
|
|
147
|
+
-u TEAM_STATE_DIR -u TEAM_CONFIG_FILE -u TEAM_IDENTITY_LOCKED -u TEAM_IDENTITY_ROOT \
|
|
148
|
+
-u TEAM_IDENTITY_MAIN_ROOT -u TEAM_IDENTITY_PROJECT -u TEAM_IDENTITY_INHERIT_ROOT \
|
|
149
|
+
-u TEAM_IDENTITY_INHERIT_MAIN_ROOT -u TEAM_IDENTITY_INHERIT_PROJECT -u TEAM_IDENTITY_INHERIT_SESSION \
|
|
150
|
+
-u TEAM_ALLOW_FOREIGN_IDENTITY -u TMUX -u TMUX_PANE \
|
|
151
|
+
HOME="$ROOT/home" TMPDIR="$ROOT/tmp" TEAM_STATE_DIR="$repo/.pi/team/state" \
|
|
152
|
+
${envs[@]+"${envs[@]}"} "$@" )
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
run_team() { # <repo> <out> [args…] → RC;stdout+stderr 落 <out>
|
|
156
|
+
local repo="$1" out="$2"; shift 2
|
|
157
|
+
child_env "$repo" -- bash "$TEAM_CLI" --root "$repo" "$@" </dev/null >"$out" 2>&1
|
|
158
|
+
RC=$?
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
authority() { # <repo> <out> [helper args…] → RC(产品助手;stdin 恒为 /dev/null)
|
|
162
|
+
local repo="$1" out="$2"; shift 2
|
|
163
|
+
child_env "$repo" -- "$RUNNER" "$SKILL/scripts/state-authority.mjs" --cli "$repo" "$repo/.pi/team/state" "$@" \
|
|
164
|
+
</dev/null >"$out" 2>&1
|
|
165
|
+
RC=$?
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
tick() { # <repo> <pulse-started> <out> [extra env…] → RC(巡检的轻量到期检查)
|
|
169
|
+
local repo="$1" started="$2" out="$3"; shift 3
|
|
170
|
+
child_env "$repo" "$@" -- "$RUNNER" "$SKILL/scripts/remind-tick.mjs" --root "$repo" \
|
|
171
|
+
--state-dir "$repo/.pi/team/state" --pulse-started "$started" --json </dev/null >"$out" 2>&1
|
|
172
|
+
RC=$?
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
add_due() { # <repo> <message> [key] → 打印 id(先按 CLI 建一条 30s 后的,再由夹具把 due 改到过去)
|
|
176
|
+
local repo="$1" msg="$2" key="${3:-}" id
|
|
177
|
+
local args=(remind add --after 30s --message "$msg")
|
|
178
|
+
[ -n "$key" ] && args+=(--key "$key")
|
|
179
|
+
run_team "$repo" "$ROOT/out/add.txt" "${args[@]}"
|
|
180
|
+
[ "$RC" -eq 0 ] || { printf 'ADD-FAILED\n'; return 1; }
|
|
181
|
+
id="$(sed -n 's/^已创建 \(rem-[^ ]*\).*/\1/p' "$ROOT/out/add.txt" | head -1)"
|
|
182
|
+
[ -n "$id" ] || { printf 'ADD-NO-ID\n'; return 1; }
|
|
183
|
+
cat > "$ROOT/script/due.js" <<'JS'
|
|
184
|
+
for (const record of snap.reminders) {
|
|
185
|
+
if (record.phase === 'scheduled') record.dueAt = iso(Date.now() - 1000);
|
|
186
|
+
}
|
|
187
|
+
JS
|
|
188
|
+
edit_snapshot "$repo" "$ROOT/script/due.js"
|
|
189
|
+
printf '%s\n' "$id"
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
iso_now() { date -u +%Y-%m-%dT%H:%M:%SZ; }
|
|
193
|
+
iso_shift() { # <秒数(负=过去)>
|
|
194
|
+
date -u -d "@$(( $(date +%s) + $1 ))" +%Y-%m-%dT%H:%M:%SZ
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
# The red sides run the transaction helper exactly as the CLI does, from a private two-file copy:
|
|
198
|
+
# the product's own code plus one deliberate defect.
|
|
199
|
+
helper_copy() { # <id> → prints the copied helper path
|
|
200
|
+
local dir="$ROOT/flip/$1"
|
|
201
|
+
rm -rf "$dir"; mkdir -p "$dir"
|
|
202
|
+
cp "$SKILL/scripts/state-authority.mjs" "$dir/state-authority.mjs" || return 1
|
|
203
|
+
cp "$SKILL/scripts/remind-store.mjs" "$dir/remind-store.mjs" || return 1
|
|
204
|
+
printf '%s\n' "$dir/state-authority.mjs"
|
|
205
|
+
}
|
|
206
|
+
run_helper() { # <helper> <repo> <out> [args…] → RC
|
|
207
|
+
local helper="$1" repo="$2" out="$3"; shift 3
|
|
208
|
+
child_env "$repo" -- "$RUNNER" "$helper" --cli "$repo" "$repo/.pi/team/state" "$@" </dev/null >"$out" 2>&1
|
|
209
|
+
RC=$?
|
|
210
|
+
}
|
|
211
|
+
mutate() { # <file> <old> <new> — 必须真的改到(否则这条红侧是橡皮章)
|
|
212
|
+
python3 - "$1" "$2" "$3" <<'PY'
|
|
213
|
+
import sys
|
|
214
|
+
path, old, new = sys.argv[1], sys.argv[2], sys.argv[3]
|
|
215
|
+
s = open(path, encoding="utf-8").read()
|
|
216
|
+
if old not in s:
|
|
217
|
+
sys.exit("mutate: pattern not found in %s" % path)
|
|
218
|
+
open(path, "w", encoding="utf-8").write(s.replace(old, new, 1))
|
|
219
|
+
PY
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
# Isolation ledger for the real project's .pi/team (before).
|
|
223
|
+
REAL_MAIN="$(main_team_project_root "$SKILL")"
|
|
224
|
+
main_team_snapshot "${REAL_MAIN:-/nonexistent}/.pi/team" >"$ROOT/real-before.txt"
|
|
225
|
+
|
|
226
|
+
# ---------------------------------------------------------------- A. 到期入队
|
|
227
|
+
A="$(new_repo A)" || { bad "夹具建不出仓库 A"; result; exit 1; }
|
|
228
|
+
SA="$(snapshot_of "$A")"
|
|
229
|
+
NOTE_MSG='到点提醒正文 first line 100%
|
|
230
|
+
second line'
|
|
231
|
+
A1="$(add_due "$A" "$NOTE_MSG")"
|
|
232
|
+
if [ "${A1#rem-}" = "$A1" ]; then
|
|
233
|
+
bad "A 建不出一条到点提醒($A1)"; grep -a . "$ROOT/out/add.txt" | head -3 | sed 's/^/ /'
|
|
234
|
+
else
|
|
235
|
+
ok "A 夹具建出到点提醒 $A1"
|
|
236
|
+
fi
|
|
237
|
+
# 不到点 ≠ 入队:先把 due 放回未来,跑一拍,必须一条都不入队
|
|
238
|
+
cat > "$ROOT/script/future.js" <<'JS'
|
|
239
|
+
for (const record of snap.reminders) if (record.phase === 'scheduled') record.dueAt = iso(Date.now() + 120000);
|
|
240
|
+
JS
|
|
241
|
+
edit_snapshot "$A" "$ROOT/script/future.js"
|
|
242
|
+
tick "$A" "$(iso_now)" "$ROOT/out/tick.txt"
|
|
243
|
+
assert_has "A 不到点:tick 正常结束" "$(cat "$ROOT/out/tick.txt")" '"admitted":[]'
|
|
244
|
+
assert_eq "A 不到点:记录仍是 scheduled" "$(jfield "$SA" 'reminders.0.phase')" "scheduled"
|
|
245
|
+
# 到点:入队一次
|
|
246
|
+
cat > "$ROOT/script/due-now.js" <<'JS'
|
|
247
|
+
for (const record of snap.reminders) if (record.phase === 'scheduled') record.dueAt = iso(Date.now() - 1000);
|
|
248
|
+
JS
|
|
249
|
+
edit_snapshot "$A" "$ROOT/script/due-now.js"
|
|
250
|
+
tick "$A" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
251
|
+
assert_has "A 到点:tick 把它入队" "$(cat "$ROOT/out/tick.txt")" '"admitted":["'"$A1"'"'
|
|
252
|
+
assert_eq "A 到点:记录变成 queued" "$(jfield "$SA" 'reminders.0.phase')" "queued"
|
|
253
|
+
QUEUE_SEQ="$(jfield "$SA" 'reminders.0.queueSeq')"
|
|
254
|
+
assert_eq "A 正常轮询延迟不标 overdue(due 晚于本巡检实例起点)" "$(jfield "$SA" 'reminders.0.overdue')" "false"
|
|
255
|
+
tick "$A" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
256
|
+
assert_eq "A 重复巡检不产生第二条队列记录(queueSeq 不变)" "$(jfield "$SA" 'reminders.0.queueSeq')" "$QUEUE_SEQ"
|
|
257
|
+
assert_eq "A 重复巡检不重复入队(admitted 为空)" "$(jfield "$ROOT/out/tick.txt" 'admitted.length')" "0"
|
|
258
|
+
|
|
259
|
+
# 取消的项不入队:另一条提醒先取消,再让它到点
|
|
260
|
+
A2="$(add_due "$A" 'cancel me' cancel-me)"
|
|
261
|
+
run_team "$A" "$ROOT/out/cancel.txt" remind cancel "$A2"
|
|
262
|
+
assert_has "A 可取消尚未冻结的提醒" "$(cat "$ROOT/out/cancel.txt")" "已取消"
|
|
263
|
+
tick "$A" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
264
|
+
assert_eq "A 取消的项不入队(phase 仍是 cancelled)" "$(jfield "$SA" "reminders.1.phase")" "cancelled"
|
|
265
|
+
assert_no "A 取消的项不出现在入队结果里" "$(cat "$ROOT/out/tick.txt")" "$A2"
|
|
266
|
+
|
|
267
|
+
# overdue:due 早于本巡检实例起点 = 补发
|
|
268
|
+
B="$(new_repo B)"; SB="$(snapshot_of "$B")"
|
|
269
|
+
B1="$(add_due "$B" 'overdue by restart')"
|
|
270
|
+
tick "$B" "$(iso_shift 5)" "$ROOT/out/tick.txt"
|
|
271
|
+
assert_eq "A 到期早于本巡检实例起点 → overdue" "$(jfield "$SB" 'reminders.0.overdue')" "true"
|
|
272
|
+
assert_has "A overdue 的 id 被点名" "$(cat "$ROOT/out/tick.txt")" '"overdue":["'"$B1"'"'
|
|
273
|
+
|
|
274
|
+
# 入队滞后超过 30 秒 → overdue(正常轮询延迟不标)
|
|
275
|
+
C="$(new_repo C)"; SC="$(snapshot_of "$C")"
|
|
276
|
+
add_due "$C" 'late admission' >/dev/null
|
|
277
|
+
cat > "$ROOT/script/late.js" <<'JS'
|
|
278
|
+
for (const record of snap.reminders) if (record.phase === 'scheduled') record.dueAt = iso(Date.now() - 45000);
|
|
279
|
+
JS
|
|
280
|
+
edit_snapshot "$C" "$ROOT/script/late.js"
|
|
281
|
+
tick "$C" "$(iso_shift -60)" "$ROOT/out/tick.txt"
|
|
282
|
+
assert_eq "A 入队滞后 45s → overdue" "$(jfield "$SC" 'reminders.0.overdue')" "true"
|
|
283
|
+
|
|
284
|
+
# ---------------------------------------------------------------- B. 冻结批次
|
|
285
|
+
D="$(new_repo D)"; SD="$(snapshot_of "$D")"
|
|
286
|
+
D1="$(add_due "$D" 'batch member one' one)"
|
|
287
|
+
D2="$(add_due "$D" 'batch member two' two)"
|
|
288
|
+
tick "$D" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
289
|
+
authority "$D" "$ROOT/out/intent.txt" remind-intent --session sess-D --pid 111
|
|
290
|
+
assert_has "B 一批冻结成功" "$(cat "$ROOT/out/intent.txt")" '"action":"send"'
|
|
291
|
+
assert_has "B 正文逐字进批次(第一行)" "$(cat "$ROOT/out/intent.txt")" 'batch member one'
|
|
292
|
+
assert_has "B 正文逐字进批次(第二行)" "$(cat "$ROOT/out/intent.txt")" 'batch member two'
|
|
293
|
+
assert_eq "B 两条成员都进入同一批" "$(jfield "$ROOT/out/intent.txt" 'batch.members.length')" "2"
|
|
294
|
+
assert_eq "B 成员记录带批次 id" "$(jfield "$SD" 'reminders.0.batchId')" "$(jfield "$ROOT/out/intent.txt" 'batch.id')"
|
|
295
|
+
assert_eq "B 批次绑定了当时的待命状态(off)" "$(jfield "$ROOT/out/intent.txt" 'batch.generation')" 'off'
|
|
296
|
+
authority "$D" "$ROOT/out/intent2.txt" remind-intent --session sess-D --pid 111
|
|
297
|
+
assert_eq "B 已有一批在飞:第二次冻结被拒(wait,不产生第二批)" "$(jfield "$ROOT/out/intent2.txt" 'action')" "wait"
|
|
298
|
+
assert_eq "B 快照里只有一批" "$(jfield "$SD" 'batches.length')" "1"
|
|
299
|
+
# 九条同批:没有成员数上限;观察结束后新成员立即进入下一批,不等批次间隔。
|
|
300
|
+
E="$(new_repo E)"; SE="$(snapshot_of "$E")"
|
|
301
|
+
for i in 1 2 3 4 5 6 7 8 9; do add_due "$E" "uncapped member $i" "uncapped$i" >/dev/null; done
|
|
302
|
+
tick "$E" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
303
|
+
authority "$E" "$ROOT/out/intent.txt" remind-intent --session sess-E --pid 222
|
|
304
|
+
assert_eq "B 九条全部进入同一批" "$(jfield "$ROOT/out/intent.txt" 'batch.members.length')" "9"
|
|
305
|
+
assert_eq "B 第九条不再滞留 queued" "$(jfield "$SE" 'reminders.8.phase')" "intent"
|
|
306
|
+
authority "$E" "$ROOT/out/obs.txt" remind-observe --id "$(jfield "$ROOT/out/intent.txt" 'batch.id')" \
|
|
307
|
+
--nonce "$(jfield "$ROOT/out/intent.txt" 'batch.nonce')" --session sess-E \
|
|
308
|
+
--members "$(jfield "$ROOT/out/intent.txt" 'batch.members')"
|
|
309
|
+
add_due "$E" 'immediately eligible after observation' >/dev/null
|
|
310
|
+
tick "$E" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
311
|
+
authority "$E" "$ROOT/out/intent2.txt" remind-intent --session sess-E --pid 222
|
|
312
|
+
assert_eq "B 观察后下一批立即可发(无 spacing)" "$(jfield "$ROOT/out/intent2.txt" 'action')" "send"
|
|
313
|
+
assert_eq "B 新批次就是刚入队的那一条" "$(jfield "$ROOT/out/intent2.txt" 'batch.members.0.message')" 'immediately eligible after observation'
|
|
314
|
+
|
|
315
|
+
# ---------------------------------------------------------------- C. 观察与待命
|
|
316
|
+
F="$(new_repo F)"; SF="$(snapshot_of "$F")"
|
|
317
|
+
add_due "$F" 'standby wake' wake >/dev/null
|
|
318
|
+
add_due "$F" 'standby wake two' wake-two >/dev/null
|
|
319
|
+
authority "$F" "$ROOT/out/sb.txt" standby-on --reason "user away" --json
|
|
320
|
+
assert_eq "C 待命开了(代次 1)" "$(jfield "$ROOT/out/sb.txt" 'generation')" "1"
|
|
321
|
+
tick "$F" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
322
|
+
authority "$F" "$ROOT/out/intent.txt" remind-intent --session sess-F --pid 333
|
|
323
|
+
FB="$(jfield "$ROOT/out/intent.txt" 'batch.id')"; FN="$(jfield "$ROOT/out/intent.txt" 'batch.nonce')"
|
|
324
|
+
assert_eq "C 意图绑定当前代次 1" "$(jfield "$ROOT/out/intent.txt" 'batch.generation')" "1"
|
|
325
|
+
authority "$F" "$ROOT/out/bad.txt" remind-observe --id "$FB" --nonce "wrong" --session sess-F \
|
|
326
|
+
--members "$(jfield "$ROOT/out/intent.txt" 'batch.members')"
|
|
327
|
+
assert_eq "C nonce 不符:拒绝且不消耗 right" "$(jfield "$ROOT/out/bad.txt" 'refusal')" "nonce-mismatch"
|
|
328
|
+
assert_eq "C nonce 不符后 right 仍未花" "$(jfield "$SF" 'batches.0.right')" "unspent"
|
|
329
|
+
authority "$F" "$ROOT/out/bad.txt" remind-observe --id "$FB" --nonce "$FN" --session other \
|
|
330
|
+
--members "$(jfield "$ROOT/out/intent.txt" 'batch.members')"
|
|
331
|
+
assert_eq "C 会话不符:拒绝" "$(jfield "$ROOT/out/bad.txt" 'refusal')" "session-mismatch"
|
|
332
|
+
authority "$F" "$ROOT/out/bad.txt" remind-observe --id "$FB" --nonce "$FN" --session sess-F --members '[]'
|
|
333
|
+
assert_eq "C 成员集不符:拒绝且不消耗 right" "$(jfield "$ROOT/out/bad.txt" 'refusal')" "member-mismatch"
|
|
334
|
+
assert_eq "C 成员集不符后 right 仍未花" "$(jfield "$SF" 'batches.0.right')" "unspent"
|
|
335
|
+
authority "$F" "$ROOT/out/bad.txt" remind-observe --id "$FB" --nonce "$FN" --session sess-F \
|
|
336
|
+
--members "$(reversed_members "$ROOT/out/intent.txt")"
|
|
337
|
+
assert_eq "C 同长度乱序成员:拒绝" "$(jfield "$ROOT/out/bad.txt" 'refusal')" "member-mismatch"
|
|
338
|
+
assert_eq "C 同长度乱序成员:right 仍未花" "$(jfield "$SF" 'batches.0.right')" "unspent"
|
|
339
|
+
assert_eq "C 同长度乱序成员:Standby 仍开" "$(jfield "$SF" 'standby.on')" "true"
|
|
340
|
+
authority "$F" "$ROOT/out/obs.txt" remind-observe --id "$FB" --nonce "$FN" --session sess-F \
|
|
341
|
+
--members "$(jfield "$ROOT/out/intent.txt" 'batch.members')"
|
|
342
|
+
assert_has "C 匹配事件 → observed" "$(cat "$ROOT/out/obs.txt")" '"outcome":"observed"'
|
|
343
|
+
assert_has "C 观察原子地自动退代次 1" "$(cat "$ROOT/out/obs.txt")" '"standby":"auto-off"'
|
|
344
|
+
assert_eq "C 待命已关" "$(jfield "$SF" 'standby.on')" "false"
|
|
345
|
+
assert_eq "C right 已花(wake)" "$(jfield "$SF" 'batches.0.rightSpentBy')" "wake"
|
|
346
|
+
assert_eq "C 审计一条、点名批次" "$(jfield "$SF" 'audit.-1.batch')" "$FB"
|
|
347
|
+
assert_eq "C 审计带每个提醒 id" "$(jfield "$SF" 'audit.-1.ids.length')" "2"
|
|
348
|
+
assert_eq "C 审计带来源" "$(jfield "$SF" 'audit.-1.sources.0')" "cli"
|
|
349
|
+
authority "$F" "$ROOT/out/obs.txt" remind-observe --id "$FB" --nonce "$FN" --session sess-F \
|
|
350
|
+
--members "$(jfield "$ROOT/out/intent.txt" 'batch.members')"
|
|
351
|
+
assert_has "C 重复事件 → duplicate(不再退待命)" "$(cat "$ROOT/out/obs.txt")" '"outcome":"duplicate"'
|
|
352
|
+
assert_eq "C 重复事件不产生第二条观察审计" \
|
|
353
|
+
"$(node -e 'const s=require("'"$SF"'");console.log(s.audit.filter(a=>a.op==="remind-observed").length)')" "1"
|
|
354
|
+
|
|
355
|
+
# 手动已 off:观察只记 already-off,不虚构自动退出
|
|
356
|
+
G="$(new_repo G)"; SG="$(snapshot_of "$G")"
|
|
357
|
+
add_due "$G" 'manual off' >/dev/null
|
|
358
|
+
authority "$G" "$ROOT/out/sb.txt" standby-on --reason "x" --json >/dev/null
|
|
359
|
+
tick "$G" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
360
|
+
authority "$G" "$ROOT/out/intent.txt" remind-intent --session sess-G --pid 444
|
|
361
|
+
authority "$G" "$ROOT/out/sb.txt" standby-off >/dev/null
|
|
362
|
+
authority "$G" "$ROOT/out/obs.txt" remind-observe --id "$(jfield "$ROOT/out/intent.txt" 'batch.id')" \
|
|
363
|
+
--nonce "$(jfield "$ROOT/out/intent.txt" 'batch.nonce')" --session sess-G \
|
|
364
|
+
--members "$(jfield "$ROOT/out/intent.txt" 'batch.members')"
|
|
365
|
+
assert_has "C 手动已关 → already-off(不虚构自动退出)" "$(cat "$ROOT/out/obs.txt")" '"standby":"already-off"'
|
|
366
|
+
|
|
367
|
+
# 更新的代次:保留,报 ambiguous
|
|
368
|
+
H="$(new_repo H)"; SH="$(snapshot_of "$H")"
|
|
369
|
+
add_due "$H" 'newer generation' >/dev/null
|
|
370
|
+
authority "$H" "$ROOT/out/sb.txt" standby-on --reason "g1" --json >/dev/null
|
|
371
|
+
tick "$H" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
372
|
+
authority "$H" "$ROOT/out/intent.txt" remind-intent --session sess-H --pid 555
|
|
373
|
+
authority "$H" "$ROOT/out/sb.txt" standby-off >/dev/null
|
|
374
|
+
authority "$H" "$ROOT/out/sb.txt" standby-on --reason "g2" --json >/dev/null
|
|
375
|
+
assert_eq "C 现在的代次是 2" "$(jfield "$ROOT/out/sb.txt" 'generation')" "2"
|
|
376
|
+
authority "$H" "$ROOT/out/obs.txt" remind-observe --id "$(jfield "$ROOT/out/intent.txt" 'batch.id')" \
|
|
377
|
+
--nonce "$(jfield "$ROOT/out/intent.txt" 'batch.nonce')" --session sess-H \
|
|
378
|
+
--members "$(jfield "$ROOT/out/intent.txt" 'batch.members')"
|
|
379
|
+
assert_has "C 更新代次 → 保留并报 generation-ambiguous" "$(cat "$ROOT/out/obs.txt")" '"standby":"generation-ambiguous"'
|
|
380
|
+
assert_eq "C 更新代次没有被清掉" "$(jfield "$SH" 'standby.on')" "true"
|
|
381
|
+
assert_eq "C 更新代次仍是 2" "$(jfield "$SH" 'standby.generation')" "2"
|
|
382
|
+
|
|
383
|
+
# ---------------------------------------------------------------- D. 未送达不清待命
|
|
384
|
+
I="$(new_repo I)"; SI="$(snapshot_of "$I")"
|
|
385
|
+
add_due "$I" 'not delivered yet' >/dev/null
|
|
386
|
+
authority "$I" "$ROOT/out/sb.txt" standby-on --reason "D" --json >/dev/null
|
|
387
|
+
tick "$I" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
388
|
+
assert_eq "D 只是入队:待命还开着" "$(jfield "$SI" 'standby.on')" "true"
|
|
389
|
+
authority "$I" "$ROOT/out/intent.txt" remind-intent --session sess-I --pid 666
|
|
390
|
+
assert_eq "D 冻结成批次:待命还开着" "$(jfield "$SI" 'standby.on')" "true"
|
|
391
|
+
authority "$I" "$ROOT/out/fail.txt" remind-fail --id "$(jfield "$ROOT/out/intent.txt" 'batch.id')" \
|
|
392
|
+
--nonce "$(jfield "$ROOT/out/intent.txt" 'batch.nonce')" --reason "session API refused"
|
|
393
|
+
assert_eq "D 投递失败:待命还开着(unknown 不等于送达)" "$(jfield "$SI" 'standby.on')" "true"
|
|
394
|
+
assert_eq "D 失败后成员是 unknown" "$(jfield "$SI" 'reminders.0.phase')" "unknown"
|
|
395
|
+
|
|
396
|
+
# ---------------------------------------------------------------- E. 失败与确认
|
|
397
|
+
assert_eq "E 失败后 attempts=2(一次 intent + 一次失败)" "$(jfield "$SI" 'batches.0.attempts')" "2"
|
|
398
|
+
assert_has "E 失败原因可见" "$(jfield "$SI" 'batches.0.lastError')" "session API refused"
|
|
399
|
+
assert_eq "E 失败不冒充成功:right 仍未花" "$(jfield "$SI" 'batches.0.right')" "unspent"
|
|
400
|
+
authority "$I" "$ROOT/out/intent2.txt" remind-intent --session sess-I --pid 666
|
|
401
|
+
assert_eq "E unknown 挡住下一批(wait)" "$(jfield "$ROOT/out/intent2.txt" 'action')" "wait"
|
|
402
|
+
run_team "$I" "$ROOT/out/resolve.txt" remind resolve "$(jfield "$SI" 'batches.0.id')"
|
|
403
|
+
assert_eq "E resolve 不给 --ack-unknown → 拒绝(rc=2)" "$RC" "2"
|
|
404
|
+
assert_has "E resolve 拒绝时点名 --ack-unknown" "$(cat "$ROOT/out/resolve.txt")" "--ack-unknown"
|
|
405
|
+
assert_eq "E 拒绝后批次仍是 unknown(没有动手)" "$(jfield "$SI" 'batches.0.phase')" "unknown"
|
|
406
|
+
run_team "$I" "$ROOT/out/resolve.txt" remind resolve "$(jfield "$SI" 'batches.0.id')" --ack-unknown
|
|
407
|
+
assert_has "E 显式确认 → resolved" "$(cat "$ROOT/out/resolve.txt")" "已确认未知批次"
|
|
408
|
+
assert_eq "E 成员一起关闭" "$(jfield "$SI" 'reminders.0.phase')" "resolved"
|
|
409
|
+
assert_eq "E right 由确认烧掉" "$(jfield "$SI" 'batches.0.rightSpentBy')" "resolve"
|
|
410
|
+
assert_eq "E 确认不声称送达(没有 remind-observed)" \
|
|
411
|
+
"$(node -e 'const s=require("'"$SI"'");console.log(s.audit.filter(a=>a.op==="remind-observed").length)')" "0"
|
|
412
|
+
# 确认后下一批可以再冻结,不需要等待或改写上一批的时间。
|
|
413
|
+
add_due "$I" 'after resolve' >/dev/null
|
|
414
|
+
tick "$I" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
415
|
+
authority "$I" "$ROOT/out/intent3.txt" remind-intent --session sess-I --pid 666
|
|
416
|
+
assert_eq "E 确认之后可以冻结下一批" "$(jfield "$ROOT/out/intent3.txt" 'action')" "send"
|
|
417
|
+
assert_no "E 新批次不含已确认的那一条" "$(cat "$ROOT/out/intent3.txt")" 'not delivered yet'
|
|
418
|
+
|
|
419
|
+
# ---------------------------------------------------------------- F. 重启恢复
|
|
420
|
+
J="$(new_repo J)"; SJ="$(snapshot_of "$J")"
|
|
421
|
+
J1="$(add_due "$J" 'restart catch-up')"
|
|
422
|
+
tick "$J" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
423
|
+
assert_eq "F 巡检进程退出后记录仍是 queued" "$(jfield "$SJ" 'reminders.0.phase')" "queued"
|
|
424
|
+
# 新进程(= 重启)照样把它冻结送出
|
|
425
|
+
authority "$J" "$ROOT/out/intent.txt" remind-intent --session sess-J --pid 777
|
|
426
|
+
assert_eq "F 重启后 queued 被冻结成批次" "$(jfield "$ROOT/out/intent.txt" 'action')" "send"
|
|
427
|
+
assert_has "F 正文仍是原文" "$(cat "$ROOT/out/intent.txt")" 'restart catch-up'
|
|
428
|
+
authority "$J" "$ROOT/out/obs.txt" remind-observe --id "$(jfield "$ROOT/out/intent.txt" 'batch.id')" \
|
|
429
|
+
--nonce "$(jfield "$ROOT/out/intent.txt" 'batch.nonce')" --session sess-J \
|
|
430
|
+
--members "$(jfield "$ROOT/out/intent.txt" 'batch.members')"
|
|
431
|
+
tick "$J" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
432
|
+
assert_eq "F 已送达的不再入队(admitted 为空)" "$(jfield "$ROOT/out/tick.txt" 'admitted.length')" "0"
|
|
433
|
+
assert_eq "F 已送达记录仍是 observed" "$(jfield "$SJ" 'reminders.0.phase')" "observed"
|
|
434
|
+
|
|
435
|
+
# intent 超过 60s → unknown,且不重发
|
|
436
|
+
K="$(new_repo K)"; SK2="$(snapshot_of "$K")"
|
|
437
|
+
K1="$(add_due "$K" 'lost after intent')"
|
|
438
|
+
tick "$K" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
439
|
+
authority "$K" "$ROOT/out/intent.txt" remind-intent --session sess-K --pid 888
|
|
440
|
+
KB="$(jfield "$ROOT/out/intent.txt" 'batch.id')"
|
|
441
|
+
cat > "$ROOT/script/stale.js" <<'JS'
|
|
442
|
+
for (const batch of snap.batches) if (batch.phase === 'intent') batch.intentAt = iso(Date.now() - 120000);
|
|
443
|
+
for (const record of snap.reminders) if (record.phase === 'intent') record.intentAt = iso(Date.now() - 120000);
|
|
444
|
+
JS
|
|
445
|
+
edit_snapshot "$K" "$ROOT/script/stale.js"
|
|
446
|
+
tick "$K" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
447
|
+
assert_eq "F 过期 intent 被清成 unknown" "$(jfield "$SK2" 'batches.0.phase')" "unknown"
|
|
448
|
+
assert_eq "F unknown 的成员也变成 unknown" "$(jfield "$SK2" 'reminders.0.phase')" "unknown"
|
|
449
|
+
assert_has "F 巡检把这次清点点名" "$(cat "$ROOT/out/tick.txt")" "$KB"
|
|
450
|
+
authority "$K" "$ROOT/out/intent2.txt" remind-intent --session sess-K --pid 888
|
|
451
|
+
assert_eq "F unknown 不会被自动重发(wait)" "$(jfield "$ROOT/out/intent2.txt" 'action')" "wait"
|
|
452
|
+
assert_eq "F 没有产生第二批" "$(jfield "$SK2" 'batches.length')" "1"
|
|
453
|
+
assert_eq "F 成员仍挂着原批次 id(不是新的投递)" "$(jfield "$SK2" 'reminders.0.batchId')" "$KB"
|
|
454
|
+
|
|
455
|
+
# ---------------------------------------------------------------- G. 投递面(模块 + 真扩展,假 Pi 宿主)
|
|
456
|
+
L="$(new_repo L)"; SL="$(snapshot_of "$L")"
|
|
457
|
+
# The watcher derives its project from git + a project config file (the same rule the real install has);
|
|
458
|
+
# a fixture repository needs that one file before it can register a session at all.
|
|
459
|
+
mkdir -p "$L/.pi/team"
|
|
460
|
+
printf 'TEAM_PROJECT="rmd-fixture"\nTEAM_SESSION="team"\nTEAM_PM_WINDOW="pm"\nTEAM_DOCS_DIR="docs/team"\n' > "$L/.pi/team/config.sh"
|
|
461
|
+
add_due "$L" 'watcher reminder text' >/dev/null
|
|
462
|
+
authority "$L" "$ROOT/out/sb.txt" standby-on --reason "G" --json >/dev/null
|
|
463
|
+
tick "$L" "$(iso_shift -10)" "$ROOT/out/tick.txt"
|
|
464
|
+
DRIVER="$SKILL/tests/remind-delivery-node.mjs"
|
|
465
|
+
for group in content match; do
|
|
466
|
+
child_env "$L" -- "$RUNNER" "$DRIVER" "$SKILL" "$L" "$group" >"$ROOT/out/node-$group.txt" 2>&1
|
|
467
|
+
RC=$?
|
|
468
|
+
if [ "$RC" -eq 0 ]; then
|
|
469
|
+
ok "G ${group}:$(grep -c '^RD PASS' "$ROOT/out/node-$group.txt") 条契约成立($(grep -a '结果' "$ROOT/out/node-$group.txt" | tail -1))"
|
|
470
|
+
else
|
|
471
|
+
bad "G ${group}:Node 契约组红(rc=$RC)"
|
|
472
|
+
grep -a '^RD FAIL' "$ROOT/out/node-$group.txt" | head -5 | sed 's/^/ /'
|
|
473
|
+
fi
|
|
474
|
+
done
|
|
475
|
+
child_env "$L" TEAM_INBOX_WATCH_TARGET=team:pm TEAM_REMIND_POLL_MS=200 -- \
|
|
476
|
+
"$RUNNER" "$DRIVER" "$SKILL" "$L" watcher >"$ROOT/out/node-watcher.txt" 2>&1
|
|
477
|
+
RC=$?
|
|
478
|
+
if [ "$RC" -eq 0 ]; then
|
|
479
|
+
ok "G watcher:真扩展在假 Pi 宿主上把一批送出去并观察到回执($(grep -a '结果' "$ROOT/out/node-watcher.txt" | tail -1))"
|
|
480
|
+
else
|
|
481
|
+
bad "G watcher:扩展的投递契约红(rc=$RC)"
|
|
482
|
+
grep -a '^RD FAIL' "$ROOT/out/node-watcher.txt" | head -8 | sed 's/^/ /'
|
|
483
|
+
fi
|
|
484
|
+
assert_has "G watcher 结束后待命按规则退出" "$(jfield "$SL" 'standby.on')" "false"
|
|
485
|
+
assert_eq "G 只有一批" "$(jfield "$SL" 'batches.length')" "1"
|
|
486
|
+
|
|
487
|
+
# ---------------------------------------------------------------- H. 隔离
|
|
488
|
+
main_team_snapshot "${REAL_MAIN:-/nonexistent}/.pi/team" >"$ROOT/real-after.txt"
|
|
489
|
+
H_VIOL="$(main_team_violations "$ROOT/real-before.txt" "$ROOT/real-after.txt")"
|
|
490
|
+
H_MOVED="$(main_team_volatile_changes "$ROOT/real-before.txt" "$ROOT/real-after.txt")"
|
|
491
|
+
if [ -z "$H_VIOL" ]; then
|
|
492
|
+
ok "H 主项目 .pi/team:非白名单路径零变化(同期白名单内 $H_MOVED 个运行时文件在动)"
|
|
493
|
+
else
|
|
494
|
+
bad "H 主项目 .pi/team 出现了非白名单变化($(printf '%s' "$H_VIOL" | tr '\n' ' '))"
|
|
495
|
+
fi
|
|
496
|
+
H_SLACK=""
|
|
497
|
+
main_team_volatile "./state/meta-suite/2026-11-04T06-46-57Z.log" || H_SLACK="$H_SLACK meta-suite-未放行"
|
|
498
|
+
main_team_volatile "./state/one-off-writer/x.log" && H_SLACK="$H_SLACK 未登记子目录-被放行"
|
|
499
|
+
assert_eq "H 白名单登记:元套件记录放行、state/ 下未登记的子目录仍被点名(判据没有一处松)" "$H_SLACK" ""
|
|
500
|
+
|
|
501
|
+
# ---------------------------------------------------------------- 红侧(scratch 副本)
|
|
502
|
+
run_flips() {
|
|
503
|
+
local repo dir helper
|
|
504
|
+
repo="$(new_repo FLIP)" || { bad "红侧夹具仓库建不出来"; return 0; }
|
|
505
|
+
|
|
506
|
+
if arm_selected admit-any; then
|
|
507
|
+
helper="$(helper_copy admit-any)"
|
|
508
|
+
# The admit filter, not peekReminders' one-line probe (the same predicate appears in both).
|
|
509
|
+
mutate "$(dirname "$helper")/remind-store.mjs" \
|
|
510
|
+
"const due = snapshot.reminders
|
|
511
|
+
.filter(record => record.phase === 'scheduled' && Number.isFinite(msOf(record.dueAt)) && msOf(record.dueAt) <= nowMs)" \
|
|
512
|
+
"const due = snapshot.reminders
|
|
513
|
+
.filter(record => record.phase === 'scheduled')"
|
|
514
|
+
dir="$(dirname "$helper")"
|
|
515
|
+
if grep -qF ".filter(record => record.phase === 'scheduled')" "$dir/remind-store.mjs"; then
|
|
516
|
+
ok "红侧 admit-any:变异已落地(副本不再是产品那一份)"
|
|
517
|
+
else
|
|
518
|
+
bad "红侧 admit-any:变异没落地"
|
|
519
|
+
fi
|
|
520
|
+
FLIPS_RUN="${FLIPS_RUN:+$FLIPS_RUN,}admit-any"
|
|
521
|
+
add_due "$repo" 'not due yet' >/dev/null
|
|
522
|
+
cat > "$ROOT/script/future2.js" <<'JS'
|
|
523
|
+
for (const record of snap.reminders) if (record.phase === 'scheduled') record.dueAt = iso(Date.now() + 300000);
|
|
524
|
+
JS
|
|
525
|
+
edit_snapshot "$repo" "$ROOT/script/future2.js"
|
|
526
|
+
run_helper "$helper" "$repo" "$ROOT/out/flip.txt" remind-admit --pulse-started "$(iso_now)"
|
|
527
|
+
if [ "$(jfield "$ROOT/out/flip.txt" 'admitted.length')" != "0" ]; then
|
|
528
|
+
ok "flip(入队不看到期时间):不到点的提醒也入了队 —— A 的「不到点不入队」会红"
|
|
529
|
+
else
|
|
530
|
+
bad "flip(入队不看到期时间):变异没有改变答案(红侧无效)"
|
|
531
|
+
fi
|
|
532
|
+
fi
|
|
533
|
+
|
|
534
|
+
if arm_selected intent-multi; then
|
|
535
|
+
helper="$(helper_copy intent-multi)"
|
|
536
|
+
mutate "$(dirname "$helper")/remind-store.mjs" \
|
|
537
|
+
"return snapshot.batches.find(batch => batch.phase === 'intent' || batch.phase === 'unknown') ?? null;" \
|
|
538
|
+
"return null;"
|
|
539
|
+
ok "红侧 intent-multi:变异已落地(副本不再是产品那一份)"
|
|
540
|
+
FLIPS_RUN="${FLIPS_RUN:+$FLIPS_RUN,}intent-multi"
|
|
541
|
+
repo="$(new_repo FLIP2)"
|
|
542
|
+
for i in 1 2 3 4 5 6 7 8 9; do add_due "$repo" "flip member $i" "fm$i" >/dev/null; done
|
|
543
|
+
run_helper "$helper" "$repo" "$ROOT/out/flip.txt" remind-admit --pulse-started "$(iso_shift -10)"
|
|
544
|
+
run_helper "$helper" "$repo" "$ROOT/out/f1.txt" remind-intent --session s --pid 1
|
|
545
|
+
add_due "$repo" 'queued while another batch is in flight' >/dev/null
|
|
546
|
+
run_helper "$helper" "$repo" "$ROOT/out/flip.txt" remind-admit --pulse-started "$(iso_shift -10)"
|
|
547
|
+
run_helper "$helper" "$repo" "$ROOT/out/f2.txt" remind-intent --session s --pid 1
|
|
548
|
+
if [ "$(jfield "$ROOT/out/f2.txt" 'action')" = "send" ]; then
|
|
549
|
+
ok "flip(不看已有一批在飞):同一批被冻了两次 —— B 的「拒绝再冻」会红"
|
|
550
|
+
else
|
|
551
|
+
bad "flip(不看已有一批在飞):变异没有改变答案(红侧无效)"
|
|
552
|
+
fi
|
|
553
|
+
fi
|
|
554
|
+
|
|
555
|
+
if arm_selected observe-nogen; then
|
|
556
|
+
helper="$(helper_copy observe-nogen)"
|
|
557
|
+
mutate "$(dirname "$helper")/remind-store.mjs" \
|
|
558
|
+
"else if (snapshot.standby.generation === batch.generation) {" \
|
|
559
|
+
"else if (true) {"
|
|
560
|
+
ok "红侧 observe-nogen:变异已落地(副本不再是产品那一份)"
|
|
561
|
+
FLIPS_RUN="${FLIPS_RUN:+$FLIPS_RUN,}observe-nogen"
|
|
562
|
+
repo="$(new_repo FLIP3)"
|
|
563
|
+
add_due "$repo" 'flip standby' >/dev/null
|
|
564
|
+
run_helper "$helper" "$repo" "$ROOT/out/f.txt" standby-on --reason g1
|
|
565
|
+
run_helper "$helper" "$repo" "$ROOT/out/f.txt" remind-admit --pulse-started "$(iso_shift -10)"
|
|
566
|
+
run_helper "$helper" "$repo" "$ROOT/out/f1.txt" remind-intent --session s --pid 1
|
|
567
|
+
run_helper "$helper" "$repo" "$ROOT/out/f.txt" standby-off
|
|
568
|
+
run_helper "$helper" "$repo" "$ROOT/out/f.txt" standby-on --reason g2
|
|
569
|
+
run_helper "$helper" "$repo" "$ROOT/out/f2.txt" remind-observe --id "$(jfield "$ROOT/out/f1.txt" 'batch.id')" \
|
|
570
|
+
--nonce "$(jfield "$ROOT/out/f1.txt" 'batch.nonce')" --session s \
|
|
571
|
+
--members "$(jfield "$ROOT/out/f1.txt" 'batch.members')"
|
|
572
|
+
if [ "$(jfield "$ROOT/out/f2.txt" 'standby')" = "auto-off" ]; then
|
|
573
|
+
ok "flip(观察不核对代次):新代次被清掉 —— C 的「更新代次必须保留」会红"
|
|
574
|
+
else
|
|
575
|
+
bad "flip(观察不核对代次):变异没有改变答案(红侧无效)"
|
|
576
|
+
fi
|
|
577
|
+
fi
|
|
578
|
+
|
|
579
|
+
if arm_selected members-length; then
|
|
580
|
+
helper="$(helper_copy members-length)"
|
|
581
|
+
if mutate "$(dirname "$helper")/remind-store.mjs" \
|
|
582
|
+
"request.members.length !== batch.members.length ||
|
|
583
|
+
request.members.some((id, index) => id !== batch.members[index])" \
|
|
584
|
+
"request.members.length !== batch.members.length"; then
|
|
585
|
+
ok "红侧 members-length:变异已落地(成员只比长度,不再逐项比身份与顺序)"
|
|
586
|
+
else
|
|
587
|
+
bad "红侧 members-length:变异锚点没落地"
|
|
588
|
+
fi
|
|
589
|
+
FLIPS_RUN="${FLIPS_RUN:+$FLIPS_RUN,}members-length"
|
|
590
|
+
repo="$(new_repo FLIP_MEMBERS)"
|
|
591
|
+
add_due "$repo" 'member order one' order-one >/dev/null
|
|
592
|
+
add_due "$repo" 'member order two' order-two >/dev/null
|
|
593
|
+
run_helper "$helper" "$repo" "$ROOT/out/f.txt" standby-on --reason g1
|
|
594
|
+
run_helper "$helper" "$repo" "$ROOT/out/flip.txt" remind-admit --pulse-started "$(iso_shift -10)"
|
|
595
|
+
run_helper "$helper" "$repo" "$ROOT/out/f1.txt" remind-intent --session s --pid 1
|
|
596
|
+
run_helper "$helper" "$repo" "$ROOT/out/f2.txt" remind-observe --id "$(jfield "$ROOT/out/f1.txt" 'batch.id')" \
|
|
597
|
+
--nonce "$(jfield "$ROOT/out/f1.txt" 'batch.nonce')" --session s \
|
|
598
|
+
--members "$(reversed_members "$ROOT/out/f1.txt")"
|
|
599
|
+
if [ "$(jfield "$ROOT/out/f2.txt" 'outcome')" = "observed" ] && \
|
|
600
|
+
[ "$(jfield "$ROOT/out/f2.txt" 'standby')" = "auto-off" ] && \
|
|
601
|
+
[ "$(jfield "$(snapshot_of "$repo")" 'standby.on')" = "false" ]; then
|
|
602
|
+
ok "flip(成员只比长度):同长度乱序被误收并清了 Standby —— C 的乱序拒绝会红;完整比较恢复后拒绝"
|
|
603
|
+
else
|
|
604
|
+
bad "flip(成员只比长度):变异没有误收同长度乱序(红侧无效)"
|
|
605
|
+
fi
|
|
606
|
+
fi
|
|
607
|
+
|
|
608
|
+
if arm_selected off-on-queue; then
|
|
609
|
+
helper="$(helper_copy off-on-queue)"
|
|
610
|
+
mutate "$(dirname "$helper")/remind-store.mjs" \
|
|
611
|
+
" admitted.push(record.id);" \
|
|
612
|
+
" admitted.push(record.id);
|
|
613
|
+
snapshot.standby = { on: false, generation: snapshot.standby.generation, reason: null, since: iso(nowMs), migrated: true };"
|
|
614
|
+
ok "红侧 off-on-queue:变异已落地(副本不再是产品那一份)"
|
|
615
|
+
FLIPS_RUN="${FLIPS_RUN:+$FLIPS_RUN,}off-on-queue"
|
|
616
|
+
repo="$(new_repo FLIP4)"
|
|
617
|
+
add_due "$repo" 'flip queue off' >/dev/null
|
|
618
|
+
run_helper "$helper" "$repo" "$ROOT/out/f.txt" standby-on --reason x
|
|
619
|
+
run_helper "$helper" "$repo" "$ROOT/out/f.txt" remind-admit --pulse-started "$(iso_shift -10)"
|
|
620
|
+
if [ "$(run_helper "$helper" "$repo" "$ROOT/out/f2.txt" standby-read --print on; cat "$ROOT/out/f2.txt")" = "false" ]; then
|
|
621
|
+
ok "flip(入队就关待命):只是入队就把待命清了 —— D 的「未送达不得清待命」会红"
|
|
622
|
+
else
|
|
623
|
+
bad "flip(入队就关待命):变异没有改变答案(红侧无效)"
|
|
624
|
+
fi
|
|
625
|
+
fi
|
|
626
|
+
|
|
627
|
+
if arm_selected unknown-resend; then
|
|
628
|
+
helper="$(helper_copy unknown-resend)"
|
|
629
|
+
mutate "$(dirname "$helper")/remind-store.mjs" \
|
|
630
|
+
"return snapshot.batches.find(batch => batch.phase === 'intent' || batch.phase === 'unknown') ?? null;" \
|
|
631
|
+
"return snapshot.batches.find(batch => batch.phase === 'intent') ?? null;"
|
|
632
|
+
ok "红侧 unknown-resend:变异已落地(副本不再是产品那一份)"
|
|
633
|
+
FLIPS_RUN="${FLIPS_RUN:+$FLIPS_RUN,}unknown-resend"
|
|
634
|
+
repo="$(new_repo FLIP5)"
|
|
635
|
+
add_due "$repo" 'flip unknown' >/dev/null
|
|
636
|
+
run_helper "$helper" "$repo" "$ROOT/out/f.txt" remind-admit --pulse-started "$(iso_shift -10)"
|
|
637
|
+
run_helper "$helper" "$repo" "$ROOT/out/f1.txt" remind-intent --session s --pid 1
|
|
638
|
+
run_helper "$helper" "$repo" "$ROOT/out/f.txt" remind-fail --id "$(jfield "$ROOT/out/f1.txt" 'batch.id')" \
|
|
639
|
+
--nonce "$(jfield "$ROOT/out/f1.txt" 'batch.nonce')" --reason "refused"
|
|
640
|
+
add_due "$repo" 'flip next batch' >/dev/null
|
|
641
|
+
run_helper "$helper" "$repo" "$ROOT/out/f.txt" remind-admit --pulse-started "$(iso_shift -10)"
|
|
642
|
+
run_helper "$helper" "$repo" "$ROOT/out/f2.txt" remind-intent --session s --pid 1
|
|
643
|
+
if [ "$(jfield "$ROOT/out/f2.txt" 'action')" = "send" ]; then
|
|
644
|
+
ok "flip(unknown 不再挡住下一批):无法证实送达的一批被绕过去重发 —— E 的「unknown 挡住下一批」会红"
|
|
645
|
+
else
|
|
646
|
+
bad "flip(unknown 不再挡住下一批):变异没有改变答案(红侧无效)"
|
|
647
|
+
fi
|
|
648
|
+
fi
|
|
649
|
+
|
|
650
|
+
if arm_selected batch-cap; then
|
|
651
|
+
helper="$(helper_copy batch-cap)"
|
|
652
|
+
mutate "$(dirname "$helper")/remind-store.mjs" \
|
|
653
|
+
" .sort((a, b) => ((a.queueSeq ?? 0) - (b.queueSeq ?? 0)) || (a.seq - b.seq));" \
|
|
654
|
+
" .sort((a, b) => ((a.queueSeq ?? 0) - (b.queueSeq ?? 0)) || (a.seq - b.seq))
|
|
655
|
+
.slice(0, 8);"
|
|
656
|
+
ok "红侧 batch-cap:变异已落地(恢复单批 8 条上限)"
|
|
657
|
+
FLIPS_RUN="${FLIPS_RUN:+$FLIPS_RUN,}batch-cap"
|
|
658
|
+
repo="$(new_repo FLIP6)"
|
|
659
|
+
for i in 1 2 3 4 5 6 7 8 9; do add_due "$repo" "flip cap $i" "fc$i" >/dev/null; done
|
|
660
|
+
run_helper "$helper" "$repo" "$ROOT/out/flip.txt" remind-admit --pulse-started "$(iso_shift -10)"
|
|
661
|
+
run_helper "$helper" "$repo" "$ROOT/out/f1.txt" remind-intent --session s --pid 1
|
|
662
|
+
if [ "$(jfield "$ROOT/out/f1.txt" 'batch.members.length')" = "8" ]; then
|
|
663
|
+
ok "flip(恢复单批 8 条上限):第九条被留下 —— B 的「九条同批」会红"
|
|
664
|
+
else
|
|
665
|
+
bad "flip(恢复单批 8 条上限):第九条仍同批,这条红侧是橡皮章"
|
|
666
|
+
fi
|
|
667
|
+
fi
|
|
668
|
+
|
|
669
|
+
if arm_selected batch-spacing; then
|
|
670
|
+
helper="$(helper_copy batch-spacing)"
|
|
671
|
+
mutate "$(dirname "$helper")/remind-store.mjs" \
|
|
672
|
+
" const queued = snapshot.reminders" \
|
|
673
|
+
" const last = snapshot.batches[snapshot.batches.length - 1];
|
|
674
|
+
if (last && Number.isFinite(msOf(last.intentAt)) && nowMs - msOf(last.intentAt) < 5000) {
|
|
675
|
+
return { ok: true, action: 'spacing', now: iso(nowMs), swept };
|
|
676
|
+
}
|
|
677
|
+
const queued = snapshot.reminders"
|
|
678
|
+
ok "红侧 batch-spacing:变异已落地(恢复五秒批次间隔)"
|
|
679
|
+
FLIPS_RUN="${FLIPS_RUN:+$FLIPS_RUN,}batch-spacing"
|
|
680
|
+
repo="$(new_repo FLIP7)"
|
|
681
|
+
add_due "$repo" 'flip spacing first' >/dev/null
|
|
682
|
+
run_helper "$helper" "$repo" "$ROOT/out/flip.txt" remind-admit --pulse-started "$(iso_shift -10)"
|
|
683
|
+
run_helper "$helper" "$repo" "$ROOT/out/f1.txt" remind-intent --session s --pid 1
|
|
684
|
+
run_helper "$helper" "$repo" "$ROOT/out/obs.txt" remind-observe --id "$(jfield "$ROOT/out/f1.txt" 'batch.id')" \
|
|
685
|
+
--nonce "$(jfield "$ROOT/out/f1.txt" 'batch.nonce')" --session s \
|
|
686
|
+
--members "$(jfield "$ROOT/out/f1.txt" 'batch.members')"
|
|
687
|
+
add_due "$repo" 'flip spacing second' >/dev/null
|
|
688
|
+
run_helper "$helper" "$repo" "$ROOT/out/flip.txt" remind-admit --pulse-started "$(iso_shift -10)"
|
|
689
|
+
run_helper "$helper" "$repo" "$ROOT/out/f2.txt" remind-intent --session s --pid 1
|
|
690
|
+
if [ "$(jfield "$ROOT/out/f2.txt" 'action')" = "spacing" ]; then
|
|
691
|
+
ok "flip(恢复五秒批次间隔):下一批被推迟 —— B 的「立即可发」会红"
|
|
692
|
+
else
|
|
693
|
+
bad "flip(恢复五秒批次间隔):下一批仍立即可发,这条红侧是橡皮章"
|
|
694
|
+
fi
|
|
695
|
+
fi
|
|
696
|
+
}
|
|
697
|
+
run_flips
|
|
698
|
+
|
|
699
|
+
result
|