teamsmith 0.4.6 → 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 +24 -0
- package/skills/teamsmith/SKILL.md +32 -23
- package/skills/teamsmith/extension/team-bg.ts +5 -3
- package/skills/teamsmith/extension/team-inbox-watch.ts +14 -3
- 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 +26 -15
- package/skills/teamsmith/references/reminders.md +153 -161
- package/skills/teamsmith/references/troubleshooting.md +12 -7
- package/skills/teamsmith/references/workflows.md +84 -31
- package/skills/teamsmith/scripts/lib/cmd-agents.sh +10 -4
- package/skills/teamsmith/scripts/lib/cmd-project.sh +88 -6
- package/skills/teamsmith/scripts/lib/cmd-remind.sh +88 -2
- package/skills/teamsmith/scripts/lib/cmd-review.sh +42 -4
- package/skills/teamsmith/scripts/lib/cmd-watch.sh +48 -11
- package/skills/teamsmith/scripts/lib/common.sh +83 -13
- package/skills/teamsmith/scripts/panel/panel.js +179 -179
- package/skills/teamsmith/scripts/panel/src/data.ts +71 -15
- package/skills/teamsmith/scripts/panel/src/layout.ts +20 -8
- package/skills/teamsmith/scripts/panel/src/main.tsx +83 -21
- package/skills/teamsmith/scripts/remind-capability.mjs +261 -0
- package/skills/teamsmith/scripts/remind-store.mjs +55 -24
- package/skills/teamsmith/scripts/remind-tick.mjs +5 -2
- package/skills/teamsmith/scripts/reply-capture.mjs +8 -9
- package/skills/teamsmith/scripts/state-authority.mjs +72 -6
- package/skills/teamsmith/scripts/team +1 -0
- package/skills/teamsmith/templates/AGENTS.section.md.tmpl +11 -8
- 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 +31 -19
- 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/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 +3 -5
- package/skills/teamsmith/tests/isolation-ledger.sh +6 -2
- package/skills/teamsmith/tests/key-replies-ui.sh +53 -0
- package/skills/teamsmith/tests/key-replies.sh +307 -106
- package/skills/teamsmith/tests/lib/routes-pages.sh +243 -0
- package/skills/teamsmith/tests/loop-inventory.tsv +1 -0
- package/skills/teamsmith/tests/panel-b3-stub.sh +9 -2
- 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 +13 -0
- package/skills/teamsmith/tests/remind-delivery.sh +123 -35
- 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 +10 -8
- package/skills/teamsmith/tests/smoke.sh +484 -28
- package/skills/teamsmith/tests/state-authority.sh +152 -8
- package/skills/teamsmith-init/SKILL.md +5 -5
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/__pycache__/judge-second.cpython-313.pyc +0 -0
|
@@ -4556,7 +4556,8 @@ PM_SUPPORT="${PM_SUPPORT% }"
|
|
|
4556
4556
|
# M27 起默认参数多了 `-e <skill>/extension/team-bg.ts`(PM 的后台门禁)、M30 起再多了
|
|
4557
4557
|
# `-e <skill>/extension/team-inbox-watch.ts`(PM 的投递换道):参考值同步加这两项,
|
|
4558
4558
|
# 它仍是**字面写死**的,不调实现。
|
|
4559
|
-
# P396 起默认参数再多了 `-e <skill>/extension/team-reply.ts
|
|
4559
|
+
# P396 起默认参数再多了 `-e <skill>/extension/team-reply.ts`(定向关键回复采集);
|
|
4560
|
+
# P442 起再多 `-e <skill>/extension/team-remind.ts`(PM 自我提醒):参考值同步补这两项。
|
|
4560
4561
|
# M36 起整条命令再带一个**闸门前缀**(tmux 运行时闸门:PATH 最前 = scripts/shim、state/tmux-calls.log、
|
|
4561
4562
|
# 真 tmux 路径三段 export)——前缀同样字面写死;前缀以外的历史部分保持逐字节一致。
|
|
4562
4563
|
M36_REF_PREFIX="export PATH=$(printf '%q' "$SKILL_DIR/scripts/shim"):\"\$PATH\"; export TEAM_TMUX_CALLS_LOG=$(printf '%q' "$REPO/.pi/team/state/tmux-calls.log"); "
|
|
@@ -4568,16 +4569,17 @@ M36_REF_PREFIX="${M36_REF_PREFIX}export TEAM_SIGNAL_CALLS_LOG=$(printf '%q' "$RE
|
|
|
4568
4569
|
# M40 起再带一段**身份环境前缀**(继承的 TEAM_* 身份先清掉,只写本命令现场推导出的身份):
|
|
4569
4570
|
# 前缀同样字面写死(值只取夹具已知量),前缀以外的历史部分保持逐字节一致。
|
|
4570
4571
|
m40sq() { printf "'%s'" "${1//\'/\'\\\'\'}"; }
|
|
4571
|
-
M40_REF_PREFIX="unset TEAM_ROOT TEAM_MAIN_ROOT TEAM_PROJECT TEAM_SESSION TEAM_SESSION_FROM TEAM_CONFIG_FILE TEAM_IDENTITY_LOCKED TEAM_IDENTITY_ROOT TEAM_IDENTITY_MAIN_ROOT TEAM_IDENTITY_PROJECT TEAM_IDENTITY_INHERIT_ROOT TEAM_IDENTITY_INHERIT_MAIN_ROOT TEAM_IDENTITY_INHERIT_PROJECT TEAM_IDENTITY_INHERIT_SESSION; export TEAM_ROOT=$(m40sq "$REPO"); export TEAM_MAIN_ROOT=$(m40sq "$REPO"); export TEAM_PROJECT=$(m40sq "$(basename "$REPO")"); export TEAM_SESSION=$(m40sq "$SESSION"); "
|
|
4572
|
+
M40_REF_PREFIX="unset TEAM_ROOT TEAM_MAIN_ROOT TEAM_PROJECT TEAM_SESSION TEAM_SESSION_FROM TEAM_CONFIG_FILE TEAM_REMINDER_ONLY_RECOVERY TEAM_IDENTITY_LOCKED TEAM_IDENTITY_ROOT TEAM_IDENTITY_MAIN_ROOT TEAM_IDENTITY_PROJECT TEAM_IDENTITY_INHERIT_ROOT TEAM_IDENTITY_INHERIT_MAIN_ROOT TEAM_IDENTITY_INHERIT_PROJECT TEAM_IDENTITY_INHERIT_SESSION; export TEAM_ROOT=$(m40sq "$REPO"); export TEAM_MAIN_ROOT=$(m40sq "$REPO"); export TEAM_PROJECT=$(m40sq "$(basename "$REPO")"); export TEAM_SESSION=$(m40sq "$SESSION"); "
|
|
4572
4573
|
# P396 起命令里再固定本次解析出的 state/config/window 三段(进程局部,不新增配置键、不写 tmux global):
|
|
4573
4574
|
# 同样字面写死,前缀以外的历史部分保持逐字节一致。
|
|
4574
4575
|
P396_REF_PREFIX="export TEAM_STATE_DIR=$(printf '%q' "$REPO/.pi/team/state") TEAM_CONFIG_FILE=$(printf '%q' "$REPO/.pi/team/config.sh") TEAM_PM_WINDOW=pm; "
|
|
4575
|
-
LEGACY_REF="${M40_REF_PREFIX}${M36_REF_PREFIX}${P396_REF_PREFIX}cd $(printf '%q' "$REPO") && printf \"%s\\n\" \$\$ > $(printf '%q' "$PM_SPAWN") && exec $(printf '%q' "$FAKE/pi") --provider deepseek --model deepseek-flash -e $(printf '%q' "$SKILL_DIR/extension/team-bg.ts") -e $(printf '%q' "$SKILL_DIR/extension/team-inbox-watch.ts") -e $(printf '%q' "$SKILL_DIR/extension/team-reply.ts") --skill $(printf '%q' "$SKILL_DIR") -c @$(printf '%q' "$PM_PF")"
|
|
4576
|
+
LEGACY_REF="${M40_REF_PREFIX}${M36_REF_PREFIX}${P396_REF_PREFIX}cd $(printf '%q' "$REPO") && printf \"%s\\n\" \$\$ > $(printf '%q' "$PM_SPAWN") && exec $(printf '%q' "$FAKE/pi") --provider deepseek --model deepseek-flash -e $(printf '%q' "$SKILL_DIR/extension/team-bg.ts") -e $(printf '%q' "$SKILL_DIR/extension/team-inbox-watch.ts") -e $(printf '%q' "$SKILL_DIR/extension/team-reply.ts") -e $(printf '%q' "$SKILL_DIR/extension/team-remind.ts") --skill $(printf '%q' "$SKILL_DIR") -c @$(printf '%q' "$PM_PF")"
|
|
4576
4577
|
DEFAULT_CMD="$(pm_render "$PM_PF" "$PM_SPAWN" "TEAM_PI_BIN=$FAKE/pi")"
|
|
4577
|
-
assert_eq "M8.1 默认渲染与历史逐字节一致(TEAM_PM_CMD/BIN/RESUME_ARGS 全空;M27 起含 -e bg、M30 起再含 -e inbox-watch、P396 起再含 -e reply 与 state/config/window 前缀、M36 起带闸门 exports 前缀、M40 起带身份环境前缀)" "$DEFAULT_CMD" "$LEGACY_REF"
|
|
4578
|
+
assert_eq "M8.1 默认渲染与历史逐字节一致(TEAM_PM_CMD/BIN/RESUME_ARGS 全空;M27 起含 -e bg、M30 起再含 -e inbox-watch、P396 起再含 -e reply、P442 起再含 -e remind 与 state/config/window 前缀、P443 起清继承的 Reminder-only 标记、M36 起带闸门 exports 前缀、M40 起带身份环境前缀)" "$DEFAULT_CMD" "$LEGACY_REF"
|
|
4578
4579
|
assert_has_echo "$DEFAULT_CMD" "extension/team-bg.ts" "M27:PM 默认命令加载 team-bg(后台门禁)"
|
|
4579
4580
|
assert_has_echo "$DEFAULT_CMD" "extension/team-inbox-watch.ts" "M30:PM 默认命令加载 inbox-watch(投递换道)"
|
|
4580
4581
|
assert_has_echo "$DEFAULT_CMD" "extension/team-reply.ts" "P396:PM 默认命令加载定向关键回复扩展"
|
|
4582
|
+
assert_has_echo "$DEFAULT_CMD" "extension/team-remind.ts" "P442:PM 默认命令加载自我提醒扩展"
|
|
4581
4583
|
assert_has_echo "$DEFAULT_CMD" " -c @$PM_PF" "默认仍是 pi -c + @prompt-file(历史行为)"
|
|
4582
4584
|
# 显式配了续跑键就在内置 Pi 路径生效(同一套键也服务于自定义 CLI)
|
|
4583
4585
|
SID_CMD="$(pm_render "$PM_PF" "$PM_SPAWN" "TEAM_PI_BIN=$FAKE/pi" 'TEAM_PM_SESSION_ID=pm-fixed')"
|
|
@@ -5872,6 +5874,8 @@ section "9 · agent 提交 + 报告"
|
|
|
5872
5874
|
'- 破坏实验:把实现改坏 → 守门测试退出码 1(red)' \
|
|
5873
5875
|
'- 恢复实现:守门测试退出码 0,全部通过(green)' \
|
|
5874
5876
|
'- 独立验证包(不复用被测夹具):docs/team/reports/T1.1/verify.sh' \
|
|
5877
|
+
"- 主工作树:$REPO" \
|
|
5878
|
+
"- 当前家目录:$HOME" \
|
|
5875
5879
|
'```' \
|
|
5876
5880
|
'$ bash docs/team/reports/T1.1/verify.sh' \
|
|
5877
5881
|
'```' \
|
|
@@ -5887,7 +5891,140 @@ assert_eq "分支有 1 个提交" "$(git -C "$REPO/.worktrees/dev" rev-list --co
|
|
|
5887
5891
|
section "10 · review(独立 worktree + 门禁)"
|
|
5888
5892
|
REV_WT="$TMP/review-checkout"
|
|
5889
5893
|
git -C "$REPO" worktree add --detach "$REV_WT" "$T1_BRANCH" >/dev/null 2>&1 || true
|
|
5890
|
-
|
|
5894
|
+
# PM 只准备两个 checkout;真正调用 review 的是与实现作者 dev 不同的 verify 席位。
|
|
5895
|
+
git -C "$REPO" worktree add --detach "$REPO/.worktrees/verify" "$PROTECTED" >/dev/null 2>&1 || true
|
|
5896
|
+
review_record_has_verifier() { # 真实命令产生的记录必须绑定 verify + 当前 HEAD + 指定 record/log
|
|
5897
|
+
local rec="$REPO/docs/team/reviews/T1.1.md" log="$REPO/docs/team/reviews/T1.1-verify.log" want
|
|
5898
|
+
want="$(git -C "$REV_WT" rev-parse HEAD 2>/dev/null)"
|
|
5899
|
+
[ -f "$rec" ] || { printf 'missing record\n'; return 1; }
|
|
5900
|
+
[ -f "$log" ] || { printf 'missing companion log\n'; return 1; }
|
|
5901
|
+
grep -q '^# T1.1 · 独立复验$' "$rec" || { printf 'title is not neutral independent review\n'; return 1; }
|
|
5902
|
+
grep -q '实际执行者:`verify`' "$rec" || { printf 'actual executor is not verify\n'; return 1; }
|
|
5903
|
+
grep -q "HEAD: \`${want:0:9}\`" "$rec" || { printf 'reviewed HEAD mismatch\n'; return 1; }
|
|
5904
|
+
! grep -q 'PM 独立复验' "$rec" || { printf 'hard-coded PM attribution\n'; return 1; }
|
|
5905
|
+
}
|
|
5906
|
+
P440_GATE="$TMP/p440-review-gate.sh"
|
|
5907
|
+
printf '#!/usr/bin/env bash\nprintf '\''gate main=%%s home=%%s\\n'\'' '%s' "$HOME"\n' "$REPO" > "$P440_GATE"
|
|
5908
|
+
review_record_ledger_clean() { # P440:所有动态片段都不能把 main/home 绝对路径写进公开 Markdown
|
|
5909
|
+
local rec="$REPO/docs/team/reviews/T1.1.md" checkout_display="$REV_WT" gate_display="$P440_GATE"
|
|
5910
|
+
case "$REV_WT" in
|
|
5911
|
+
"$REPO"/*) checkout_display="<main-root>/${REV_WT#"$REPO"/}" ;;
|
|
5912
|
+
"$HOME"/*) checkout_display="<home>/${REV_WT#"$HOME"/}" ;;
|
|
5913
|
+
esac
|
|
5914
|
+
case "$P440_GATE" in
|
|
5915
|
+
"$REPO"/*) gate_display="<main-root>/${P440_GATE#"$REPO"/}" ;;
|
|
5916
|
+
"$HOME"/*) gate_display="<home>/${P440_GATE#"$HOME"/}" ;;
|
|
5917
|
+
esac
|
|
5918
|
+
[ -f "$rec" ] || { printf 'missing record\n'; return 1; }
|
|
5919
|
+
! grep -qF "$REPO" "$rec" || { printf 'absolute main root remains\n'; return 1; }
|
|
5920
|
+
if [ "${HOME:-}" != "/" ]; then
|
|
5921
|
+
! grep -qF "$HOME" "$rec" || { printf 'absolute home remains\n'; return 1; }
|
|
5922
|
+
fi
|
|
5923
|
+
grep -qF "独立 checkout:\`$checkout_display\`" "$rec" || { printf 'independent checkout display mismatch\n'; return 1; }
|
|
5924
|
+
grep -qF 'agent 报告:`<main-root>/.worktrees/dev/docs/team/reports/T1.1-dev.md`' "$rec" \
|
|
5925
|
+
|| { printf 'agent report is not project-relative display text\n'; return 1; }
|
|
5926
|
+
grep -qF '门禁锁:`<main-root>/.pi/team/state/p440-review.lock`' "$rec" \
|
|
5927
|
+
|| { printf 'lock path was not sanitised\n'; return 1; }
|
|
5928
|
+
grep -qF '主工作树:<main-root>' "$rec" || { printf 'report excerpt main path remains\n'; return 1; }
|
|
5929
|
+
grep -qF '当前家目录:<home>' "$rec" || { printf 'report excerpt home path remains\n'; return 1; }
|
|
5930
|
+
grep -qF 'gate main=<main-root> home=<home>' "$rec" || { printf 'gate output was not sanitised\n'; return 1; }
|
|
5931
|
+
grep -qF "门禁命令:\`bash $gate_display\`" "$rec" || { printf 'real gate command missing\n'; return 1; }
|
|
5932
|
+
grep -qF '判定: **PASS**' "$rec" || { printf 'real gate result missing\n'; return 1; }
|
|
5933
|
+
}
|
|
5934
|
+
touch "$TMP/review-write-set-start"
|
|
5935
|
+
( cd "$REPO/.worktrees/verify" && TEAM_GATES="bash $P440_GATE" \
|
|
5936
|
+
TEAM_SMOKE_LOCK="$REPO/.pi/team/state/p440-review.lock" $TEAM review T1.1 --dir "$REV_WT" ) >"$TMP/review.log" 2>&1 \
|
|
5937
|
+
&& ok "review 门禁 PASS 退出码 0(verify 席位实际执行)" || { bad "review 失败"; cat "$TMP/review.log"; }
|
|
5938
|
+
review_record_has_verifier >"$TMP/review-identity-green.log" 2>&1 \
|
|
5939
|
+
&& ok "真实 verifier 记录:neutral 标题 + verify 身份 + reviewed SHA + 指定 record/log" \
|
|
5940
|
+
|| { bad "真实 verifier 记录不完整"; cat "$TMP/review-identity-green.log"; }
|
|
5941
|
+
review_record_ledger_clean >"$TMP/p440-review-green.log" 2>&1 \
|
|
5942
|
+
&& ok "P440 review 绿:执行者/SHA/真实命令/结果保留,模板+锁+摘录+门禁尾部均无 main/home 绝对路径" \
|
|
5943
|
+
|| { bad "P440 review 绿失败"; cat "$TMP/p440-review-green.log"; }
|
|
5944
|
+
|
|
5945
|
+
# V146/W1:与 main root 共享字符串前缀的兄弟 checkout 不是 main root 的子路径,显示必须逐字保留。
|
|
5946
|
+
P440_SIBLING="$REPO-ledger/checkout"
|
|
5947
|
+
git -C "$REPO" worktree add --detach "$P440_SIBLING" "$T1_BRANCH" >/dev/null 2>&1
|
|
5948
|
+
P440_SIBLING_RC=0
|
|
5949
|
+
( cd "$REPO/.worktrees/verify" && TEAM_GATES=true \
|
|
5950
|
+
TEAM_SMOKE_LOCK="$REPO/.pi/team/state/p440-review.lock" $TEAM review T1.1 --dir "$P440_SIBLING" ) >"$TMP/p440-review-sibling.log" 2>&1 \
|
|
5951
|
+
|| P440_SIBLING_RC=$?
|
|
5952
|
+
assert_eq "P440 兄弟前缀 checkout 的真实 review rc=0" "$P440_SIBLING_RC" "0"
|
|
5953
|
+
assert_has "$REPO/docs/team/reviews/T1.1.md" '判定: **PASS**' "P440 兄弟前缀 checkout 的记录是 PASS"
|
|
5954
|
+
P440_SIBLING_DISPLAY="$P440_SIBLING"
|
|
5955
|
+
case "$P440_SIBLING" in
|
|
5956
|
+
"$HOME"/*) P440_SIBLING_DISPLAY="<home>/${P440_SIBLING#"$HOME"/}" ;;
|
|
5957
|
+
esac
|
|
5958
|
+
assert_has "$REPO/docs/team/reviews/T1.1.md" "独立 checkout:\`$P440_SIBLING_DISPLAY\`" "P440 兄弟前缀路径逐字保留,不改成不存在的占位拼接"
|
|
5959
|
+
assert_not "$REPO/docs/team/reviews/T1.1.md" '<main-root>-ledger' "P440 不再把 main-root 的兄弟前缀吞成占位"
|
|
5960
|
+
git -C "$REPO" worktree remove --force "$P440_SIBLING" >/dev/null 2>&1
|
|
5961
|
+
|
|
5962
|
+
# V146/W2:HOME 下的独立 checkout 显示为 <home>/…,不要求夹具必须放在 /var/tmp。
|
|
5963
|
+
P440_HOME="$TMP/p440-home"; mkdir -p "$P440_HOME"
|
|
5964
|
+
P440_HOME_WT="$P440_HOME/checkout"
|
|
5965
|
+
git -C "$REPO" worktree add --detach "$P440_HOME_WT" "$T1_BRANCH" >/dev/null 2>&1
|
|
5966
|
+
P440_HOME_RC=0
|
|
5967
|
+
( cd "$REPO/.worktrees/verify" && HOME="$P440_HOME" TEAM_GATES=true \
|
|
5968
|
+
TEAM_SMOKE_LOCK="$P440_HOME/review.lock" $TEAM review T1.1 --dir "$P440_HOME_WT" ) >"$TMP/p440-review-home-checkout.log" 2>&1 \
|
|
5969
|
+
|| P440_HOME_RC=$?
|
|
5970
|
+
assert_eq "P440 HOME 下 checkout 的真实 review rc=0" "$P440_HOME_RC" "0"
|
|
5971
|
+
assert_has "$REPO/docs/team/reviews/T1.1.md" '判定: **PASS**' "P440 HOME 下 checkout 的记录是 PASS"
|
|
5972
|
+
assert_has "$REPO/docs/team/reviews/T1.1.md" '独立 checkout:`<home>/checkout`' "P440 HOME 下 checkout 按显示规则写成 <home>/…"
|
|
5973
|
+
git -C "$REPO" worktree remove --force "$P440_HOME_WT" >/dev/null 2>&1
|
|
5974
|
+
|
|
5975
|
+
# V147:边界不是分隔符白名单。C 与 UTF-8 locale 输出必须逐字一致;中文冒号、引号和
|
|
5976
|
+
# ;!?,。):都结束裸 root,而 ASCII 的 -_. 兄弟后缀仍然原样保留。
|
|
5977
|
+
P440_MATRIX_INPUT=$'主工作树:/a/b/pm-skills\n当前家目录:/srv/u\n路径:/a/b/pm-skills;家目录:/srv/u!\n引用「/a/b/pm-skills」与「/srv/u」?\n标点:/a/b/pm-skills,/srv/u。/a/b/pm-skills):/srv/u;\n子路径:/a/b/pm-skills/review,家目录:/srv/u/.cache。\n句末点:/a/b/pm-skills. /srv/u.\n句末横线:/a/b/pm-skills- /srv/u-\n句末下线:/a/b/pm-skills_ /srv/u_\n兄弟:/a/b/pm-skills-ledger /a/b/pm-skills_other /a/b/pm-skills.cache'
|
|
5978
|
+
P440_MATRIX_EXPECTED=$'主工作树:<main-root>\n当前家目录:<home>\n路径:<main-root>;家目录:<home>!\n引用「<main-root>」与「<home>」?\n标点:<main-root>,<home>。<main-root>):<home>;\n子路径:<main-root>/review,家目录:<home>/.cache。\n句末点:<main-root>. <home>.\n句末横线:<main-root>- <home>-\n句末下线:<main-root>_ <home>_\n兄弟:/a/b/pm-skills-ledger /a/b/pm-skills_other /a/b/pm-skills.cache'
|
|
5979
|
+
for P440_LOCALE in C C.UTF-8; do
|
|
5980
|
+
P440_MATRIX_OUT="$(printf '%s\n' "$P440_MATRIX_INPUT" | LC_ALL="$P440_LOCALE" TEAM_MAIN_ROOT=/a/b/pm-skills HOME=/srv/u \
|
|
5981
|
+
bash -c '. "$1"; team_review_ledger_display' _ "$SKILL_DIR/scripts/lib/cmd-review.sh")"
|
|
5982
|
+
assert_eq "P440 C/UTF-8 标点矩阵($P440_LOCALE):净化一致且兄弟前缀保留" "$P440_MATRIX_OUT" "$P440_MATRIX_EXPECTED"
|
|
5983
|
+
done
|
|
5984
|
+
|
|
5985
|
+
# P440 红侧:只在私有 skill 副本恢复旧的直接写盘,真实 review 必须重新带出绝对路径;随后同副本还原转绿。
|
|
5986
|
+
P440_REVIEW_MUT="$TMP/p440-review-absolute-paths"; rm -rf "$P440_REVIEW_MUT"; cp -a "$SKILL_DIR" "$P440_REVIEW_MUT"
|
|
5987
|
+
python3 - "$P440_REVIEW_MUT/scripts/lib/cmd-review.sh" <<'PY'
|
|
5988
|
+
import sys
|
|
5989
|
+
p = sys.argv[1]
|
|
5990
|
+
s = open(p, encoding='utf-8').read()
|
|
5991
|
+
old = ' } | team_review_ledger_display > "$report"'
|
|
5992
|
+
assert s.count(old) == 1, 'P440 review write pipeline not found exactly once'
|
|
5993
|
+
open(p, 'w', encoding='utf-8').write(s.replace(old, ' } > "$report"', 1))
|
|
5994
|
+
PY
|
|
5995
|
+
rm -f "$REPO/docs/team/reviews/T1.1.md" "$REPO/docs/team/reviews/T1.1-verify.log"
|
|
5996
|
+
P440_RED_REVIEW_RC=0
|
|
5997
|
+
( cd "$REPO/.worktrees/verify" && TEAM_GATES="bash $P440_GATE" \
|
|
5998
|
+
TEAM_SMOKE_LOCK="$REPO/.pi/team/state/p440-review.lock" \
|
|
5999
|
+
bash "$P440_REVIEW_MUT/scripts/team" review T1.1 --dir "$REV_WT" ) >"$TMP/p440-review-mutant.log" 2>&1 \
|
|
6000
|
+
|| P440_RED_REVIEW_RC=$?
|
|
6001
|
+
P440_RED_REC="$REPO/docs/team/reviews/T1.1.md"
|
|
6002
|
+
assert_eq "P440 红侧前提:变异体真实 review rc=0" "$P440_RED_REVIEW_RC" "0"
|
|
6003
|
+
assert_file "$P440_RED_REC" "P440 红侧前提:记录真的生成"
|
|
6004
|
+
assert_has "$P440_RED_REC" '判定: **PASS**' "P440 红侧前提:变异门禁结果仍是 PASS"
|
|
6005
|
+
if [ "$P440_RED_REVIEW_RC" -ne 0 ] || [ ! -f "$P440_RED_REC" ] || ! grep -qF '判定: **PASS**' "$P440_RED_REC"; then
|
|
6006
|
+
bad "P440 review 红侧前提不成立:不能用缺失记录或失败 review 充当路径翻转"
|
|
6007
|
+
elif ! grep -qF "$REPO" "$P440_RED_REC"; then
|
|
6008
|
+
bad "P440 review 红侧失效:变异记录里没有绝对 main root"
|
|
6009
|
+
elif ! grep -qF "$HOME" "$P440_RED_REC"; then
|
|
6010
|
+
bad "P440 review 红侧失效:变异记录里没有绝对 HOME"
|
|
6011
|
+
elif review_record_ledger_clean >"$TMP/p440-review-red.log" 2>&1; then
|
|
6012
|
+
bad "P440 review 红侧失效:恢复绝对路径写盘仍通过账本路径断言"
|
|
6013
|
+
elif [ "$(tr -d '\r' < "$TMP/p440-review-red.log")" != 'absolute main root remains' ]; then
|
|
6014
|
+
bad "P440 review 红侧失败原因不是绝对路径:$(tr '\n' ' ' < "$TMP/p440-review-red.log")"
|
|
6015
|
+
else
|
|
6016
|
+
ok "P440 review 红:rc=0/PASS/记录存在后,仅因绝对 main/home 路径判红"
|
|
6017
|
+
fi
|
|
6018
|
+
cp "$SKILL_DIR/scripts/lib/cmd-review.sh" "$P440_REVIEW_MUT/scripts/lib/cmd-review.sh"
|
|
6019
|
+
rm -f "$REPO/docs/team/reviews/T1.1.md" "$REPO/docs/team/reviews/T1.1-verify.log"
|
|
6020
|
+
( cd "$REPO/.worktrees/verify" && TEAM_GATES="bash $P440_GATE" \
|
|
6021
|
+
TEAM_SMOKE_LOCK="$REPO/.pi/team/state/p440-review.lock" \
|
|
6022
|
+
bash "$P440_REVIEW_MUT/scripts/team" review T1.1 --dir "$REV_WT" ) >"$TMP/p440-review-restored.log" 2>&1
|
|
6023
|
+
review_record_ledger_clean >"$TMP/p440-review-restore-green.log" 2>&1 \
|
|
6024
|
+
&& ok "P440 review 还原绿:同一私有副本恢复显示净化后断言通过" \
|
|
6025
|
+
|| { bad "P440 review 还原后仍红"; cat "$TMP/p440-review-restore-green.log"; }
|
|
6026
|
+
REVIEW_DOCS_WRITES="$(cd "$REPO" && find docs/team -type f -newer "$TMP/review-write-set-start" -printf '%P\n' | LC_ALL=C sort)"
|
|
6027
|
+
assert_eq "review 在主检出的文档写集只有指定 record/log" "$REVIEW_DOCS_WRITES" $'reviews/T1.1-verify.log\nreviews/T1.1.md'
|
|
5891
6028
|
if $TEAM review T1.1 >"$TMP/review-nodir.log" 2>&1; then bad "review 缺 --dir 应报错"; else ok "review 缺 --dir 明确报错(skill 不碰 git)"; fi
|
|
5892
6029
|
assert_has "$TMP/review-nodir.log" "PM 自己准备独立 checkout" "报错里给出 git 命令"
|
|
5893
6030
|
assert_file "$REPO/docs/team/reviews/T1.1.md" "写复验记录"
|
|
@@ -6081,7 +6218,14 @@ assert_has "$REPO/docs/team/reviews/T1.1.md" "Flip evidence" "F14 记录给出
|
|
|
6081
6218
|
assert_has "$REPO/docs/team/reviews/T1.1.md" "checkout 里没有这个路径" "F14 老实记下包路径未随分支提交(提示项,不阻塞)"
|
|
6082
6219
|
|
|
6083
6220
|
# F14b(PM 退回的复现):报告措辞直接取自我们自己的模板 —— 检查器不能只认自己的正则,
|
|
6084
|
-
# 否则「检查器 ↔
|
|
6221
|
+
# 否则「检查器 ↔ 模板」会漂移(模板改写后真报告又被判“缺证据”)。同一既有证据例也钉住 OpenSpec 固定分节。
|
|
6222
|
+
for P439_SECTION in CRITICAL WARNING SUGGESTION 'Final assessment'; do
|
|
6223
|
+
assert_has "$SKILL_DIR/templates/report.md.tmpl" "## $P439_SECTION" "F14b 报告模板含固定 OpenSpec 分节:$P439_SECTION"
|
|
6224
|
+
done
|
|
6225
|
+
assert_has "$SKILL_DIR/templates/report.md.tmpl" "Completeness" "F14b 报告模板含 Completeness 评分维度"
|
|
6226
|
+
assert_has "$SKILL_DIR/templates/report.md.tmpl" "Correctness" "F14b 报告模板含 Correctness 评分维度"
|
|
6227
|
+
assert_has "$SKILL_DIR/templates/report.md.tmpl" "Coherence" "F14b 报告模板含 Coherence 评分维度"
|
|
6228
|
+
assert_has "$SKILL_DIR/templates/report.md.tmpl" "Unverified applicable checks and reasons" "F14b 报告模板要求列出未验证检查与理由"
|
|
6085
6229
|
TMPL_FLIP_HEAD="$(grep -m1 -E '^#{2,3}[[:space:]].*[Ff]lip' "$SKILL_DIR/templates/report.md.tmpl" | sed 's/[[:space:]]*$//')"
|
|
6086
6230
|
[ -n "$TMPL_FLIP_HEAD" ] || TMPL_FLIP_HEAD='## Flip evidence'
|
|
6087
6231
|
{ printf '# T1.1 · template shaped report\n\n'
|
|
@@ -6140,9 +6284,27 @@ assert_match "$TMP/status-f3.log" 'stale: verified [0-9a-f]+, branch now [0-9a-f
|
|
|
6140
6284
|
assert_eq "F3 分支已被合并删除(解析不到)→ 不算过期(否则合并后任务永远待办)" \
|
|
6141
6285
|
"$(TEAM_ROOT=$REPO bash -c '. "'$SKILL_DIR'/scripts/lib/common.sh"; . "'$SKILL_DIR'/scripts/lib/cmd-review.sh"; team_load_config; team_resolve_branch() { printf "no-such-branch\\n"; }; team_review_branch_tip T1.1')" ""
|
|
6142
6286
|
|
|
6143
|
-
# 10b
|
|
6287
|
+
# 10b 收尾:真实 verify 运行 + 恢复硬编码 PM 署名的红/绿/还原。变异只在自己的 skill 副本里。
|
|
6144
6288
|
rev_refresh; rec_reset
|
|
6145
|
-
$TEAM review T1.1 --dir "$REV_WT"
|
|
6289
|
+
( cd "$REPO/.worktrees/verify" && $TEAM review T1.1 --dir "$REV_WT" ) >"$TMP/p439-review-restored-baseline.log" 2>&1
|
|
6290
|
+
review_record_has_verifier >"$TMP/p439-review-green.log" 2>&1 \
|
|
6291
|
+
&& ok "10b verifier 证据绿:真实 verify + reviewed SHA + 指定 record/log" \
|
|
6292
|
+
|| { bad "10b verifier 证据绿失败"; cat "$TMP/p439-review-green.log"; }
|
|
6293
|
+
P439_MUT="$TMP/p439-review-pm-attribution"; rm -rf "$P439_MUT"; cp -a "$SKILL_DIR" "$P439_MUT"
|
|
6294
|
+
sed -i 's/# %s · 独立复验/# %s · PM 独立复验/' "$P439_MUT/scripts/lib/cmd-review.sh"
|
|
6295
|
+
rec_reset
|
|
6296
|
+
( cd "$REPO/.worktrees/verify" && bash "$P439_MUT/scripts/team" review T1.1 --dir "$REV_WT" ) >"$TMP/p439-review-pm-mutant.log" 2>&1
|
|
6297
|
+
if review_record_has_verifier >"$TMP/p439-review-red.log" 2>&1; then
|
|
6298
|
+
bad "10b 红侧失效:恢复 PM 独立复验署名仍通过执行者证据断言"
|
|
6299
|
+
else
|
|
6300
|
+
ok "10b 红侧:恢复 PM 独立复验署名 → 执行者证据断言红($(tr '\n' ' ' < "$TMP/p439-review-red.log"))"
|
|
6301
|
+
fi
|
|
6302
|
+
cp "$SKILL_DIR/scripts/lib/cmd-review.sh" "$P439_MUT/scripts/lib/cmd-review.sh"
|
|
6303
|
+
rec_reset
|
|
6304
|
+
( cd "$REPO/.worktrees/verify" && bash "$P439_MUT/scripts/team" review T1.1 --dir "$REV_WT" ) >"$TMP/p439-review-restored.log" 2>&1
|
|
6305
|
+
review_record_has_verifier >"$TMP/p439-review-restore-green.log" 2>&1 \
|
|
6306
|
+
&& ok "10b 还原绿:恢复真实执行者署名后同一断言通过" \
|
|
6307
|
+
|| { bad "10b 还原后执行者证据仍红"; cat "$TMP/p439-review-restore-green.log"; }
|
|
6146
6308
|
assert_has "$REPO/docs/team/reviews/T1.1.md" "判定: **PASS**" "10b 收尾:恢复干净 checkout 上的 PASS 记录"
|
|
6147
6309
|
$TEAM digest >"$TMP/digest-10b-end.log" 2>&1 || true
|
|
6148
6310
|
assert_not "$TMP/digest-10b-end.log" "T1.1-dev" "10b 收尾:记录有效后不再列为待复验"
|
|
@@ -11033,6 +11195,83 @@ rm -f "$M71R/AGENTS.md"
|
|
|
11033
11195
|
cmp -s "$TMP/m71-block.md" "$M71R/AGENTS.md" \
|
|
11034
11196
|
&& ok "文件缺失:建出来的就是那一块渲染段" || bad "文件缺失:建出来的不是渲染段"
|
|
11035
11197
|
|
|
11198
|
+
# ②f P440/P456:PROTOCOL 与 AGENTS 的三种安装形状都使用可移植且不虚构的命令路径。
|
|
11199
|
+
p440_new_repo() { rm -rf "$1"; mkdir -p "$1"; ( cd "$1" && git init -q -b main && git config user.email smoke@teamsmith && git config user.name smoke && git commit -q --allow-empty -m init ); }
|
|
11200
|
+
p440_protocol_paths_ok() { # <repo> <skills/teamsmith|.pi/skills/teamsmith|<skill-dir>>
|
|
11201
|
+
local repo="$1" expected="$2" f ref command_line wt="$1/.worktrees/path-check"
|
|
11202
|
+
for f in "$repo/docs/team/PROTOCOL.md" "$repo/AGENTS.md"; do
|
|
11203
|
+
ref="$expected"
|
|
11204
|
+
if [ "$f" = "$repo/AGENTS.md" ] && [ "$expected" = '.pi/skills/teamsmith' ]; then
|
|
11205
|
+
ref='"$(git rev-parse --path-format=absolute --git-common-dir)/../.pi/skills/teamsmith"'
|
|
11206
|
+
fi
|
|
11207
|
+
[ -f "$f" ] || { printf 'document missing\n'; return 1; }
|
|
11208
|
+
! grep -qF "$repo" "$f" || { printf 'absolute main root remains\n'; return 1; }
|
|
11209
|
+
if [ "${HOME:-}" != "/" ]; then
|
|
11210
|
+
! grep -qF "$HOME" "$f" || { printf 'absolute home remains\n'; return 1; }
|
|
11211
|
+
fi
|
|
11212
|
+
grep -qF "bash $ref/scripts/team help" "$f" || { printf 'expected team command missing\n'; return 1; }
|
|
11213
|
+
if [ "$expected" = '<skill-dir>' ]; then
|
|
11214
|
+
! grep -qF '.pi/skills/teamsmith' "$f" || { printf 'no-skills invented an install path\n'; return 1; }
|
|
11215
|
+
else
|
|
11216
|
+
[ -f "$repo/$expected/scripts/team" ] || { printf 'rendered team command does not exist\n'; return 1; }
|
|
11217
|
+
[ -f "$repo/$expected/tests/smoke.sh" ] || { printf 'rendered smoke command does not exist\n'; return 1; }
|
|
11218
|
+
fi
|
|
11219
|
+
done
|
|
11220
|
+
if [ "$expected" != '<skill-dir>' ]; then
|
|
11221
|
+
command_line="$(sed -n 's/.*Tooling: `\(bash .*\/scripts\/team help\)`.*/\1/p' "$repo/AGENTS.md")"
|
|
11222
|
+
( cd "$repo" && bash -c "$command_line" ) || return 1
|
|
11223
|
+
git -C "$repo" worktree add -q --detach "$wt" HEAD || return 1
|
|
11224
|
+
( cd "$wt" && bash -c "$command_line" ); local rc=$?
|
|
11225
|
+
git -C "$repo" worktree remove "$wt" || return 1
|
|
11226
|
+
[ "$rc" -eq 0 ] || { printf 'worker team command failed\n'; return 1; }
|
|
11227
|
+
fi
|
|
11228
|
+
}
|
|
11229
|
+
P440_NORMAL="$TMP/p440-normal-project"; p440_new_repo "$P440_NORMAL"
|
|
11230
|
+
( cd "$P440_NORMAL" && $TEAM init --session p440-normal --agents dev --vcs local --gates true "${P235_MODELS[@]}" ) >"$TMP/p440-normal-init.log" 2>&1 \
|
|
11231
|
+
|| { bad "P440 普通项目 init 失败"; tail -8 "$TMP/p440-normal-init.log"; }
|
|
11232
|
+
p440_protocol_paths_ok "$P440_NORMAL" '.pi/skills/teamsmith' >"$TMP/p440-normal-protocol.log" 2>&1 \
|
|
11233
|
+
&& ok "P440/P456 init 普通项目:PROTOCOL/AGENTS 不含 main/home 绝对路径,AGENTS 命令在主检出与 worker 均可用" \
|
|
11234
|
+
|| { bad "P440 init 普通项目路径断言失败"; cat "$TMP/p440-normal-protocol.log"; }
|
|
11235
|
+
|
|
11236
|
+
P440_SOURCE="$TMP/p440-source-project"; p440_new_repo "$P440_SOURCE"; mkdir -p "$P440_SOURCE/skills"
|
|
11237
|
+
cp -a "$SKILL_DIR" "$P440_SOURCE/skills/teamsmith"; cp -a "$SKILL_INIT_DIR" "$P440_SOURCE/skills/teamsmith-init"
|
|
11238
|
+
( cd "$P440_SOURCE" && git add skills && git commit -qm fixture-skills ) || bad "P456 源仓技能入夹具提交失败"
|
|
11239
|
+
( cd "$P440_SOURCE" && bash skills/teamsmith/scripts/team init --session p440-source --agents dev --vcs local --gates true "${P235_MODELS[@]}" ) >"$TMP/p440-source-init.log" 2>&1 \
|
|
11240
|
+
|| { bad "P440 源仓 init 失败"; tail -8 "$TMP/p440-source-init.log"; }
|
|
11241
|
+
p440_protocol_paths_ok "$P440_SOURCE" 'skills/teamsmith' >"$TMP/p440-source-protocol.log" 2>&1 \
|
|
11242
|
+
&& ok "P440/P456 init 源仓:PROTOCOL/AGENTS 用 skills/teamsmith 相对路径,AGENTS 命令在主检出与 worker 均可用" \
|
|
11243
|
+
|| { bad "P440 init 源仓路径断言失败"; cat "$TMP/p440-source-protocol.log"; }
|
|
11244
|
+
|
|
11245
|
+
P440_NOSKILLS="$TMP/p440-no-skills-project"; p440_new_repo "$P440_NOSKILLS"
|
|
11246
|
+
( cd "$P440_NOSKILLS" && $TEAM init --no-skills --session p440-no-skills --agents dev --vcs local --gates true "${P235_MODELS[@]}" ) >"$TMP/p440-no-skills-init.log" 2>&1 \
|
|
11247
|
+
|| { bad "P440 --no-skills init 失败"; tail -8 "$TMP/p440-no-skills-init.log"; }
|
|
11248
|
+
p440_protocol_paths_ok "$P440_NOSKILLS" '<skill-dir>' >"$TMP/p440-no-skills-protocol.log" 2>&1 \
|
|
11249
|
+
&& ok "P440 init --no-skills:只写明确占位,不伪造 .pi/skills 安装路径" \
|
|
11250
|
+
|| { bad "P440 init --no-skills 路径断言失败"; cat "$TMP/p440-no-skills-protocol.log"; }
|
|
11251
|
+
|
|
11252
|
+
# P456 沿用 P440 的红/绿/恢复:只把 AGENTS 的生成参数改回绝对 SKILL_DIR,同一行为断言必须红。
|
|
11253
|
+
cp "$P440_SOURCE/skills/teamsmith/scripts/lib/cmd-project.sh" "$TMP/p440-cmd-project.backup"
|
|
11254
|
+
python3 - "$P440_SOURCE/skills/teamsmith/scripts/lib/cmd-project.sh" <<'PY'
|
|
11255
|
+
import sys
|
|
11256
|
+
p = sys.argv[1]
|
|
11257
|
+
s = open(p, encoding='utf-8').read()
|
|
11258
|
+
old = '"SKILL_DIR=$agents_skill_dir" "AGENTS=$agents" "GATES=${gates:-<未配置>}"'
|
|
11259
|
+
assert s.count(old) == 1, 'P456 AGENTS render binding not found exactly once'
|
|
11260
|
+
new = '"SKILL_DIR=$TEAM_SKILL_DIR" "AGENTS=$agents" "GATES=${gates:-<未配置>}"'
|
|
11261
|
+
open(p, 'w', encoding='utf-8').write(s.replace(old, new, 1))
|
|
11262
|
+
PY
|
|
11263
|
+
( cd "$P440_SOURCE" && bash skills/teamsmith/scripts/team init --force --session p440-source --agents dev --vcs local --gates true "${P235_MODELS[@]}" ) >"$TMP/p440-source-mutant.log" 2>&1
|
|
11264
|
+
if p440_protocol_paths_ok "$P440_SOURCE" 'skills/teamsmith' >"$TMP/p440-source-red.log" 2>&1; then
|
|
11265
|
+
bad "P456 init 红侧失效:恢复绝对 SKILL_DIR 仍通过 AGENTS 路径断言"
|
|
11266
|
+
else
|
|
11267
|
+
ok "P440 init 红:恢复绝对 SKILL_DIR → 断言红($(tr '\n' ' ' < "$TMP/p440-source-red.log"))"
|
|
11268
|
+
fi
|
|
11269
|
+
cp "$TMP/p440-cmd-project.backup" "$P440_SOURCE/skills/teamsmith/scripts/lib/cmd-project.sh"
|
|
11270
|
+
( cd "$P440_SOURCE" && bash skills/teamsmith/scripts/team init --force --session p440-source --agents dev --vcs local --gates true "${P235_MODELS[@]}" ) >"$TMP/p440-source-restored.log" 2>&1
|
|
11271
|
+
p440_protocol_paths_ok "$P440_SOURCE" 'skills/teamsmith' >"$TMP/p440-source-restore-green.log" 2>&1 \
|
|
11272
|
+
&& ok "P440 init 还原绿:源仓相对路径与真实命令恢复" \
|
|
11273
|
+
|| { bad "P440 init 还原后仍红"; cat "$TMP/p440-source-restore-green.log"; }
|
|
11274
|
+
|
|
11036
11275
|
# ③ P417:会话新旧改成推导 —— PM 进程启动时刻 vs skill 文件最近 mtime;没有记录可读,也没有记录要维护。
|
|
11037
11276
|
# 夹具:一份 skill 副本(真树在门禁期间不写;mtime 全钉在 2020)+ 一个真活进程当 PM(本段自己)。
|
|
11038
11277
|
mkdir -p "$M71/.pi/team/state"
|
|
@@ -11630,7 +11869,7 @@ os_need() {
|
|
|
11630
11869
|
os_pipeline_hits() { # <skill 目录> → 违规行(空 = 通过)
|
|
11631
11870
|
local d="$1" f="$1/references/openspec.md" p t n
|
|
11632
11871
|
if [ ! -f "$f" ]; then printf 'references/openspec.md: GUIDE-MISSING\n'; return 0; fi
|
|
11633
|
-
# ①
|
|
11872
|
+
# ① 五个阶段各一行:非空不够,verify/archive 的执行者必须不是 PM;合并后仍由同一 verifier 执行。
|
|
11634
11873
|
for p in $OS_PHASES; do
|
|
11635
11874
|
awk -F'|' -v p="$p" '
|
|
11636
11875
|
$3 ~ ("`opsx-" p "`") {
|
|
@@ -11638,11 +11877,24 @@ os_pipeline_hits() { # <skill 目录> → 违规行(空 = 通过)
|
|
|
11638
11877
|
owner = $4; gate = $7
|
|
11639
11878
|
gsub(/[[:space:]]/, "", owner); gsub(/[[:space:]]/, "", gate)
|
|
11640
11879
|
if (owner == "") print "OWNER-EMPTY " p
|
|
11880
|
+
if ((p == "verify" || p == "archive") && owner ~ /PM/) print "OWNER-PM " p
|
|
11641
11881
|
if (gate == "") print "GATE-EMPTY " p
|
|
11642
11882
|
}
|
|
11643
11883
|
END { if (!row) print "ROW-MISSING " p }
|
|
11644
11884
|
' "$f" | sed 's|^|references/openspec.md: |'
|
|
11645
11885
|
done
|
|
11886
|
+
local v_row a_row para
|
|
11887
|
+
v_row="$(awk -F'|' '$3 ~ /`opsx-verify`/ { print; exit }' "$f")"
|
|
11888
|
+
os_need "$v_row" references/openspec.md POST-MERGE-OWNER-MISSING \
|
|
11889
|
+
'same verifier' 'merged SHA' 'PM accepts' 'done'
|
|
11890
|
+
a_row="$(awk -F'|' '$3 ~ /`opsx-archive`/ { print; exit }' "$f")"
|
|
11891
|
+
os_need "$a_row" references/openspec.md VERIFY-PREREQ-MISSING 'completed merged-revision verification'
|
|
11892
|
+
os_need "$a_row" references/openspec.md CRITICAL-GATE-MISSING 'zero unresolved CRITICAL findings'
|
|
11893
|
+
os_need "$a_row" references/openspec.md ARCHIVE-WORKTREE-MISSING 'own worktree/task branch'
|
|
11894
|
+
os_need "$a_row" references/openspec.md ARCHIVE-SELF-PHASE 'phase=archive' 'opsx-archive'
|
|
11895
|
+
para="$(os_para_with "$f" 'For dependent archives')"
|
|
11896
|
+
os_need "$para" references/openspec.md ARCHIVE-BASELINE-MISSING \
|
|
11897
|
+
'predecessor archive is accepted and' 'merged first' 'complete MODIFIED block/scenario'
|
|
11646
11898
|
# ② 硬规则:没人复验自己的工作(「归档要用户确认」那一条由 ⑥ 的逐文件循环覆盖 —— 原来这里对
|
|
11647
11899
|
# references/openspec.md 还查过一遍同样的正则,P404 按净零纪律把它退了:同一条断言写两遍,
|
|
11648
11900
|
# 删掉哪一遍都不改变判定,只会让红侧点名的理由有两条互相遮蔽)
|
|
@@ -11658,13 +11910,32 @@ os_pipeline_hits() { # <skill 目录> → 违规行(空 = 通过)
|
|
|
11658
11910
|
grep -q 'openspec instructions' "$f" || printf 'references/openspec.md: DOCS-POINTER-MISSING\n'
|
|
11659
11911
|
grep -q 'openspec init --tools pi' "$f" || printf 'references/openspec.md: PRECONDITION-MISSING\n'
|
|
11660
11912
|
grep -qE '^### Requirement:' "$f" && printf 'references/openspec.md: ARTIFACT-SYNTAX-COPIED\n'
|
|
11661
|
-
# ⑥ 这条门必须写进 agent/PM
|
|
11913
|
+
# ⑥ 这条门必须写进 agent/PM 真正读的文件;判据落在执行段落,而不是文件里孤立的 independent 字样。
|
|
11662
11914
|
for t in templates/AGENTS.section.md.tmpl templates/PROTOCOL.md.tmpl SKILL.md references/workflows.md; do
|
|
11663
11915
|
if [ ! -f "$d/$t" ]; then printf '%s: FILE-MISSING\n' "$t"; continue; fi
|
|
11664
11916
|
grep -q 'opsx-apply' "$d/$t" || printf '%s: PHASE-NAMES-MISSING\n' "$t"
|
|
11665
11917
|
grep -q 'ACCEPTED' "$d/$t" || printf '%s: APPLY-GATE-MISSING\n' "$t"
|
|
11666
|
-
grep -qi 'independent' "$d/$t" || printf '%s: INDEPENDENT-VERIFY-MISSING\n' "$t"
|
|
11667
11918
|
done
|
|
11919
|
+
for t in templates/AGENTS.section.md.tmpl templates/PROTOCOL.md.tmpl SKILL.md; do
|
|
11920
|
+
para="$(os_para_with "$d/$t" 'A change runs as')"
|
|
11921
|
+
os_need "$para" "$t" 'OWNER-PM verify' '**different** agent' 'opsx-verify'
|
|
11922
|
+
os_need "$para" "$t" 'OWNER-PM archive' 'non-implementer worker' 'opsx-archive'
|
|
11923
|
+
os_need "$para" "$t" POST-MERGE-OWNER-MISSING 'same verifier'
|
|
11924
|
+
done
|
|
11925
|
+
para="$(awk -F'|' '$3 ~ /`opsx-verify`/ { print; exit }' "$d/references/workflows.md")"
|
|
11926
|
+
os_need "$para" references/workflows.md POST-MERGE-OWNER-MISSING 'same verifier' 'merged SHA' 'PM accepts'
|
|
11927
|
+
para="$(awk -F'|' '$3 ~ /`opsx-archive`/ { print; exit }' "$d/references/workflows.md")"
|
|
11928
|
+
os_need "$para" references/workflows.md OWNER-PM-archive 'non-implementer worker'
|
|
11929
|
+
# PM 的后台作业不能顶替委派;归档记录例外只覆盖指定 record/log。
|
|
11930
|
+
para="$(os_para_with "$d/templates/pm-prompt.md.tmpl" 'PM-owned')"
|
|
11931
|
+
os_need "$para" templates/pm-prompt.md.tmpl PM-BACKGROUND-VERIFY 'does not satisfy delegation' 'assigned non-implementer workers'
|
|
11932
|
+
para="$(os_para_with "$d/templates/OWNERSHIP.md.tmpl" 'Narrow review exception')"
|
|
11933
|
+
os_need "$para" templates/OWNERSHIP.md.tmpl LEDGER-EXCEPTION-MISSING \
|
|
11934
|
+
'docs/team/reviews/<ID>.md' '<ID>-verify.log' 'no other manual main-checkout write'
|
|
11935
|
+
# team init 的 D1 也必须把执行与接受分开,不能把 PM 复验写进每个新项目。
|
|
11936
|
+
para="$(os_para_with "$d/templates/DECISIONS.md.tmpl" 'Issue')"
|
|
11937
|
+
os_need "$para" templates/DECISIONS.md.tmpl 'OWNER-PM verify' \
|
|
11938
|
+
'verifier 独立复验' 'PM 审阅接受' 'PM 必须审阅复验证据与 diff' '不得以自己执行替代委派'
|
|
11668
11939
|
# ⑥b 任务书模板:`phase:` 头 + 五阶段枚举 + apply 门(这一份是 PM 抄着写简报的底稿)
|
|
11669
11940
|
t=templates/task.md.tmpl
|
|
11670
11941
|
if [ ! -f "$d/$t" ]; then printf '%s: FILE-MISSING\n' "$t"; else
|
|
@@ -11672,8 +11943,10 @@ os_pipeline_hits() { # <skill 目录> → 违规行(空 = 通过)
|
|
|
11672
11943
|
grep -q 'explore|propose|apply|verify|archive' "$d/$t" || printf '%s: PHASE-ENUM-MISSING\n' "$t"
|
|
11673
11944
|
grep -q 'ACCEPTED' "$d/$t" || printf '%s: APPLY-GATE-MISSING\n' "$t"
|
|
11674
11945
|
fi
|
|
11946
|
+
# 用户确认仍保留;限定的 PM-proxy 也必须带小步、可逆、已批准方案与记录理由,而非被删掉或无限放宽。
|
|
11675
11947
|
for t in templates/AGENTS.section.md.tmpl templates/PROTOCOL.md.tmpl SKILL.md references/workflows.md references/openspec.md; do
|
|
11676
|
-
|
|
11948
|
+
para="$(os_para_with "$d/$t" 'user.*confirm|confirm.*user')"
|
|
11949
|
+
os_need "$para" "$t" USER-CONFIRM-MISSING 'user' 'confirm' 'small, reversible' 'approved approach'
|
|
11677
11950
|
done
|
|
11678
11951
|
# ⑦ P404 · 规格点名的两处声明面(V125 实测:这两处此前**没有断言守着**,删掉整句、把冻结措辞改成
|
|
11679
11952
|
# 禁语,门禁都还是绿的)。判据取**段落里的实质**:先按空行取出那一段,再要求段落内同时有两条命令、
|
|
@@ -11789,6 +12062,30 @@ OS_CLEAN_HITS="$(os_pipeline_hits "$OS_SB")"
|
|
|
11789
12062
|
os_flip_red "指南里删掉 apply 那一行" "ROW-MISSING apply" "references/openspec.md" '/^| 3 | /d'
|
|
11790
12063
|
os_flip_red "掏空 verify 行的所有者单元格" "OWNER-EMPTY verify" "references/openspec.md" \
|
|
11791
12064
|
's/^| 4 | `opsx-verify` |[^|]*|/| 4 | `opsx-verify` | |/'
|
|
12065
|
+
os_flip_red "verify 所有者改回 PM(非空也算错)" "references/openspec.md: OWNER-PM verify" "references/openspec.md" \
|
|
12066
|
+
-E '/^\| 4 \| `opsx-verify`/s/an \*\*independent verify\*\* agent \(never the implementer\)/**PM**/'
|
|
12067
|
+
os_flip_red "archive 所有者改回 PM" "references/openspec.md: OWNER-PM archive" "references/openspec.md" \
|
|
12068
|
+
-E '/^\| 5 \| `opsx-archive`/s/a \*\*non-implementer worker\*\*/**PM**/'
|
|
12069
|
+
os_flip_red "AGENTS 的 verify 执行者改回 PM" "templates/AGENTS.section.md.tmpl: OWNER-PM verify" "templates/AGENTS.section.md.tmpl" \
|
|
12070
|
+
-E 's/a \*\*different\*\* agent runs/a PM runs/'
|
|
12071
|
+
os_flip_red "DECISIONS 的复验执行者改回 PM" "templates/DECISIONS.md.tmpl: OWNER-PM verify" "templates/DECISIONS.md.tmpl" \
|
|
12072
|
+
's/verifier 独立复验/PM 独立复验/'
|
|
12073
|
+
os_flip_red "合并后不再由同一 verifier 执行" "POST-MERGE-OWNER-MISSING" "references/openspec.md" \
|
|
12074
|
+
's/same verifier/PM/g'
|
|
12075
|
+
os_flip_red "归档允许缺 completed merged-revision verification" "VERIFY-PREREQ-MISSING" "references/openspec.md" \
|
|
12076
|
+
's/completed merged-revision verification/verification optional/g'
|
|
12077
|
+
os_flip_red "归档允许未清 CRITICAL" "CRITICAL-GATE-MISSING" "references/openspec.md" \
|
|
12078
|
+
's/zero unresolved CRITICAL findings/CRITICAL findings optional/g'
|
|
12079
|
+
os_flip_red "归档缺自己的 worktree/task branch 边界" "ARCHIVE-WORKTREE-MISSING" "references/openspec.md" \
|
|
12080
|
+
's/own worktree\/task branch/any checkout/g'
|
|
12081
|
+
os_flip_red "归档自身 phase 写成命令名而非 archive" "ARCHIVE-SELF-PHASE" "references/openspec.md" \
|
|
12082
|
+
's/phase=archive/phase=opsx-archive/g'
|
|
12083
|
+
os_flip_red "归档缺 predecessor merged baseline 对账" "ARCHIVE-BASELINE-MISSING" "references/openspec.md" \
|
|
12084
|
+
's/For dependent archives/For no ordering/'
|
|
12085
|
+
os_flip_red "PM 后台门禁被写成满足委派" "PM-BACKGROUND-VERIFY" "templates/pm-prompt.md.tmpl" \
|
|
12086
|
+
's/does not satisfy delegation/satisfies delegation/'
|
|
12087
|
+
os_flip_red "主检出写例外缺 companion log" "LEDGER-EXCEPTION-MISSING" "templates/OWNERSHIP.md.tmpl" \
|
|
12088
|
+
's/<ID>-verify.log//'
|
|
11792
12089
|
os_flip_red "掏空 propose 行的门禁单元格" "GATE-EMPTY propose" "references/openspec.md" \
|
|
11793
12090
|
's/\(^| 2 | .*`opsx-propose`.*\)|[^|]*|$/\1| |/'
|
|
11794
12091
|
os_flip_red "删掉「未 ACCEPTED 不得派 apply」" "APPLY-GATE-MISSING" "references/openspec.md" '/No apply brief may be dispatched/d'
|
|
@@ -11803,7 +12100,8 @@ os_flip_red "任务书模板不再提 apply 门" "APPLY-GATE-MISSING" "templates
|
|
|
11803
12100
|
os_flip_red "AGENTS 协议段不再提用户确认" "USER-CONFIRM-MISSING" "templates/AGENTS.section.md.tmpl" \
|
|
11804
12101
|
-E 's/user[^|]*confirm[^|]*/ACCOUNTABILITY-REMOVED/g'
|
|
11805
12102
|
os_flip_red "任务书模板删掉 phase: 头" "PHASE-FIELD-MISSING" "templates/task.md.tmpl" '/^phase:/d'
|
|
11806
|
-
os_flip_red "runbook
|
|
12103
|
+
os_flip_red "runbook 合并后缺同一 verifier" "references/workflows.md: POST-MERGE-OWNER-MISSING" "references/workflows.md" \
|
|
12104
|
+
'/^| 4 | `opsx-verify`/s/same verifier/PM/'
|
|
11807
12105
|
# P404 · 两处声明面的红侧(V125 的三个变异:此前每一个都还能全绿)
|
|
11808
12106
|
os_flip_red "删掉 SKILL.md 的双门禁分工那段" "TWO-GATES-MISSING" "SKILL.md" \
|
|
11809
12107
|
'/^The two gates answer different questions/,/^$/d'
|
|
@@ -13461,6 +13759,42 @@ else
|
|
|
13461
13759
|
fi
|
|
13462
13760
|
p10m env TEAM_REQUIRE_JS=0 $TEAM paths >"$TMP/p10-paths-reqjs.log" 2>&1
|
|
13463
13761
|
assert_has "$TMP/p10-paths-reqjs.log" '"require_js": "0"' "26-k paths:TEAM_REQUIRE_JS=0 反映在 paths 里"
|
|
13762
|
+
P10_FLOCK_FIXTURE="$(command -v flock || true)"
|
|
13763
|
+
if [ -n "$P10_FLOCK_FIXTURE" ] && [ -n "$P10_JS_FIXTURE" ]; then
|
|
13764
|
+
assert_has "$TMP/p10-paths.log" "\"flock_runner\": \"$P10_FLOCK_FIXTURE\"" "26-k paths:报出事务实际使用的 flock 绝对路径"
|
|
13765
|
+
P10_NOFLOCK="$TMP/p10-noflock-bin"
|
|
13766
|
+
cp -a "$P10_NOJS" "$P10_NOFLOCK"
|
|
13767
|
+
rm -f "$P10_NOFLOCK/flock"
|
|
13768
|
+
p10nojs env PATH="$P10_NOFLOCK" TEAM_JS_BIN="$P10_JS_FIXTURE" $TEAM paths >"$TMP/p10-paths-noflock.log" 2>&1
|
|
13769
|
+
assert_has "$TMP/p10-paths-noflock.log" '"flock_runner": ""' "26-k paths:缺 flock 时如实给出空解析结果"
|
|
13770
|
+
if p10nojs env PATH="$P10_NOFLOCK" TEAM_JS_BIN="$P10_JS_FIXTURE" $TEAM doctor >"$TMP/p10-doctor-noflock.log" 2>&1; then
|
|
13771
|
+
bad "26-k flock:缺 flock 时 doctor 应失败"
|
|
13772
|
+
else
|
|
13773
|
+
ok "26-k flock:没有 Reminder 的项目缺 flock,doctor 仍失败"
|
|
13774
|
+
fi
|
|
13775
|
+
assert_has "$TMP/p10-doctor-noflock.log" "状态锁 flock" "26-k flock:失败行点名状态锁"
|
|
13776
|
+
assert_has "$TMP/p10-doctor-noflock.log" "PATH 里没有可执行 flock" "26-k flock:失败行区分 PATH 中缺失"
|
|
13777
|
+
assert_has "$TMP/p10-doctor-noflock.log" "util-linux" "26-k flock:缺失行给出安装修复方式"
|
|
13778
|
+
P10_BADFLOCK="$TMP/p10-badflock-bin"
|
|
13779
|
+
cp -a "$P10_NOFLOCK" "$P10_BADFLOCK"
|
|
13780
|
+
printf 'not executable\n' >"$P10_BADFLOCK/flock"
|
|
13781
|
+
chmod 0644 "$P10_BADFLOCK/flock"
|
|
13782
|
+
if [ "$(env PATH="$P10_BADFLOCK" bash -c 'command -v flock')" = "$P10_BADFLOCK/flock" ] \
|
|
13783
|
+
&& [ ! -x "$P10_BADFLOCK/flock" ]; then
|
|
13784
|
+
ok "26-k flock 夹具:PATH 里有 flock 文件但不可执行(不是空 PATH 假象)"
|
|
13785
|
+
else
|
|
13786
|
+
bad "26-k flock 夹具:没有造出「找得到文件、但没有执行权限」的形状"
|
|
13787
|
+
fi
|
|
13788
|
+
if p10nojs env PATH="$P10_BADFLOCK" TEAM_JS_BIN="$P10_JS_FIXTURE" $TEAM doctor >"$TMP/p10-doctor-badflock.log" 2>&1; then
|
|
13789
|
+
bad "26-k flock:不可执行 flock 时 doctor 应失败"
|
|
13790
|
+
else
|
|
13791
|
+
ok "26-k flock:不可执行 flock → doctor 失败"
|
|
13792
|
+
fi
|
|
13793
|
+
assert_has "$TMP/p10-doctor-badflock.log" "$P10_BADFLOCK/flock" "26-k flock:不可执行行点名实际路径"
|
|
13794
|
+
assert_has "$TMP/p10-doctor-badflock.log" "chmod +x" "26-k flock:不可执行行给出权限修复方式"
|
|
13795
|
+
else
|
|
13796
|
+
cond_skip "26-k flock paths/doctor" "本机缺 flock 或 JS 运行时;权威夹具另有缺锁负例"
|
|
13797
|
+
fi
|
|
13464
13798
|
|
|
13465
13799
|
# ---------------------------------------------------------------- 26-l. 文档契约 + 隔离(真项目零污染)
|
|
13466
13800
|
# R11-S2 的另一半:活动列的新默认值是**写在文档里**的契约变更,不是悄悄改的
|
|
@@ -14735,10 +15069,10 @@ PYRC
|
|
|
14735
15069
|
assert_eq "28-i2 项目根软链:还原后 change/decision 照常服务" "$P28I2_RL_CTL" "ok"
|
|
14736
15070
|
|
|
14737
15071
|
# ---- 28-i3 项目内的软链(P424)
|
|
14738
|
-
#
|
|
14739
|
-
#
|
|
14740
|
-
#
|
|
14741
|
-
P28I3="$P27R/
|
|
15072
|
+
# 现场形状:`docs/team → module/docs/team`(同一项目内)。旧判据按「路径上任一段是软链」拒绝,
|
|
15073
|
+
# 详情面整页不可用;新判据只看**解析后的落点**。翻转证据在报告里(判据改回「任一段是软链就拒」→
|
|
15074
|
+
# 「项目内软链的详情可读」那条必须变红),这里钉正向与反面。
|
|
15075
|
+
P28I3="$P27R/module"
|
|
14742
15076
|
mkdir -p "$P28I3/docs"
|
|
14743
15077
|
mv "$P27R/docs/team" "$P28I3/docs/team"
|
|
14744
15078
|
ln -sfn "$P28I3/docs/team" "$P27R/docs/team"
|
|
@@ -17828,10 +18162,10 @@ assert_eq "12i --force 越过守卫" "$([ "$(p24_shim_windows)" -ge 1 ] && echo
|
|
|
17828
18162
|
section "12j · 归档前提(P24/B6)"
|
|
17829
18163
|
P24J="$(p24_project 12j)"
|
|
17830
18164
|
mkdir -p "$P24J/openspec/changes/archive/2026-09-20-alpha"
|
|
17831
|
-
p24_brief "$P24J" A1
|
|
18165
|
+
p24_brief "$P24J" A1 verify archive alpha -
|
|
17832
18166
|
p24_brief "$P24J" M1 dev apply alpha -
|
|
17833
|
-
p24_brief "$P24J" C1
|
|
17834
|
-
p24_add "$P24J" A1
|
|
18167
|
+
p24_brief "$P24J" C1 verify archive - -
|
|
18168
|
+
p24_add "$P24J" A1 verify; p24_add "$P24J" M1 dev; p24_add "$P24J" C1 verify
|
|
17835
18169
|
p24_team "$P24J" board set M1 wip >/dev/null 2>&1
|
|
17836
18170
|
A1_ROW="$(p24_board_row "$P24J" A1)"
|
|
17837
18171
|
J_OUT="$(p24_team "$P24J" board set A1 done)"; J_RC=$?
|
|
@@ -17875,8 +18209,8 @@ P209A="$(p24_project 12j-checklist)"
|
|
|
17875
18209
|
p24_change "$P209A" alpha
|
|
17876
18210
|
mkdir -p "$P209A/openspec/changes/archive/2026-10-03-alpha"
|
|
17877
18211
|
p24_brief "$P209A" M1 dev apply alpha -
|
|
17878
|
-
p24_brief "$P209A" A1
|
|
17879
|
-
p24_add "$P209A" M1 dev; p24_add "$P209A" A1
|
|
18212
|
+
p24_brief "$P209A" A1 verify archive alpha -
|
|
18213
|
+
p24_add "$P209A" M1 dev; p24_add "$P209A" A1 verify
|
|
17880
18214
|
p24_pass "$P209A" M1
|
|
17881
18215
|
p24_team "$P209A" board set M1 done >/dev/null 2>&1
|
|
17882
18216
|
cat > "$P209A/openspec/changes/alpha/tasks.md" <<'EOT'
|
|
@@ -17920,8 +18254,8 @@ assert_file "$P209A/docs/team/reviews/A1-done.md" "12j P209 done 证据落盘"
|
|
|
17920
18254
|
p24_brief "$P209A" M2 dev2 apply alpha -
|
|
17921
18255
|
p24_add "$P209A" M2 dev2
|
|
17922
18256
|
p24_team "$P209A" board set M2 wip >/dev/null 2>&1
|
|
17923
|
-
p24_brief "$P209A" A2
|
|
17924
|
-
p24_add "$P209A" A2
|
|
18257
|
+
p24_brief "$P209A" A2 verify archive alpha -
|
|
18258
|
+
p24_add "$P209A" A2 verify
|
|
17925
18259
|
A_RV="$(p24_team "$P209A" change status alpha)"; A_RV_RC=$?
|
|
17926
18260
|
assert_eq "12j P209 清单全勾但兄弟没结束 → 仍然非 0" "$A_RV_RC" "1"
|
|
17927
18261
|
assert_has_echo "$A_RV" "M2 · apply · wip ·" "12j P209 反向阻塞来自映射任务(不是清单)"
|
|
@@ -17932,8 +18266,8 @@ assert_has_echo "$A_RV_DONE" "M2 · apply · wip ·" "12j P209 反向拒绝点
|
|
|
17932
18266
|
assert_not_echo "$A_RV_DONE" "checklist" "12j P209 反向拒绝不提清单(新检查没顶掉旧的)"
|
|
17933
18267
|
# 归档之后:活动目录没了,读归档那份(真实时序里归档任务的 done 闸门这时才跑)
|
|
17934
18268
|
P209B="$(p24_project 12j-archived)"
|
|
17935
|
-
p24_brief "$P209B" B1
|
|
17936
|
-
p24_add "$P209B" B1
|
|
18269
|
+
p24_brief "$P209B" B1 verify archive beta -
|
|
18270
|
+
p24_add "$P209B" B1 verify
|
|
17937
18271
|
mkdir -p "$P209B/openspec/changes/archive/2026-10-03-beta"
|
|
17938
18272
|
printf '# Tasks: beta\n\n- [ ] 1.1 没勾\n' > "$P209B/openspec/changes/archive/2026-10-03-beta/tasks.md"
|
|
17939
18273
|
B_NC="$(p24_team "$P209B" change status beta)"; B_NC_RC=$?
|
|
@@ -24757,7 +25091,7 @@ else
|
|
|
24757
25091
|
if [ "$P406_RC" -eq 0 ]; then
|
|
24758
25092
|
P406_SUM="$(smoke_inner_summary "$TMP/p406-state-authority.log" state-authority)" || P406_SUM=""
|
|
24759
25093
|
if [ -n "$P406_SUM" ]; then
|
|
24760
|
-
ok "P406 权威层夹具全绿($P406_SUM:状态根 / 快照 / flock / 原子写 /
|
|
25094
|
+
ok "P406 权威层夹具全绿($P406_SUM:状态根 / 快照 / flock / 原子写 / 八条翻转臂)"
|
|
24761
25095
|
else
|
|
24762
25096
|
bad "P406 权威层夹具绿了但读不到它自己的结果行(夹具契约破了)"
|
|
24763
25097
|
fi
|
|
@@ -24776,7 +25110,7 @@ fi
|
|
|
24776
25110
|
# 覆盖 CLI 面(add/list/show/cancel)/ 输入拒绝 / key 幂等与释放 / 派生视图(手工改快照后计数跟着变)/
|
|
24777
25111
|
# 有界终结历史与已签发高水位 / 主项目隔离;五条翻转臂在 scratch 副本上把实现逐条改坏,要求具名断言变红。
|
|
24778
25112
|
# 纯逻辑:不建 tmux、不起 pi,FAST 与全量都跑。
|
|
24779
|
-
section "67 · 提醒:CLI / 派生视图 / 到期入队与投递(P409+P423
|
|
25113
|
+
section "67 · 提醒:CLI / PM 工具 / 派生视图 / 到期入队与投递(P409+P423+P442)"
|
|
24780
25114
|
P409_FIX="$SKILL_DIR/tests/remind-cli.sh"
|
|
24781
25115
|
if [ ! -f "$P409_FIX" ]; then
|
|
24782
25116
|
bad "P409 缺 tests/remind-cli.sh(提醒 CLI 夹具)"
|
|
@@ -24824,6 +25158,128 @@ else
|
|
|
24824
25158
|
fi
|
|
24825
25159
|
fi
|
|
24826
25160
|
|
|
25161
|
+
# P442:PM 工具的身份拒绝/全文红绿在假宿主上跑;真实 Pi/tmux + controlled model 是全量段的另一腿,
|
|
25162
|
+
# 不接触真实团队、真实模型或默认 tmux server。FAST 只显式跳过后者。
|
|
25163
|
+
P442_NODE_FIX="$SKILL_DIR/tests/remind-tool-node.mjs"
|
|
25164
|
+
if [ ! -f "$P442_NODE_FIX" ]; then
|
|
25165
|
+
bad "P442 缺 tests/remind-tool-node.mjs(PM 工具身份与全文夹具)"
|
|
25166
|
+
else
|
|
25167
|
+
node "$P442_NODE_FIX" >"$TMP/p442-remind-tool-node.log" 2>&1; P442_NODE_RC=$?
|
|
25168
|
+
if [ "$P442_NODE_RC" -eq 0 ]; then
|
|
25169
|
+
assert_has "$TMP/p442-remind-tool-node.log" "remind-tool-node: passed=9 failed=0" "P442 假宿主:身份零读写、配置解析与全文红绿全绿"
|
|
25170
|
+
else
|
|
25171
|
+
bad "P442 假宿主工具夹具红(rc=$P442_NODE_RC)"
|
|
25172
|
+
tail -12 "$TMP/p442-remind-tool-node.log" | sed 's/^/ /'
|
|
25173
|
+
fi
|
|
25174
|
+
fi
|
|
25175
|
+
P442_REAL_FIX="$SKILL_DIR/tests/remind-tool-real.sh"
|
|
25176
|
+
if [ "$FAST" = "1" ]; then
|
|
25177
|
+
cond_skip "P442 真实 Pi 工具夹具" "FAST:私有真实 Pi/tmux + controlled model 另跑"
|
|
25178
|
+
elif [ ! -f "$P442_REAL_FIX" ]; then
|
|
25179
|
+
bad "P442 缺 tests/remind-tool-real.sh"
|
|
25180
|
+
elif ! command -v "${P442_PI:-$HOME/.bun/bin/pi}" >/dev/null 2>&1; then
|
|
25181
|
+
cond_skip "P442 真实 Pi 工具夹具" "找不到真实 Pi(可设 P442_PI)"
|
|
25182
|
+
else
|
|
25183
|
+
bash "$P442_REAL_FIX" >"$TMP/p442-remind-tool-real.log" 2>&1; P442_REAL_RC=$?
|
|
25184
|
+
if [ "$P442_REAL_RC" -eq 0 ]; then
|
|
25185
|
+
assert_has "$TMP/p442-remind-tool-real.log" "remind-tool-real: passed=10 failed=0" "P442 真实 Pi:PM 工具/身份/配置错误/doctor 十组全绿"
|
|
25186
|
+
else
|
|
25187
|
+
bad "P442 真实 Pi 工具夹具红(rc=$P442_REAL_RC)"
|
|
25188
|
+
tail -16 "$TMP/p442-remind-tool-real.log" | sed 's/^/ /'
|
|
25189
|
+
fi
|
|
25190
|
+
fi
|
|
25191
|
+
|
|
25192
|
+
# ---------------------------------------------------------------- 68. Reminder 生命周期与恢复(P443)
|
|
25193
|
+
section "68 · 提醒:停止恢复 / 两种 Pulse / 并发与迟到生命周期(P443)"
|
|
25194
|
+
P443_LIFE="$SKILL_DIR/tests/remind-lifecycle.sh"
|
|
25195
|
+
if [ ! -f "$P443_LIFE" ]; then
|
|
25196
|
+
bad "P443 缺 tests/remind-lifecycle.sh"
|
|
25197
|
+
else
|
|
25198
|
+
bash "$P443_LIFE" >"$TMP/p443-lifecycle.log" 2>&1; P443_LIFE_RC=$?
|
|
25199
|
+
if [ "$P443_LIFE_RC" -eq 0 ]; then
|
|
25200
|
+
P443_LIFE_SUM="$(smoke_inner_summary "$TMP/p443-lifecycle.log" remind-lifecycle)" || P443_LIFE_SUM=""
|
|
25201
|
+
[ -n "$P443_LIFE_SUM" ] && ok "P443 生命周期夹具全绿($P443_LIFE_SUM)" || bad "P443 生命周期绿了但缺结果行"
|
|
25202
|
+
assert_has "$TMP/p443-lifecycle.log" "flip(去掉活跃 key 检查)" "P443 并发 key 的红侧真的跑了"
|
|
25203
|
+
assert_has "$TMP/p443-lifecycle.log" "flip(修剪丢掉 unknown)" "P443 活跃记录保留的红侧真的跑了"
|
|
25204
|
+
elif [ "$P443_LIFE_RC" -eq 3 ]; then
|
|
25205
|
+
cond_skip "P443 生命周期夹具" "缺少生命周期夹具前提"
|
|
25206
|
+
else
|
|
25207
|
+
bad "P443 生命周期夹具红(rc=$P443_LIFE_RC)"; tail -14 "$TMP/p443-lifecycle.log" | sed 's/^/ /'
|
|
25208
|
+
fi
|
|
25209
|
+
fi
|
|
25210
|
+
P443_UNIT="$SKILL_DIR/tests/remind-recovery-unit.sh"
|
|
25211
|
+
if [ ! -f "$P443_UNIT" ]; then
|
|
25212
|
+
bad "P443 缺 tests/remind-recovery-unit.sh"
|
|
25213
|
+
else
|
|
25214
|
+
bash "$P443_UNIT" >"$TMP/p443-recovery-unit.log" 2>&1; P443_UNIT_RC=$?
|
|
25215
|
+
if [ "$P443_UNIT_RC" -eq 0 ]; then
|
|
25216
|
+
P443_UNIT_SUM="$(smoke_inner_summary "$TMP/p443-recovery-unit.log" remind-recovery-unit)" || P443_UNIT_SUM=""
|
|
25217
|
+
[ -n "$P443_UNIT_SUM" ] && ok "P443 无提示启动与恢复拒绝矩阵全绿($P443_UNIT_SUM)" || bad "P443 恢复单元夹具绿了但缺结果行"
|
|
25218
|
+
else
|
|
25219
|
+
bad "P443 恢复单元夹具红(rc=$P443_UNIT_RC)"; tail -14 "$TMP/p443-recovery-unit.log" | sed 's/^/ /'
|
|
25220
|
+
fi
|
|
25221
|
+
fi
|
|
25222
|
+
P443_PULSE="$SKILL_DIR/tests/remind-pulse.sh"
|
|
25223
|
+
if [ "$FAST" = "1" ]; then
|
|
25224
|
+
cond_skip "P443 两种 Pulse 形状" "FAST:真实 headless/console 调度另跑"
|
|
25225
|
+
elif [ ! -f "$P443_PULSE" ]; then
|
|
25226
|
+
bad "P443 缺 tests/remind-pulse.sh"
|
|
25227
|
+
else
|
|
25228
|
+
bash "$P443_PULSE" >"$TMP/p443-pulse.log" 2>&1; P443_PULSE_RC=$?
|
|
25229
|
+
if [ "$P443_PULSE_RC" -eq 0 ]; then
|
|
25230
|
+
P443_PULSE_SUM="$(smoke_inner_summary "$TMP/p443-pulse.log" remind-pulse)" || P443_PULSE_SUM=""
|
|
25231
|
+
[ -n "$P443_PULSE_SUM" ] && ok "P443 两种 Pulse:长巡检入队、合并恢复与子进程回收全绿($P443_PULSE_SUM)" || bad "P443 Pulse 夹具绿了但缺结果行"
|
|
25232
|
+
assert_has "$TMP/p443-pulse.log" "停止后 watchdog.pid 不存在" "P443 停止清理释放巡检锁"
|
|
25233
|
+
assert_has "$TMP/p443-pulse.log" "停止前登记的循环子进程全部消失" "P443 停止清理回收循环自己的子进程"
|
|
25234
|
+
else
|
|
25235
|
+
bad "P443 Pulse 夹具红(rc=$P443_PULSE_RC)"; tail -16 "$TMP/p443-pulse.log" | sed 's/^/ /'
|
|
25236
|
+
fi
|
|
25237
|
+
fi
|
|
25238
|
+
P443_REAL="$SKILL_DIR/tests/remind-recovery-real.sh"
|
|
25239
|
+
if [ "$FAST" = "1" ]; then
|
|
25240
|
+
cond_skip "P443 真实 Pi 停止恢复" "FAST:私有真实 Pi/tmux + controlled model 另跑"
|
|
25241
|
+
elif [ ! -f "$P443_REAL" ]; then
|
|
25242
|
+
bad "P443 缺 tests/remind-recovery-real.sh"
|
|
25243
|
+
elif ! command -v "${P442_PI:-$HOME/.bun/bin/pi}" >/dev/null 2>&1; then
|
|
25244
|
+
cond_skip "P443 真实 Pi 停止恢复" "找不到真实 Pi(可设 P442_PI)"
|
|
25245
|
+
else
|
|
25246
|
+
bash "$P443_REAL" >"$TMP/p443-recovery-real.log" 2>&1; P443_REAL_RC=$?
|
|
25247
|
+
if [ "$P443_REAL_RC" -eq 0 ]; then
|
|
25248
|
+
assert_has "$TMP/p443-recovery-real.log" "remind-tool-real: passed=3 failed=0" "P443 真实 Pi:无通用提示恢复、忙碌不重复启动、切换/分叉立即撤下工具"
|
|
25249
|
+
else
|
|
25250
|
+
bad "P443 真实 Pi 恢复夹具红(rc=$P443_REAL_RC)"; tail -16 "$TMP/p443-recovery-real.log" | sed 's/^/ /'
|
|
25251
|
+
fi
|
|
25252
|
+
fi
|
|
25253
|
+
|
|
25254
|
+
# ---------------------------------------------------------------- 69. Reminder 受控对抗验收(P444)
|
|
25255
|
+
section "69 · 提醒:真实事件顺序 / 重放 / 进程死亡原子边界(P444)"
|
|
25256
|
+
P444_FAULTS="$SKILL_DIR/tests/remind-adversarial-faults.sh"
|
|
25257
|
+
if [ ! -f "$P444_FAULTS" ]; then
|
|
25258
|
+
bad "P444 缺 tests/remind-adversarial-faults.sh"
|
|
25259
|
+
else
|
|
25260
|
+
bash "$P444_FAULTS" >"$TMP/p444-faults.log" 2>&1; P444_FAULTS_RC=$?
|
|
25261
|
+
if [ "$P444_FAULTS_RC" -eq 0 ]; then
|
|
25262
|
+
assert_has "$TMP/p444-faults.log" "fault-matrix: passed=12 failed=0" "P444 intent/观察在 apply、rename、file/fsync 与目录 fsync 前后死亡均有恢复证据"
|
|
25263
|
+
assert_has "$TMP/p444-faults.log" "remind-adversarial-faults: isolation=ok" "P444 原子故障矩阵不碰主项目"
|
|
25264
|
+
else
|
|
25265
|
+
bad "P444 原子故障矩阵红(rc=$P444_FAULTS_RC)"; tail -18 "$TMP/p444-faults.log" | sed 's/^/ /'
|
|
25266
|
+
fi
|
|
25267
|
+
fi
|
|
25268
|
+
P444_REAL="$SKILL_DIR/tests/remind-adversarial-real.sh"
|
|
25269
|
+
if [ "$FAST" = "1" ]; then
|
|
25270
|
+
cond_skip "P444 真实 Pi 受控对抗" "FAST:真实事件、60 秒未知边界与进程死亡另跑(不记为通过)"
|
|
25271
|
+
elif [ ! -f "$P444_REAL" ]; then
|
|
25272
|
+
bad "P444 缺 tests/remind-adversarial-real.sh"
|
|
25273
|
+
else
|
|
25274
|
+
bash "$P444_REAL" >"$TMP/p444-real.log" 2>&1; P444_REAL_RC=$?
|
|
25275
|
+
if [ "$P444_REAL_RC" -eq 0 ]; then
|
|
25276
|
+
assert_has "$TMP/p444-real.log" "remind-tool-real: passed=7 failed=0" "P444 真实 Pi:A+B、G1/G2、外部会话、调用/事件死亡与迟到重放全绿"
|
|
25277
|
+
assert_has "$TMP/p444-real.log" "remind-adversarial-real: isolation=ok" "P444 真实 Pi 受控对抗不碰主项目"
|
|
25278
|
+
else
|
|
25279
|
+
bad "P444 真实 Pi 受控对抗红(rc=$P444_REAL_RC)"; tail -20 "$TMP/p444-real.log" | sed 's/^/ /'
|
|
25280
|
+
fi
|
|
25281
|
+
fi
|
|
25282
|
+
|
|
24827
25283
|
section "14d · P70 本套自述对账(段落账目 + 无误判)"
|
|
24828
25284
|
P70_S_STARTS="$(grep -c '^== #[0-9][0-9]* ' "$SG_LOG" 2>/dev/null || true)"
|
|
24829
25285
|
P70_S_SHAPED="$(grep -cE '^== #[0-9]+ .+ == [0-9]{4}-[0-9]{2}-[0-9]{2}T[^ ]+$' "$SG_LOG" 2>/dev/null || true)"
|