teamsmith 0.4.6 → 0.4.8
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 +35 -0
- package/skills/teamsmith/SKILL.md +43 -30
- 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/config.md +11 -12
- 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 +61 -35
- package/skills/teamsmith/scripts/lib/cmd-watch.sh +48 -11
- package/skills/teamsmith/scripts/lib/common.sh +83 -13
- package/skills/teamsmith/scripts/panel/README.md +35 -33
- package/skills/teamsmith/scripts/panel/panel.js +217 -199
- package/skills/teamsmith/scripts/panel/src/App.tsx +221 -66
- package/skills/teamsmith/scripts/panel/src/data.ts +71 -15
- package/skills/teamsmith/scripts/panel/src/layout.ts +159 -310
- package/skills/teamsmith/scripts/panel/src/main.tsx +83 -21
- package/skills/teamsmith/scripts/panel/src/project-settings.ts +46 -0
- package/skills/teamsmith/scripts/panel/src/strings/en.ts +71 -205
- package/skills/teamsmith/scripts/panel/src/strings/index.ts +3 -5
- package/skills/teamsmith/scripts/panel/src/strings/zh.ts +72 -204
- package/skills/teamsmith/scripts/panel/src/types.ts +23 -4
- 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/strings/commands.tsv +1 -1
- package/skills/teamsmith/scripts/team +1 -0
- package/skills/teamsmith/templates/AGENTS.section.md.tmpl +18 -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 +41 -25
- 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 +78 -12
- package/skills/teamsmith/tests/install-shape.sh +7 -7
- package/skills/teamsmith/tests/isolation-ledger.sh +6 -2
- package/skills/teamsmith/tests/key-replies-ui.sh +64 -5
- package/skills/teamsmith/tests/key-replies.sh +307 -106
- package/skills/teamsmith/tests/lib/main-team-fingerprint.sh +2 -0
- package/skills/teamsmith/tests/lib/model-routing-boundary.sh +255 -90
- package/skills/teamsmith/tests/lib/model-routing-expansion.sh +181 -61
- package/skills/teamsmith/tests/lib/model-routing-roles.sh +125 -67
- package/skills/teamsmith/tests/lib/reply-fixture.sh +14 -9
- package/skills/teamsmith/tests/lib/routes-pages.sh +243 -0
- package/skills/teamsmith/tests/lib/tmp-root.sh +1 -1
- package/skills/teamsmith/tests/loop-inventory.tsv +3 -0
- package/skills/teamsmith/tests/panel-b2.sh +91 -31
- package/skills/teamsmith/tests/panel-b3-stub.sh +9 -2
- package/skills/teamsmith/tests/panel-p21.sh +607 -1162
- package/skills/teamsmith/tests/panel-strings.mjs +21 -113
- package/skills/teamsmith/tests/remind-adversarial-faults.mjs +190 -0
- package/skills/teamsmith/tests/remind-adversarial-faults.sh +78 -0
- package/skills/teamsmith/tests/remind-adversarial-real.sh +28 -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 +801 -0
- package/skills/teamsmith/tests/remind-tool-real.sh +180 -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 +19 -17
- package/skills/teamsmith/tests/smoke.sh +583 -133
- package/skills/teamsmith/tests/state-authority.sh +152 -8
- package/skills/teamsmith/tests/task-model-routing.sh +57 -26
- package/skills/teamsmith/tests/tmp-hygiene.sh +1 -1
- package/skills/teamsmith-init/SKILL.md +5 -5
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/__pycache__/judge-second.cpython-313.pyc +0 -0
|
@@ -1820,6 +1820,98 @@ mkfile_meminfo lowswap 8000 300
|
|
|
1820
1820
|
mkfile_meminfo lowram 600 8000
|
|
1821
1821
|
mkfile_meminfo doomed 100 100
|
|
1822
1822
|
|
|
1823
|
+
P24_ROOT="$TMP/p24"
|
|
1824
|
+
P24_SHIM="$P24_ROOT/shim"
|
|
1825
|
+
P24_SHIM_LOG="$P24_ROOT/shim-calls.log"
|
|
1826
|
+
mkdir -p "$P24_SHIM"
|
|
1827
|
+
printf '#!/usr/bin/env bash\nprintf "%%s\\n" "$*" >> "%s"\nexit 0\n' "$P24_SHIM_LOG" > "$P24_SHIM/tmux"
|
|
1828
|
+
chmod +x "$P24_SHIM/tmux"
|
|
1829
|
+
|
|
1830
|
+
p24_project() { # <名字> [<agents>] → 打印项目路径(git + team init + openspec/specs + change alpha 目录)
|
|
1831
|
+
local name="$1" agents="${2:-dev verify dev2}" p
|
|
1832
|
+
p="$P24_ROOT/$name"
|
|
1833
|
+
rm -rf "$p"; mkdir -p "$p"
|
|
1834
|
+
( cd "$p" && git init -q -b main && git config user.email p24@smoke && git config user.name p24 \
|
|
1835
|
+
&& git commit -q --allow-empty -m "chore: init" ) >/dev/null 2>&1
|
|
1836
|
+
( cd "$p" && $TEAM init --session "p24-$name" --agents "$agents" --vcs local --gates "true" --docs docs/team "${P235_MODELS[@]}" ) >"$p/.init.log" 2>&1
|
|
1837
|
+
printf 'TEAM_PI_BIN="/bin/true"\n' >> "$p/.pi/team/config.sh"
|
|
1838
|
+
mkdir -p "$p/openspec/specs/panel" "$p/openspec/specs/dispatch"
|
|
1839
|
+
printf '### Requirement: The board page is a kanban over the board\x27s states\n' > "$p/openspec/specs/panel/spec.md"
|
|
1840
|
+
printf '### Requirement: A brief is self-contained and names its evidence\n' > "$p/openspec/specs/dispatch/spec.md"
|
|
1841
|
+
p24_change "$p" alpha
|
|
1842
|
+
printf '%s\n' "$p"
|
|
1843
|
+
}
|
|
1844
|
+
p24_change() { # <项目> <change id> → 建一个带 panel delta 的 change 目录
|
|
1845
|
+
local p="$1" c="$2"
|
|
1846
|
+
mkdir -p "$p/openspec/changes/$c/specs/panel"
|
|
1847
|
+
printf '## MODIFIED Requirements\n\n### Requirement: %s delta fixture\n' "$c" > "$p/openspec/changes/$c/specs/panel/spec.md"
|
|
1848
|
+
}
|
|
1849
|
+
p24_brief() { # <项目> <ID> <agent> <phase> <change> <deltas|@absent> [<anchor>] [<specs>]
|
|
1850
|
+
local p="$1" id="$2" agent="$3" phase="$4" change="$5" deltas="$6" anchor="${7:-}" specs="${8:--}"
|
|
1851
|
+
mkdir -p "$p/docs/team/tasks"
|
|
1852
|
+
{
|
|
1853
|
+
printf '# %s · fixture\n\n```\n' "$id"
|
|
1854
|
+
# P242/A2:唯一 category: 头是新合同的合法输入(本节测锚/delta/独立性,类别不是被测对象)。
|
|
1855
|
+
printf 'task: %s\nagent: %s\nissue: -\ncategory: routine\n' "$id" "$agent"
|
|
1856
|
+
printf 'change: %s\nspecs: %s\nphase: %s\ndeps: -\nstatus: todo\nbudget: -\n' "$change" "$specs" "$phase"
|
|
1857
|
+
[ -n "$anchor" ] && printf 'anchor: %s\n' "$anchor"
|
|
1858
|
+
[ "$deltas" = "@absent" ] || printf 'deltas: %s\n' "$deltas"
|
|
1859
|
+
printf '```\n\nbody\n'
|
|
1860
|
+
} > "$p/docs/team/tasks/$id-fixture.md"
|
|
1861
|
+
return 0
|
|
1862
|
+
}
|
|
1863
|
+
p24_add() { # <项目> <ID> [<agent>]
|
|
1864
|
+
local p="$1" id="$2" agent="${3:-dev}"
|
|
1865
|
+
( cd "$p" && $TEAM board add "$id" "$id fixture" "$agent" - - ) >/dev/null 2>&1
|
|
1866
|
+
return 0
|
|
1867
|
+
}
|
|
1868
|
+
p24_team() { # <项目> <args...> → team CLI(stdout+stderr 合并)
|
|
1869
|
+
local p="$1"; shift
|
|
1870
|
+
( cd "$p" && $TEAM "$@" ) 2>&1
|
|
1871
|
+
}
|
|
1872
|
+
p24_dispatch() { # <项目> <agent> <ID> <brief> [args...] → 记录式 shim 下的 dispatch(stdout+stderr)
|
|
1873
|
+
local p="$1" agent="$2" id="$3" brief="$4"; shift 4
|
|
1874
|
+
: > "$P24_SHIM_LOG"
|
|
1875
|
+
( cd "$p" && env PATH="$P24_SHIM:$PATH" TEAM_DISPATCH_VERIFY_SEC=1 TEAM_DISPATCH_ALIVE_SEC=0 \
|
|
1876
|
+
$TEAM dispatch "$agent" "$id" "$brief" "$@" ) 2>&1
|
|
1877
|
+
}
|
|
1878
|
+
p24_shim_windows() { grep -cE 'new-window|new-session|respawn-pane' "$P24_SHIM_LOG" 2>/dev/null || true; }
|
|
1879
|
+
p24_branch() { # <项目> <agent> <ID> → 规范任务分支(canon_branch 绑死在 $REPO,这里自己算)
|
|
1880
|
+
( cd "$1" && env -u TEAM_ROOT -u TEAM_MAIN_ROOT -u TEAM_SKILL_DIR \
|
|
1881
|
+
bash -c '. "'"$SKILL_DIR"'/scripts/lib/common.sh"; for _f in "'"$SKILL_DIR"'"/scripts/lib/cmd-*.sh; do . "$_f" 2>/dev/null || true; done; team_load_config >/dev/null 2>&1; team_branch_for_agent "'"$2"'" "'"$3"'"' )
|
|
1882
|
+
}
|
|
1883
|
+
p24_wt() { # <项目> <agent> <ID> → 把该 agent 的 worktree 停在 <ID> 的规范分支上(可重复调用)
|
|
1884
|
+
local p="$1" a="$2" id="$3" br
|
|
1885
|
+
git -C "$p" worktree remove --force "$p/.worktrees/$a" >/dev/null 2>&1 || true
|
|
1886
|
+
git -C "$p" worktree prune >/dev/null 2>&1 || true
|
|
1887
|
+
br="$(p24_branch "$p" "$a" "$id")"
|
|
1888
|
+
[ -n "$br" ] || return 1
|
|
1889
|
+
git -C "$p" branch -D "$br" >/dev/null 2>&1 || true
|
|
1890
|
+
git -C "$p" worktree add -b "$br" "$p/.worktrees/$a" main >/dev/null 2>&1 || return 1
|
|
1891
|
+
rm -f "$p/.pi/team/state/$a.env"
|
|
1892
|
+
return 0
|
|
1893
|
+
}
|
|
1894
|
+
p24_pass() { # <项目> <id> → review 记录 PASS
|
|
1895
|
+
local p="$1" id="$2"
|
|
1896
|
+
mkdir -p "$p/docs/team/reviews"
|
|
1897
|
+
printf -- '- 2026-09-20T00:00:00Z · `team review %s` · 判定: **PASS**\n' "$id" > "$p/docs/team/reviews/$id.md"
|
|
1898
|
+
}
|
|
1899
|
+
p24_board_row() { p24_team "$1" board row "$2" 2>/dev/null | tail -1; }
|
|
1900
|
+
p24_unchanged() { # <项目> <ID> <原行> <说明>
|
|
1901
|
+
assert_eq "$4:看的板行没被改动" "$(p24_board_row "$1" "$2")" "$3"
|
|
1902
|
+
}
|
|
1903
|
+
p24_json_ok() { # <文本> → 0=是合法 JSON(没有解析器时退化成形状检查)
|
|
1904
|
+
local t="$1"
|
|
1905
|
+
if command -v python3 >/dev/null 2>&1; then printf '%s' "$t" | python3 -c 'import json,sys; json.load(sys.stdin)' >/dev/null 2>&1; return $?; fi
|
|
1906
|
+
if [ -n "$JS_RUNNER" ]; then printf '%s' "$t" | "$JS_RUNNER" -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>JSON.parse(s))' >/dev/null 2>&1; return $?; fi
|
|
1907
|
+
case "$t" in '{"id":'*'}') return 0 ;; esac
|
|
1908
|
+
return 1
|
|
1909
|
+
}
|
|
1910
|
+
p24_read() { # <项目> <函数名> <brief> → 在项目上下文里直接驱动读取器(stdout+stderr 原样)
|
|
1911
|
+
( cd "$1" && env -u TEAM_ROOT -u TEAM_MAIN_ROOT -u TEAM_SKILL_DIR \
|
|
1912
|
+
bash -c '. "'"$SKILL_DIR"'/scripts/lib/common.sh"; for _f in "'"$SKILL_DIR"'"/scripts/lib/cmd-*.sh; do . "$_f" 2>/dev/null || true; done; team_load_config >/dev/null 2>&1; "$@"' _ "$2" "$3" ) 2>&1
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1823
1915
|
# ---------------------------------------------------------------- 0. 仓库
|
|
1824
1916
|
# P70:从第 0 段起每段自述 + 硬预算(看门狗双重 fork,不在作业表里;trip 现场在 $TMP 之外)。
|
|
1825
1917
|
SG_LOCK_NOTE="${SMOKE_LOCK:-}"
|
|
@@ -4556,7 +4648,8 @@ PM_SUPPORT="${PM_SUPPORT% }"
|
|
|
4556
4648
|
# M27 起默认参数多了 `-e <skill>/extension/team-bg.ts`(PM 的后台门禁)、M30 起再多了
|
|
4557
4649
|
# `-e <skill>/extension/team-inbox-watch.ts`(PM 的投递换道):参考值同步加这两项,
|
|
4558
4650
|
# 它仍是**字面写死**的,不调实现。
|
|
4559
|
-
# P396 起默认参数再多了 `-e <skill>/extension/team-reply.ts
|
|
4651
|
+
# P396 起默认参数再多了 `-e <skill>/extension/team-reply.ts`(定向关键回复采集);
|
|
4652
|
+
# P442 起再多 `-e <skill>/extension/team-remind.ts`(PM 自我提醒):参考值同步补这两项。
|
|
4560
4653
|
# M36 起整条命令再带一个**闸门前缀**(tmux 运行时闸门:PATH 最前 = scripts/shim、state/tmux-calls.log、
|
|
4561
4654
|
# 真 tmux 路径三段 export)——前缀同样字面写死;前缀以外的历史部分保持逐字节一致。
|
|
4562
4655
|
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 +4661,17 @@ M36_REF_PREFIX="${M36_REF_PREFIX}export TEAM_SIGNAL_CALLS_LOG=$(printf '%q' "$RE
|
|
|
4568
4661
|
# M40 起再带一段**身份环境前缀**(继承的 TEAM_* 身份先清掉,只写本命令现场推导出的身份):
|
|
4569
4662
|
# 前缀同样字面写死(值只取夹具已知量),前缀以外的历史部分保持逐字节一致。
|
|
4570
4663
|
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"); "
|
|
4664
|
+
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
4665
|
# P396 起命令里再固定本次解析出的 state/config/window 三段(进程局部,不新增配置键、不写 tmux global):
|
|
4573
4666
|
# 同样字面写死,前缀以外的历史部分保持逐字节一致。
|
|
4574
4667
|
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")"
|
|
4668
|
+
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
4669
|
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"
|
|
4670
|
+
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
4671
|
assert_has_echo "$DEFAULT_CMD" "extension/team-bg.ts" "M27:PM 默认命令加载 team-bg(后台门禁)"
|
|
4579
4672
|
assert_has_echo "$DEFAULT_CMD" "extension/team-inbox-watch.ts" "M30:PM 默认命令加载 inbox-watch(投递换道)"
|
|
4580
4673
|
assert_has_echo "$DEFAULT_CMD" "extension/team-reply.ts" "P396:PM 默认命令加载定向关键回复扩展"
|
|
4674
|
+
assert_has_echo "$DEFAULT_CMD" "extension/team-remind.ts" "P442:PM 默认命令加载自我提醒扩展"
|
|
4581
4675
|
assert_has_echo "$DEFAULT_CMD" " -c @$PM_PF" "默认仍是 pi -c + @prompt-file(历史行为)"
|
|
4582
4676
|
# 显式配了续跑键就在内置 Pi 路径生效(同一套键也服务于自定义 CLI)
|
|
4583
4677
|
SID_CMD="$(pm_render "$PM_PF" "$PM_SPAWN" "TEAM_PI_BIN=$FAKE/pi" 'TEAM_PM_SESSION_ID=pm-fixed')"
|
|
@@ -5872,6 +5966,8 @@ section "9 · agent 提交 + 报告"
|
|
|
5872
5966
|
'- 破坏实验:把实现改坏 → 守门测试退出码 1(red)' \
|
|
5873
5967
|
'- 恢复实现:守门测试退出码 0,全部通过(green)' \
|
|
5874
5968
|
'- 独立验证包(不复用被测夹具):docs/team/reports/T1.1/verify.sh' \
|
|
5969
|
+
"- 主工作树:$REPO" \
|
|
5970
|
+
"- 当前家目录:$HOME" \
|
|
5875
5971
|
'```' \
|
|
5876
5972
|
'$ bash docs/team/reports/T1.1/verify.sh' \
|
|
5877
5973
|
'```' \
|
|
@@ -5887,7 +5983,145 @@ assert_eq "分支有 1 个提交" "$(git -C "$REPO/.worktrees/dev" rev-list --co
|
|
|
5887
5983
|
section "10 · review(独立 worktree + 门禁)"
|
|
5888
5984
|
REV_WT="$TMP/review-checkout"
|
|
5889
5985
|
git -C "$REPO" worktree add --detach "$REV_WT" "$T1_BRANCH" >/dev/null 2>&1 || true
|
|
5890
|
-
|
|
5986
|
+
# PM 只准备两个 checkout;真正调用 review 的是与实现作者 dev 不同的 verify 席位。
|
|
5987
|
+
git -C "$REPO" worktree add --detach "$REPO/.worktrees/verify" "$PROTECTED" >/dev/null 2>&1 || true
|
|
5988
|
+
review_record_has_verifier() { # 真实命令产生的记录必须绑定 verify + 当前 HEAD + 指定 record/log
|
|
5989
|
+
local rec="$REPO/docs/team/reviews/T1.1.md" log="$REPO/docs/team/reviews/T1.1-verify.log" want
|
|
5990
|
+
want="$(git -C "$REV_WT" rev-parse HEAD 2>/dev/null)"
|
|
5991
|
+
[ -f "$rec" ] || { printf 'missing record\n'; return 1; }
|
|
5992
|
+
[ -f "$log" ] || { printf 'missing companion log\n'; return 1; }
|
|
5993
|
+
grep -q '^# T1.1 · 独立复验$' "$rec" || { printf 'title is not neutral independent review\n'; return 1; }
|
|
5994
|
+
grep -q '实际执行者:`verify`' "$rec" || { printf 'actual executor is not verify\n'; return 1; }
|
|
5995
|
+
grep -q "HEAD: \`${want:0:9}\`" "$rec" || { printf 'reviewed HEAD mismatch\n'; return 1; }
|
|
5996
|
+
! grep -q 'PM 独立复验' "$rec" || { printf 'hard-coded PM attribution\n'; return 1; }
|
|
5997
|
+
}
|
|
5998
|
+
P440_GATE="$TMP/p440-review-gate.sh"
|
|
5999
|
+
printf '#!/usr/bin/env bash\nprintf '\''gate main=%%s home=%%s\\n'\'' '%s' "$HOME"\n' "$REPO" > "$P440_GATE"
|
|
6000
|
+
review_record_ledger_clean() { # P440:所有动态片段都不能把 main/home 绝对路径写进公开 Markdown
|
|
6001
|
+
local rec="$REPO/docs/team/reviews/T1.1.md" checkout_display="$REV_WT" gate_display="$P440_GATE"
|
|
6002
|
+
case "$REV_WT" in
|
|
6003
|
+
"$REPO"/*) checkout_display="<main-root>/${REV_WT#"$REPO"/}" ;;
|
|
6004
|
+
"$HOME"/*) checkout_display="<home>/${REV_WT#"$HOME"/}" ;;
|
|
6005
|
+
esac
|
|
6006
|
+
case "$P440_GATE" in
|
|
6007
|
+
"$REPO"/*) gate_display="<main-root>/${P440_GATE#"$REPO"/}" ;;
|
|
6008
|
+
"$HOME"/*) gate_display="<home>/${P440_GATE#"$HOME"/}" ;;
|
|
6009
|
+
esac
|
|
6010
|
+
[ -f "$rec" ] || { printf 'missing record\n'; return 1; }
|
|
6011
|
+
! grep -qF "$REPO" "$rec" || { printf 'absolute main root remains\n'; return 1; }
|
|
6012
|
+
if [ "${HOME:-}" != "/" ]; then
|
|
6013
|
+
! grep -qF "$HOME" "$rec" || { printf 'absolute home remains\n'; return 1; }
|
|
6014
|
+
fi
|
|
6015
|
+
grep -qF "独立 checkout:\`$checkout_display\`" "$rec" || { printf 'independent checkout display mismatch\n'; return 1; }
|
|
6016
|
+
grep -qF 'agent 报告:`<main-root>/.worktrees/dev/docs/team/reports/T1.1-dev.md`' "$rec" \
|
|
6017
|
+
|| { printf 'agent report is not project-relative display text\n'; return 1; }
|
|
6018
|
+
grep -qF '门禁锁:`<main-root>/.pi/team/state/p440-review.lock`' "$rec" \
|
|
6019
|
+
|| { printf 'lock path was not sanitised\n'; return 1; }
|
|
6020
|
+
grep -qF '主工作树:<main-root>' "$rec" || { printf 'report excerpt main path remains\n'; return 1; }
|
|
6021
|
+
grep -qF '当前家目录:<home>' "$rec" || { printf 'report excerpt home path remains\n'; return 1; }
|
|
6022
|
+
grep -qF 'gate main=<main-root> home=<home>' "$rec" || { printf 'gate output was not sanitised\n'; return 1; }
|
|
6023
|
+
grep -qF "门禁命令:\`bash $gate_display\`" "$rec" || { printf 'real gate command missing\n'; return 1; }
|
|
6024
|
+
grep -qF '判定: **PASS**' "$rec" || { printf 'real gate result missing\n'; return 1; }
|
|
6025
|
+
}
|
|
6026
|
+
touch "$TMP/review-write-set-start"
|
|
6027
|
+
( cd "$REPO/.worktrees/verify" && TEAM_GATES="bash $P440_GATE" \
|
|
6028
|
+
TEAM_SMOKE_LOCK="$REPO/.pi/team/state/p440-review.lock" $TEAM review T1.1 --dir "$REV_WT" ) >"$TMP/review.log" 2>&1 \
|
|
6029
|
+
&& ok "review 门禁 PASS 退出码 0(verify 席位实际执行)" || { bad "review 失败"; cat "$TMP/review.log"; }
|
|
6030
|
+
review_record_has_verifier >"$TMP/review-identity-green.log" 2>&1 \
|
|
6031
|
+
&& ok "真实 verifier 记录:neutral 标题 + verify 身份 + reviewed SHA + 指定 record/log" \
|
|
6032
|
+
|| { bad "真实 verifier 记录不完整"; cat "$TMP/review-identity-green.log"; }
|
|
6033
|
+
review_record_ledger_clean >"$TMP/p440-review-green.log" 2>&1 \
|
|
6034
|
+
&& ok "P440 review 绿:执行者/SHA/真实命令/结果保留,模板+锁+摘录+门禁尾部均无 main/home 绝对路径" \
|
|
6035
|
+
|| { bad "P440 review 绿失败"; cat "$TMP/p440-review-green.log"; }
|
|
6036
|
+
|
|
6037
|
+
# V146/W1:与 main root 共享字符串前缀的兄弟 checkout 不是 main root 的子路径,显示必须逐字保留。
|
|
6038
|
+
P440_SIBLING="$REPO-ledger/checkout"
|
|
6039
|
+
git -C "$REPO" worktree add --detach "$P440_SIBLING" "$T1_BRANCH" >/dev/null 2>&1
|
|
6040
|
+
P440_SIBLING_RC=0
|
|
6041
|
+
( cd "$REPO/.worktrees/verify" && TEAM_GATES=true \
|
|
6042
|
+
TEAM_SMOKE_LOCK="$REPO/.pi/team/state/p440-review.lock" $TEAM review T1.1 --dir "$P440_SIBLING" ) >"$TMP/p440-review-sibling.log" 2>&1 \
|
|
6043
|
+
|| P440_SIBLING_RC=$?
|
|
6044
|
+
assert_eq "P440 兄弟前缀 checkout 的真实 review rc=0" "$P440_SIBLING_RC" "0"
|
|
6045
|
+
assert_has "$REPO/docs/team/reviews/T1.1.md" '判定: **PASS**' "P440 兄弟前缀 checkout 的记录是 PASS"
|
|
6046
|
+
P440_SIBLING_DISPLAY="$P440_SIBLING"
|
|
6047
|
+
case "$P440_SIBLING" in
|
|
6048
|
+
"$HOME"/*) P440_SIBLING_DISPLAY="<home>/${P440_SIBLING#"$HOME"/}" ;;
|
|
6049
|
+
esac
|
|
6050
|
+
assert_has "$REPO/docs/team/reviews/T1.1.md" "独立 checkout:\`$P440_SIBLING_DISPLAY\`" "P440 兄弟前缀路径逐字保留,不改成不存在的占位拼接"
|
|
6051
|
+
assert_not "$REPO/docs/team/reviews/T1.1.md" '<main-root>-ledger' "P440 不再把 main-root 的兄弟前缀吞成占位"
|
|
6052
|
+
git -C "$REPO" worktree remove --force "$P440_SIBLING" >/dev/null 2>&1
|
|
6053
|
+
|
|
6054
|
+
# V146/W2:HOME 下的独立 checkout 显示为 <home>/…,不要求夹具必须放在 /var/tmp。
|
|
6055
|
+
P440_HOME="$TMP/p440-home"; mkdir -p "$P440_HOME"
|
|
6056
|
+
P440_HOME_WT="$P440_HOME/checkout"
|
|
6057
|
+
git -C "$REPO" worktree add --detach "$P440_HOME_WT" "$T1_BRANCH" >/dev/null 2>&1
|
|
6058
|
+
P440_HOME_RC=0
|
|
6059
|
+
( cd "$REPO/.worktrees/verify" && HOME="$P440_HOME" TEAM_GATES=true \
|
|
6060
|
+
TEAM_SMOKE_LOCK="$P440_HOME/review.lock" $TEAM review T1.1 --dir "$P440_HOME_WT" ) >"$TMP/p440-review-home-checkout.log" 2>&1 \
|
|
6061
|
+
|| P440_HOME_RC=$?
|
|
6062
|
+
assert_eq "P440 HOME 下 checkout 的真实 review rc=0" "$P440_HOME_RC" "0"
|
|
6063
|
+
assert_has "$REPO/docs/team/reviews/T1.1.md" '判定: **PASS**' "P440 HOME 下 checkout 的记录是 PASS"
|
|
6064
|
+
assert_has "$REPO/docs/team/reviews/T1.1.md" '独立 checkout:`<home>/checkout`' "P440 HOME 下 checkout 按显示规则写成 <home>/…"
|
|
6065
|
+
git -C "$REPO" worktree remove --force "$P440_HOME_WT" >/dev/null 2>&1
|
|
6066
|
+
|
|
6067
|
+
# V147:边界不是分隔符白名单。C 与 UTF-8 locale 输出必须逐字一致;中文冒号、引号和
|
|
6068
|
+
# ;!?,。):都结束裸 root,而 ASCII 的 -_. 兄弟后缀仍然原样保留。
|
|
6069
|
+
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'
|
|
6070
|
+
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'
|
|
6071
|
+
# P459:同一矩阵覆盖 CI 的 HOME=/tmp;更长路径中间的 /tmp 不属于 HOME。
|
|
6072
|
+
P440_MATRIX_INPUT+=$'\nCI 路径:/var/tmp/teamsmith-ci-tmp/review-wt /srv/tmp/checkout /var/tmp /srv/tmp'
|
|
6073
|
+
P440_MATRIX_EXPECTED+=$'\nCI 路径:/var/tmp/teamsmith-ci-tmp/review-wt /srv/tmp/checkout /var/tmp /srv/tmp'
|
|
6074
|
+
for P440_HOME_ROOT in /srv/u /tmp; do
|
|
6075
|
+
for P440_LOCALE in C C.UTF-8; do
|
|
6076
|
+
P440_MATRIX_OUT="$(printf '%s\n' "${P440_MATRIX_INPUT//\/srv\/u/$P440_HOME_ROOT}" | LC_ALL="$P440_LOCALE" TEAM_MAIN_ROOT=/a/b/pm-skills HOME="$P440_HOME_ROOT" \
|
|
6077
|
+
bash -c '. "$1"; team_review_ledger_display' _ "$SKILL_DIR/scripts/lib/cmd-review.sh")"
|
|
6078
|
+
assert_eq "P440 C/UTF-8 标点矩阵($P440_LOCALE HOME=$P440_HOME_ROOT):净化一致且兄弟前缀保留" "$P440_MATRIX_OUT" "$P440_MATRIX_EXPECTED"
|
|
6079
|
+
done
|
|
6080
|
+
done
|
|
6081
|
+
|
|
6082
|
+
# P440 红侧:只在私有 skill 副本恢复旧的直接写盘,真实 review 必须重新带出绝对路径;随后同副本还原转绿。
|
|
6083
|
+
P440_REVIEW_MUT="$TMP/p440-review-absolute-paths"; rm -rf "$P440_REVIEW_MUT"; cp -a "$SKILL_DIR" "$P440_REVIEW_MUT"
|
|
6084
|
+
python3 - "$P440_REVIEW_MUT/scripts/lib/cmd-review.sh" <<'PY'
|
|
6085
|
+
import sys
|
|
6086
|
+
p = sys.argv[1]
|
|
6087
|
+
s = open(p, encoding='utf-8').read()
|
|
6088
|
+
old = ' } | team_review_ledger_display > "$report"'
|
|
6089
|
+
assert s.count(old) == 1, 'P440 review write pipeline not found exactly once'
|
|
6090
|
+
open(p, 'w', encoding='utf-8').write(s.replace(old, ' } > "$report"', 1))
|
|
6091
|
+
PY
|
|
6092
|
+
rm -f "$REPO/docs/team/reviews/T1.1.md" "$REPO/docs/team/reviews/T1.1-verify.log"
|
|
6093
|
+
P440_RED_REVIEW_RC=0
|
|
6094
|
+
( cd "$REPO/.worktrees/verify" && TEAM_GATES="bash $P440_GATE" \
|
|
6095
|
+
TEAM_SMOKE_LOCK="$REPO/.pi/team/state/p440-review.lock" \
|
|
6096
|
+
bash "$P440_REVIEW_MUT/scripts/team" review T1.1 --dir "$REV_WT" ) >"$TMP/p440-review-mutant.log" 2>&1 \
|
|
6097
|
+
|| P440_RED_REVIEW_RC=$?
|
|
6098
|
+
P440_RED_REC="$REPO/docs/team/reviews/T1.1.md"
|
|
6099
|
+
assert_eq "P440 红侧前提:变异体真实 review rc=0" "$P440_RED_REVIEW_RC" "0"
|
|
6100
|
+
assert_file "$P440_RED_REC" "P440 红侧前提:记录真的生成"
|
|
6101
|
+
assert_has "$P440_RED_REC" '判定: **PASS**' "P440 红侧前提:变异门禁结果仍是 PASS"
|
|
6102
|
+
if [ "$P440_RED_REVIEW_RC" -ne 0 ] || [ ! -f "$P440_RED_REC" ] || ! grep -qF '判定: **PASS**' "$P440_RED_REC"; then
|
|
6103
|
+
bad "P440 review 红侧前提不成立:不能用缺失记录或失败 review 充当路径翻转"
|
|
6104
|
+
elif ! grep -qF "$REPO" "$P440_RED_REC"; then
|
|
6105
|
+
bad "P440 review 红侧失效:变异记录里没有绝对 main root"
|
|
6106
|
+
elif ! grep -qF "$HOME" "$P440_RED_REC"; then
|
|
6107
|
+
bad "P440 review 红侧失效:变异记录里没有绝对 HOME"
|
|
6108
|
+
elif review_record_ledger_clean >"$TMP/p440-review-red.log" 2>&1; then
|
|
6109
|
+
bad "P440 review 红侧失效:恢复绝对路径写盘仍通过账本路径断言"
|
|
6110
|
+
elif [ "$(tr -d '\r' < "$TMP/p440-review-red.log")" != 'absolute main root remains' ]; then
|
|
6111
|
+
bad "P440 review 红侧失败原因不是绝对路径:$(tr '\n' ' ' < "$TMP/p440-review-red.log")"
|
|
6112
|
+
else
|
|
6113
|
+
ok "P440 review 红:rc=0/PASS/记录存在后,仅因绝对 main/home 路径判红"
|
|
6114
|
+
fi
|
|
6115
|
+
cp "$SKILL_DIR/scripts/lib/cmd-review.sh" "$P440_REVIEW_MUT/scripts/lib/cmd-review.sh"
|
|
6116
|
+
rm -f "$REPO/docs/team/reviews/T1.1.md" "$REPO/docs/team/reviews/T1.1-verify.log"
|
|
6117
|
+
( cd "$REPO/.worktrees/verify" && TEAM_GATES="bash $P440_GATE" \
|
|
6118
|
+
TEAM_SMOKE_LOCK="$REPO/.pi/team/state/p440-review.lock" \
|
|
6119
|
+
bash "$P440_REVIEW_MUT/scripts/team" review T1.1 --dir "$REV_WT" ) >"$TMP/p440-review-restored.log" 2>&1
|
|
6120
|
+
review_record_ledger_clean >"$TMP/p440-review-restore-green.log" 2>&1 \
|
|
6121
|
+
&& ok "P440 review 还原绿:同一私有副本恢复显示净化后断言通过" \
|
|
6122
|
+
|| { bad "P440 review 还原后仍红"; cat "$TMP/p440-review-restore-green.log"; }
|
|
6123
|
+
REVIEW_DOCS_WRITES="$(cd "$REPO" && find docs/team -type f -newer "$TMP/review-write-set-start" -printf '%P\n' | LC_ALL=C sort)"
|
|
6124
|
+
assert_eq "review 在主检出的文档写集只有指定 record/log" "$REVIEW_DOCS_WRITES" $'reviews/T1.1-verify.log\nreviews/T1.1.md'
|
|
5891
6125
|
if $TEAM review T1.1 >"$TMP/review-nodir.log" 2>&1; then bad "review 缺 --dir 应报错"; else ok "review 缺 --dir 明确报错(skill 不碰 git)"; fi
|
|
5892
6126
|
assert_has "$TMP/review-nodir.log" "PM 自己准备独立 checkout" "报错里给出 git 命令"
|
|
5893
6127
|
assert_file "$REPO/docs/team/reviews/T1.1.md" "写复验记录"
|
|
@@ -6081,7 +6315,14 @@ assert_has "$REPO/docs/team/reviews/T1.1.md" "Flip evidence" "F14 记录给出
|
|
|
6081
6315
|
assert_has "$REPO/docs/team/reviews/T1.1.md" "checkout 里没有这个路径" "F14 老实记下包路径未随分支提交(提示项,不阻塞)"
|
|
6082
6316
|
|
|
6083
6317
|
# F14b(PM 退回的复现):报告措辞直接取自我们自己的模板 —— 检查器不能只认自己的正则,
|
|
6084
|
-
# 否则「检查器 ↔
|
|
6318
|
+
# 否则「检查器 ↔ 模板」会漂移(模板改写后真报告又被判“缺证据”)。同一既有证据例也钉住 OpenSpec 固定分节。
|
|
6319
|
+
for P439_SECTION in CRITICAL WARNING SUGGESTION 'Final assessment'; do
|
|
6320
|
+
assert_has "$SKILL_DIR/templates/report.md.tmpl" "## $P439_SECTION" "F14b 报告模板含固定 OpenSpec 分节:$P439_SECTION"
|
|
6321
|
+
done
|
|
6322
|
+
assert_has "$SKILL_DIR/templates/report.md.tmpl" "Completeness" "F14b 报告模板含 Completeness 评分维度"
|
|
6323
|
+
assert_has "$SKILL_DIR/templates/report.md.tmpl" "Correctness" "F14b 报告模板含 Correctness 评分维度"
|
|
6324
|
+
assert_has "$SKILL_DIR/templates/report.md.tmpl" "Coherence" "F14b 报告模板含 Coherence 评分维度"
|
|
6325
|
+
assert_has "$SKILL_DIR/templates/report.md.tmpl" "Unverified applicable checks and reasons" "F14b 报告模板要求列出未验证检查与理由"
|
|
6085
6326
|
TMPL_FLIP_HEAD="$(grep -m1 -E '^#{2,3}[[:space:]].*[Ff]lip' "$SKILL_DIR/templates/report.md.tmpl" | sed 's/[[:space:]]*$//')"
|
|
6086
6327
|
[ -n "$TMPL_FLIP_HEAD" ] || TMPL_FLIP_HEAD='## Flip evidence'
|
|
6087
6328
|
{ printf '# T1.1 · template shaped report\n\n'
|
|
@@ -6140,9 +6381,27 @@ assert_match "$TMP/status-f3.log" 'stale: verified [0-9a-f]+, branch now [0-9a-f
|
|
|
6140
6381
|
assert_eq "F3 分支已被合并删除(解析不到)→ 不算过期(否则合并后任务永远待办)" \
|
|
6141
6382
|
"$(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
6383
|
|
|
6143
|
-
# 10b
|
|
6384
|
+
# 10b 收尾:真实 verify 运行 + 恢复硬编码 PM 署名的红/绿/还原。变异只在自己的 skill 副本里。
|
|
6144
6385
|
rev_refresh; rec_reset
|
|
6145
|
-
$TEAM review T1.1 --dir "$REV_WT"
|
|
6386
|
+
( cd "$REPO/.worktrees/verify" && $TEAM review T1.1 --dir "$REV_WT" ) >"$TMP/p439-review-restored-baseline.log" 2>&1
|
|
6387
|
+
review_record_has_verifier >"$TMP/p439-review-green.log" 2>&1 \
|
|
6388
|
+
&& ok "10b verifier 证据绿:真实 verify + reviewed SHA + 指定 record/log" \
|
|
6389
|
+
|| { bad "10b verifier 证据绿失败"; cat "$TMP/p439-review-green.log"; }
|
|
6390
|
+
P439_MUT="$TMP/p439-review-pm-attribution"; rm -rf "$P439_MUT"; cp -a "$SKILL_DIR" "$P439_MUT"
|
|
6391
|
+
sed -i 's/# %s · 独立复验/# %s · PM 独立复验/' "$P439_MUT/scripts/lib/cmd-review.sh"
|
|
6392
|
+
rec_reset
|
|
6393
|
+
( cd "$REPO/.worktrees/verify" && bash "$P439_MUT/scripts/team" review T1.1 --dir "$REV_WT" ) >"$TMP/p439-review-pm-mutant.log" 2>&1
|
|
6394
|
+
if review_record_has_verifier >"$TMP/p439-review-red.log" 2>&1; then
|
|
6395
|
+
bad "10b 红侧失效:恢复 PM 独立复验署名仍通过执行者证据断言"
|
|
6396
|
+
else
|
|
6397
|
+
ok "10b 红侧:恢复 PM 独立复验署名 → 执行者证据断言红($(tr '\n' ' ' < "$TMP/p439-review-red.log"))"
|
|
6398
|
+
fi
|
|
6399
|
+
cp "$SKILL_DIR/scripts/lib/cmd-review.sh" "$P439_MUT/scripts/lib/cmd-review.sh"
|
|
6400
|
+
rec_reset
|
|
6401
|
+
( cd "$REPO/.worktrees/verify" && bash "$P439_MUT/scripts/team" review T1.1 --dir "$REV_WT" ) >"$TMP/p439-review-restored.log" 2>&1
|
|
6402
|
+
review_record_has_verifier >"$TMP/p439-review-restore-green.log" 2>&1 \
|
|
6403
|
+
&& ok "10b 还原绿:恢复真实执行者署名后同一断言通过" \
|
|
6404
|
+
|| { bad "10b 还原后执行者证据仍红"; cat "$TMP/p439-review-restore-green.log"; }
|
|
6146
6405
|
assert_has "$REPO/docs/team/reviews/T1.1.md" "判定: **PASS**" "10b 收尾:恢复干净 checkout 上的 PASS 记录"
|
|
6147
6406
|
$TEAM digest >"$TMP/digest-10b-end.log" 2>&1 || true
|
|
6148
6407
|
assert_not "$TMP/digest-10b-end.log" "T1.1-dev" "10b 收尾:记录有效后不再列为待复验"
|
|
@@ -11033,6 +11292,83 @@ rm -f "$M71R/AGENTS.md"
|
|
|
11033
11292
|
cmp -s "$TMP/m71-block.md" "$M71R/AGENTS.md" \
|
|
11034
11293
|
&& ok "文件缺失:建出来的就是那一块渲染段" || bad "文件缺失:建出来的不是渲染段"
|
|
11035
11294
|
|
|
11295
|
+
# ②f P440/P456:PROTOCOL 与 AGENTS 的三种安装形状都使用可移植且不虚构的命令路径。
|
|
11296
|
+
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 ); }
|
|
11297
|
+
p440_protocol_paths_ok() { # <repo> <skills/teamsmith|.pi/skills/teamsmith|<skill-dir>>
|
|
11298
|
+
local repo="$1" expected="$2" f ref command_line wt="$1/.worktrees/path-check"
|
|
11299
|
+
for f in "$repo/docs/team/PROTOCOL.md" "$repo/AGENTS.md"; do
|
|
11300
|
+
ref="$expected"
|
|
11301
|
+
if [ "$f" = "$repo/AGENTS.md" ] && [ "$expected" = '.pi/skills/teamsmith' ]; then
|
|
11302
|
+
ref='"$(git rev-parse --path-format=absolute --git-common-dir)/../.pi/skills/teamsmith"'
|
|
11303
|
+
fi
|
|
11304
|
+
[ -f "$f" ] || { printf 'document missing\n'; return 1; }
|
|
11305
|
+
! grep -qF "$repo" "$f" || { printf 'absolute main root remains\n'; return 1; }
|
|
11306
|
+
if [ "${HOME:-}" != "/" ]; then
|
|
11307
|
+
! grep -qF "$HOME" "$f" || { printf 'absolute home remains\n'; return 1; }
|
|
11308
|
+
fi
|
|
11309
|
+
grep -qF "bash $ref/scripts/team help" "$f" || { printf 'expected team command missing\n'; return 1; }
|
|
11310
|
+
if [ "$expected" = '<skill-dir>' ]; then
|
|
11311
|
+
! grep -qF '.pi/skills/teamsmith' "$f" || { printf 'no-skills invented an install path\n'; return 1; }
|
|
11312
|
+
else
|
|
11313
|
+
[ -f "$repo/$expected/scripts/team" ] || { printf 'rendered team command does not exist\n'; return 1; }
|
|
11314
|
+
[ -f "$repo/$expected/tests/smoke.sh" ] || { printf 'rendered smoke command does not exist\n'; return 1; }
|
|
11315
|
+
fi
|
|
11316
|
+
done
|
|
11317
|
+
if [ "$expected" != '<skill-dir>' ]; then
|
|
11318
|
+
command_line="$(sed -n 's/.*Tooling: `\(bash .*\/scripts\/team help\)`.*/\1/p' "$repo/AGENTS.md")"
|
|
11319
|
+
( cd "$repo" && bash -c "$command_line" ) || return 1
|
|
11320
|
+
git -C "$repo" worktree add -q --detach "$wt" HEAD || return 1
|
|
11321
|
+
( cd "$wt" && bash -c "$command_line" ); local rc=$?
|
|
11322
|
+
git -C "$repo" worktree remove "$wt" || return 1
|
|
11323
|
+
[ "$rc" -eq 0 ] || { printf 'worker team command failed\n'; return 1; }
|
|
11324
|
+
fi
|
|
11325
|
+
}
|
|
11326
|
+
P440_NORMAL="$TMP/p440-normal-project"; p440_new_repo "$P440_NORMAL"
|
|
11327
|
+
( cd "$P440_NORMAL" && $TEAM init --session p440-normal --agents dev --vcs local --gates true "${P235_MODELS[@]}" ) >"$TMP/p440-normal-init.log" 2>&1 \
|
|
11328
|
+
|| { bad "P440 普通项目 init 失败"; tail -8 "$TMP/p440-normal-init.log"; }
|
|
11329
|
+
p440_protocol_paths_ok "$P440_NORMAL" '.pi/skills/teamsmith' >"$TMP/p440-normal-protocol.log" 2>&1 \
|
|
11330
|
+
&& ok "P440/P456 init 普通项目:PROTOCOL/AGENTS 不含 main/home 绝对路径,AGENTS 命令在主检出与 worker 均可用" \
|
|
11331
|
+
|| { bad "P440 init 普通项目路径断言失败"; cat "$TMP/p440-normal-protocol.log"; }
|
|
11332
|
+
|
|
11333
|
+
P440_SOURCE="$TMP/p440-source-project"; p440_new_repo "$P440_SOURCE"; mkdir -p "$P440_SOURCE/skills"
|
|
11334
|
+
cp -a "$SKILL_DIR" "$P440_SOURCE/skills/teamsmith"; cp -a "$SKILL_INIT_DIR" "$P440_SOURCE/skills/teamsmith-init"
|
|
11335
|
+
( cd "$P440_SOURCE" && git add skills && git commit -qm fixture-skills ) || bad "P456 源仓技能入夹具提交失败"
|
|
11336
|
+
( 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 \
|
|
11337
|
+
|| { bad "P440 源仓 init 失败"; tail -8 "$TMP/p440-source-init.log"; }
|
|
11338
|
+
p440_protocol_paths_ok "$P440_SOURCE" 'skills/teamsmith' >"$TMP/p440-source-protocol.log" 2>&1 \
|
|
11339
|
+
&& ok "P440/P456 init 源仓:PROTOCOL/AGENTS 用 skills/teamsmith 相对路径,AGENTS 命令在主检出与 worker 均可用" \
|
|
11340
|
+
|| { bad "P440 init 源仓路径断言失败"; cat "$TMP/p440-source-protocol.log"; }
|
|
11341
|
+
|
|
11342
|
+
P440_NOSKILLS="$TMP/p440-no-skills-project"; p440_new_repo "$P440_NOSKILLS"
|
|
11343
|
+
( 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 \
|
|
11344
|
+
|| { bad "P440 --no-skills init 失败"; tail -8 "$TMP/p440-no-skills-init.log"; }
|
|
11345
|
+
p440_protocol_paths_ok "$P440_NOSKILLS" '<skill-dir>' >"$TMP/p440-no-skills-protocol.log" 2>&1 \
|
|
11346
|
+
&& ok "P440 init --no-skills:只写明确占位,不伪造 .pi/skills 安装路径" \
|
|
11347
|
+
|| { bad "P440 init --no-skills 路径断言失败"; cat "$TMP/p440-no-skills-protocol.log"; }
|
|
11348
|
+
|
|
11349
|
+
# P456 沿用 P440 的红/绿/恢复:只把 AGENTS 的生成参数改回绝对 SKILL_DIR,同一行为断言必须红。
|
|
11350
|
+
cp "$P440_SOURCE/skills/teamsmith/scripts/lib/cmd-project.sh" "$TMP/p440-cmd-project.backup"
|
|
11351
|
+
python3 - "$P440_SOURCE/skills/teamsmith/scripts/lib/cmd-project.sh" <<'PY'
|
|
11352
|
+
import sys
|
|
11353
|
+
p = sys.argv[1]
|
|
11354
|
+
s = open(p, encoding='utf-8').read()
|
|
11355
|
+
old = '"SKILL_DIR=$agents_skill_dir" "AGENTS=$agents" "GATES=${gates:-<未配置>}"'
|
|
11356
|
+
assert s.count(old) == 1, 'P456 AGENTS render binding not found exactly once'
|
|
11357
|
+
new = '"SKILL_DIR=$TEAM_SKILL_DIR" "AGENTS=$agents" "GATES=${gates:-<未配置>}"'
|
|
11358
|
+
open(p, 'w', encoding='utf-8').write(s.replace(old, new, 1))
|
|
11359
|
+
PY
|
|
11360
|
+
( 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
|
|
11361
|
+
if p440_protocol_paths_ok "$P440_SOURCE" 'skills/teamsmith' >"$TMP/p440-source-red.log" 2>&1; then
|
|
11362
|
+
bad "P456 init 红侧失效:恢复绝对 SKILL_DIR 仍通过 AGENTS 路径断言"
|
|
11363
|
+
else
|
|
11364
|
+
ok "P440 init 红:恢复绝对 SKILL_DIR → 断言红($(tr '\n' ' ' < "$TMP/p440-source-red.log"))"
|
|
11365
|
+
fi
|
|
11366
|
+
cp "$TMP/p440-cmd-project.backup" "$P440_SOURCE/skills/teamsmith/scripts/lib/cmd-project.sh"
|
|
11367
|
+
( 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
|
|
11368
|
+
p440_protocol_paths_ok "$P440_SOURCE" 'skills/teamsmith' >"$TMP/p440-source-restore-green.log" 2>&1 \
|
|
11369
|
+
&& ok "P440 init 还原绿:源仓相对路径与真实命令恢复" \
|
|
11370
|
+
|| { bad "P440 init 还原后仍红"; cat "$TMP/p440-source-restore-green.log"; }
|
|
11371
|
+
|
|
11036
11372
|
# ③ P417:会话新旧改成推导 —— PM 进程启动时刻 vs skill 文件最近 mtime;没有记录可读,也没有记录要维护。
|
|
11037
11373
|
# 夹具:一份 skill 副本(真树在门禁期间不写;mtime 全钉在 2020)+ 一个真活进程当 PM(本段自己)。
|
|
11038
11374
|
mkdir -p "$M71/.pi/team/state"
|
|
@@ -11630,7 +11966,7 @@ os_need() {
|
|
|
11630
11966
|
os_pipeline_hits() { # <skill 目录> → 违规行(空 = 通过)
|
|
11631
11967
|
local d="$1" f="$1/references/openspec.md" p t n
|
|
11632
11968
|
if [ ! -f "$f" ]; then printf 'references/openspec.md: GUIDE-MISSING\n'; return 0; fi
|
|
11633
|
-
# ①
|
|
11969
|
+
# ① 五个阶段各一行:非空不够,verify/archive 的执行者必须不是 PM;合并后仍由同一 verifier 执行。
|
|
11634
11970
|
for p in $OS_PHASES; do
|
|
11635
11971
|
awk -F'|' -v p="$p" '
|
|
11636
11972
|
$3 ~ ("`opsx-" p "`") {
|
|
@@ -11638,11 +11974,24 @@ os_pipeline_hits() { # <skill 目录> → 违规行(空 = 通过)
|
|
|
11638
11974
|
owner = $4; gate = $7
|
|
11639
11975
|
gsub(/[[:space:]]/, "", owner); gsub(/[[:space:]]/, "", gate)
|
|
11640
11976
|
if (owner == "") print "OWNER-EMPTY " p
|
|
11977
|
+
if ((p == "verify" || p == "archive") && owner ~ /PM/) print "OWNER-PM " p
|
|
11641
11978
|
if (gate == "") print "GATE-EMPTY " p
|
|
11642
11979
|
}
|
|
11643
11980
|
END { if (!row) print "ROW-MISSING " p }
|
|
11644
11981
|
' "$f" | sed 's|^|references/openspec.md: |'
|
|
11645
11982
|
done
|
|
11983
|
+
local v_row a_row para
|
|
11984
|
+
v_row="$(awk -F'|' '$3 ~ /`opsx-verify`/ { print; exit }' "$f")"
|
|
11985
|
+
os_need "$v_row" references/openspec.md POST-MERGE-OWNER-MISSING \
|
|
11986
|
+
'same verifier' 'merged SHA' 'PM accepts' 'done'
|
|
11987
|
+
a_row="$(awk -F'|' '$3 ~ /`opsx-archive`/ { print; exit }' "$f")"
|
|
11988
|
+
os_need "$a_row" references/openspec.md VERIFY-PREREQ-MISSING 'completed merged-revision verification'
|
|
11989
|
+
os_need "$a_row" references/openspec.md CRITICAL-GATE-MISSING 'zero unresolved CRITICAL findings'
|
|
11990
|
+
os_need "$a_row" references/openspec.md ARCHIVE-WORKTREE-MISSING 'own worktree/task branch'
|
|
11991
|
+
os_need "$a_row" references/openspec.md ARCHIVE-SELF-PHASE 'phase=archive' 'opsx-archive'
|
|
11992
|
+
para="$(os_para_with "$f" 'For dependent archives')"
|
|
11993
|
+
os_need "$para" references/openspec.md ARCHIVE-BASELINE-MISSING \
|
|
11994
|
+
'predecessor archive is accepted and' 'merged first' 'complete MODIFIED block/scenario'
|
|
11646
11995
|
# ② 硬规则:没人复验自己的工作(「归档要用户确认」那一条由 ⑥ 的逐文件循环覆盖 —— 原来这里对
|
|
11647
11996
|
# references/openspec.md 还查过一遍同样的正则,P404 按净零纪律把它退了:同一条断言写两遍,
|
|
11648
11997
|
# 删掉哪一遍都不改变判定,只会让红侧点名的理由有两条互相遮蔽)
|
|
@@ -11658,13 +12007,32 @@ os_pipeline_hits() { # <skill 目录> → 违规行(空 = 通过)
|
|
|
11658
12007
|
grep -q 'openspec instructions' "$f" || printf 'references/openspec.md: DOCS-POINTER-MISSING\n'
|
|
11659
12008
|
grep -q 'openspec init --tools pi' "$f" || printf 'references/openspec.md: PRECONDITION-MISSING\n'
|
|
11660
12009
|
grep -qE '^### Requirement:' "$f" && printf 'references/openspec.md: ARTIFACT-SYNTAX-COPIED\n'
|
|
11661
|
-
# ⑥ 这条门必须写进 agent/PM
|
|
12010
|
+
# ⑥ 这条门必须写进 agent/PM 真正读的文件;判据落在执行段落,而不是文件里孤立的 independent 字样。
|
|
11662
12011
|
for t in templates/AGENTS.section.md.tmpl templates/PROTOCOL.md.tmpl SKILL.md references/workflows.md; do
|
|
11663
12012
|
if [ ! -f "$d/$t" ]; then printf '%s: FILE-MISSING\n' "$t"; continue; fi
|
|
11664
12013
|
grep -q 'opsx-apply' "$d/$t" || printf '%s: PHASE-NAMES-MISSING\n' "$t"
|
|
11665
12014
|
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
12015
|
done
|
|
12016
|
+
for t in templates/AGENTS.section.md.tmpl templates/PROTOCOL.md.tmpl SKILL.md; do
|
|
12017
|
+
para="$(os_para_with "$d/$t" 'A change runs as')"
|
|
12018
|
+
os_need "$para" "$t" 'OWNER-PM verify' '**different** agent' 'opsx-verify'
|
|
12019
|
+
os_need "$para" "$t" 'OWNER-PM archive' 'non-implementer worker' 'opsx-archive'
|
|
12020
|
+
os_need "$para" "$t" POST-MERGE-OWNER-MISSING 'same verifier'
|
|
12021
|
+
done
|
|
12022
|
+
para="$(awk -F'|' '$3 ~ /`opsx-verify`/ { print; exit }' "$d/references/workflows.md")"
|
|
12023
|
+
os_need "$para" references/workflows.md POST-MERGE-OWNER-MISSING 'same verifier' 'merged SHA' 'PM accepts'
|
|
12024
|
+
para="$(awk -F'|' '$3 ~ /`opsx-archive`/ { print; exit }' "$d/references/workflows.md")"
|
|
12025
|
+
os_need "$para" references/workflows.md OWNER-PM-archive 'non-implementer worker'
|
|
12026
|
+
# PM 的后台作业不能顶替委派;归档记录例外只覆盖指定 record/log。
|
|
12027
|
+
para="$(os_para_with "$d/templates/pm-prompt.md.tmpl" 'PM-owned')"
|
|
12028
|
+
os_need "$para" templates/pm-prompt.md.tmpl PM-BACKGROUND-VERIFY 'does not satisfy delegation' 'assigned non-implementer workers'
|
|
12029
|
+
para="$(os_para_with "$d/templates/OWNERSHIP.md.tmpl" 'Narrow review exception')"
|
|
12030
|
+
os_need "$para" templates/OWNERSHIP.md.tmpl LEDGER-EXCEPTION-MISSING \
|
|
12031
|
+
'docs/team/reviews/<ID>.md' '<ID>-verify.log' 'no other manual main-checkout write'
|
|
12032
|
+
# team init 的 D1 也必须把执行与接受分开,不能把 PM 复验写进每个新项目。
|
|
12033
|
+
para="$(os_para_with "$d/templates/DECISIONS.md.tmpl" 'Issue')"
|
|
12034
|
+
os_need "$para" templates/DECISIONS.md.tmpl 'OWNER-PM verify' \
|
|
12035
|
+
'verifier 独立复验' 'PM 审阅接受' 'PM 必须审阅复验证据与 diff' '不得以自己执行替代委派'
|
|
11668
12036
|
# ⑥b 任务书模板:`phase:` 头 + 五阶段枚举 + apply 门(这一份是 PM 抄着写简报的底稿)
|
|
11669
12037
|
t=templates/task.md.tmpl
|
|
11670
12038
|
if [ ! -f "$d/$t" ]; then printf '%s: FILE-MISSING\n' "$t"; else
|
|
@@ -11672,8 +12040,10 @@ os_pipeline_hits() { # <skill 目录> → 违规行(空 = 通过)
|
|
|
11672
12040
|
grep -q 'explore|propose|apply|verify|archive' "$d/$t" || printf '%s: PHASE-ENUM-MISSING\n' "$t"
|
|
11673
12041
|
grep -q 'ACCEPTED' "$d/$t" || printf '%s: APPLY-GATE-MISSING\n' "$t"
|
|
11674
12042
|
fi
|
|
12043
|
+
# 用户确认仍保留;限定的 PM-proxy 也必须带小步、可逆、已批准方案与记录理由,而非被删掉或无限放宽。
|
|
11675
12044
|
for t in templates/AGENTS.section.md.tmpl templates/PROTOCOL.md.tmpl SKILL.md references/workflows.md references/openspec.md; do
|
|
11676
|
-
|
|
12045
|
+
para="$(os_para_with "$d/$t" 'user.*confirm|confirm.*user')"
|
|
12046
|
+
os_need "$para" "$t" USER-CONFIRM-MISSING 'user' 'confirm' 'small, reversible' 'approved approach'
|
|
11677
12047
|
done
|
|
11678
12048
|
# ⑦ P404 · 规格点名的两处声明面(V125 实测:这两处此前**没有断言守着**,删掉整句、把冻结措辞改成
|
|
11679
12049
|
# 禁语,门禁都还是绿的)。判据取**段落里的实质**:先按空行取出那一段,再要求段落内同时有两条命令、
|
|
@@ -11789,6 +12159,30 @@ OS_CLEAN_HITS="$(os_pipeline_hits "$OS_SB")"
|
|
|
11789
12159
|
os_flip_red "指南里删掉 apply 那一行" "ROW-MISSING apply" "references/openspec.md" '/^| 3 | /d'
|
|
11790
12160
|
os_flip_red "掏空 verify 行的所有者单元格" "OWNER-EMPTY verify" "references/openspec.md" \
|
|
11791
12161
|
's/^| 4 | `opsx-verify` |[^|]*|/| 4 | `opsx-verify` | |/'
|
|
12162
|
+
os_flip_red "verify 所有者改回 PM(非空也算错)" "references/openspec.md: OWNER-PM verify" "references/openspec.md" \
|
|
12163
|
+
-E '/^\| 4 \| `opsx-verify`/s/an \*\*independent verify\*\* agent \(never the implementer\)/**PM**/'
|
|
12164
|
+
os_flip_red "archive 所有者改回 PM" "references/openspec.md: OWNER-PM archive" "references/openspec.md" \
|
|
12165
|
+
-E '/^\| 5 \| `opsx-archive`/s/a \*\*non-implementer worker\*\*/**PM**/'
|
|
12166
|
+
os_flip_red "AGENTS 的 verify 执行者改回 PM" "templates/AGENTS.section.md.tmpl: OWNER-PM verify" "templates/AGENTS.section.md.tmpl" \
|
|
12167
|
+
-E 's/a \*\*different\*\* agent runs/a PM runs/'
|
|
12168
|
+
os_flip_red "DECISIONS 的复验执行者改回 PM" "templates/DECISIONS.md.tmpl: OWNER-PM verify" "templates/DECISIONS.md.tmpl" \
|
|
12169
|
+
's/verifier 独立复验/PM 独立复验/'
|
|
12170
|
+
os_flip_red "合并后不再由同一 verifier 执行" "POST-MERGE-OWNER-MISSING" "references/openspec.md" \
|
|
12171
|
+
's/same verifier/PM/g'
|
|
12172
|
+
os_flip_red "归档允许缺 completed merged-revision verification" "VERIFY-PREREQ-MISSING" "references/openspec.md" \
|
|
12173
|
+
's/completed merged-revision verification/verification optional/g'
|
|
12174
|
+
os_flip_red "归档允许未清 CRITICAL" "CRITICAL-GATE-MISSING" "references/openspec.md" \
|
|
12175
|
+
's/zero unresolved CRITICAL findings/CRITICAL findings optional/g'
|
|
12176
|
+
os_flip_red "归档缺自己的 worktree/task branch 边界" "ARCHIVE-WORKTREE-MISSING" "references/openspec.md" \
|
|
12177
|
+
's/own worktree\/task branch/any checkout/g'
|
|
12178
|
+
os_flip_red "归档自身 phase 写成命令名而非 archive" "ARCHIVE-SELF-PHASE" "references/openspec.md" \
|
|
12179
|
+
's/phase=archive/phase=opsx-archive/g'
|
|
12180
|
+
os_flip_red "归档缺 predecessor merged baseline 对账" "ARCHIVE-BASELINE-MISSING" "references/openspec.md" \
|
|
12181
|
+
's/For dependent archives/For no ordering/'
|
|
12182
|
+
os_flip_red "PM 后台门禁被写成满足委派" "PM-BACKGROUND-VERIFY" "templates/pm-prompt.md.tmpl" \
|
|
12183
|
+
's/does not satisfy delegation/satisfies delegation/'
|
|
12184
|
+
os_flip_red "主检出写例外缺 companion log" "LEDGER-EXCEPTION-MISSING" "templates/OWNERSHIP.md.tmpl" \
|
|
12185
|
+
's/<ID>-verify.log//'
|
|
11792
12186
|
os_flip_red "掏空 propose 行的门禁单元格" "GATE-EMPTY propose" "references/openspec.md" \
|
|
11793
12187
|
's/\(^| 2 | .*`opsx-propose`.*\)|[^|]*|$/\1| |/'
|
|
11794
12188
|
os_flip_red "删掉「未 ACCEPTED 不得派 apply」" "APPLY-GATE-MISSING" "references/openspec.md" '/No apply brief may be dispatched/d'
|
|
@@ -11803,7 +12197,8 @@ os_flip_red "任务书模板不再提 apply 门" "APPLY-GATE-MISSING" "templates
|
|
|
11803
12197
|
os_flip_red "AGENTS 协议段不再提用户确认" "USER-CONFIRM-MISSING" "templates/AGENTS.section.md.tmpl" \
|
|
11804
12198
|
-E 's/user[^|]*confirm[^|]*/ACCOUNTABILITY-REMOVED/g'
|
|
11805
12199
|
os_flip_red "任务书模板删掉 phase: 头" "PHASE-FIELD-MISSING" "templates/task.md.tmpl" '/^phase:/d'
|
|
11806
|
-
os_flip_red "runbook
|
|
12200
|
+
os_flip_red "runbook 合并后缺同一 verifier" "references/workflows.md: POST-MERGE-OWNER-MISSING" "references/workflows.md" \
|
|
12201
|
+
'/^| 4 | `opsx-verify`/s/same verifier/PM/'
|
|
11807
12202
|
# P404 · 两处声明面的红侧(V125 的三个变异:此前每一个都还能全绿)
|
|
11808
12203
|
os_flip_red "删掉 SKILL.md 的双门禁分工那段" "TWO-GATES-MISSING" "SKILL.md" \
|
|
11809
12204
|
'/^The two gates answer different questions/,/^$/d'
|
|
@@ -13461,6 +13856,42 @@ else
|
|
|
13461
13856
|
fi
|
|
13462
13857
|
p10m env TEAM_REQUIRE_JS=0 $TEAM paths >"$TMP/p10-paths-reqjs.log" 2>&1
|
|
13463
13858
|
assert_has "$TMP/p10-paths-reqjs.log" '"require_js": "0"' "26-k paths:TEAM_REQUIRE_JS=0 反映在 paths 里"
|
|
13859
|
+
P10_FLOCK_FIXTURE="$(command -v flock || true)"
|
|
13860
|
+
if [ -n "$P10_FLOCK_FIXTURE" ] && [ -n "$P10_JS_FIXTURE" ]; then
|
|
13861
|
+
assert_has "$TMP/p10-paths.log" "\"flock_runner\": \"$P10_FLOCK_FIXTURE\"" "26-k paths:报出事务实际使用的 flock 绝对路径"
|
|
13862
|
+
P10_NOFLOCK="$TMP/p10-noflock-bin"
|
|
13863
|
+
cp -a "$P10_NOJS" "$P10_NOFLOCK"
|
|
13864
|
+
rm -f "$P10_NOFLOCK/flock"
|
|
13865
|
+
p10nojs env PATH="$P10_NOFLOCK" TEAM_JS_BIN="$P10_JS_FIXTURE" $TEAM paths >"$TMP/p10-paths-noflock.log" 2>&1
|
|
13866
|
+
assert_has "$TMP/p10-paths-noflock.log" '"flock_runner": ""' "26-k paths:缺 flock 时如实给出空解析结果"
|
|
13867
|
+
if p10nojs env PATH="$P10_NOFLOCK" TEAM_JS_BIN="$P10_JS_FIXTURE" $TEAM doctor >"$TMP/p10-doctor-noflock.log" 2>&1; then
|
|
13868
|
+
bad "26-k flock:缺 flock 时 doctor 应失败"
|
|
13869
|
+
else
|
|
13870
|
+
ok "26-k flock:没有 Reminder 的项目缺 flock,doctor 仍失败"
|
|
13871
|
+
fi
|
|
13872
|
+
assert_has "$TMP/p10-doctor-noflock.log" "状态锁 flock" "26-k flock:失败行点名状态锁"
|
|
13873
|
+
assert_has "$TMP/p10-doctor-noflock.log" "PATH 里没有可执行 flock" "26-k flock:失败行区分 PATH 中缺失"
|
|
13874
|
+
assert_has "$TMP/p10-doctor-noflock.log" "util-linux" "26-k flock:缺失行给出安装修复方式"
|
|
13875
|
+
P10_BADFLOCK="$TMP/p10-badflock-bin"
|
|
13876
|
+
cp -a "$P10_NOFLOCK" "$P10_BADFLOCK"
|
|
13877
|
+
printf 'not executable\n' >"$P10_BADFLOCK/flock"
|
|
13878
|
+
chmod 0644 "$P10_BADFLOCK/flock"
|
|
13879
|
+
if [ "$(env PATH="$P10_BADFLOCK" bash -c 'command -v flock')" = "$P10_BADFLOCK/flock" ] \
|
|
13880
|
+
&& [ ! -x "$P10_BADFLOCK/flock" ]; then
|
|
13881
|
+
ok "26-k flock 夹具:PATH 里有 flock 文件但不可执行(不是空 PATH 假象)"
|
|
13882
|
+
else
|
|
13883
|
+
bad "26-k flock 夹具:没有造出「找得到文件、但没有执行权限」的形状"
|
|
13884
|
+
fi
|
|
13885
|
+
if p10nojs env PATH="$P10_BADFLOCK" TEAM_JS_BIN="$P10_JS_FIXTURE" $TEAM doctor >"$TMP/p10-doctor-badflock.log" 2>&1; then
|
|
13886
|
+
bad "26-k flock:不可执行 flock 时 doctor 应失败"
|
|
13887
|
+
else
|
|
13888
|
+
ok "26-k flock:不可执行 flock → doctor 失败"
|
|
13889
|
+
fi
|
|
13890
|
+
assert_has "$TMP/p10-doctor-badflock.log" "$P10_BADFLOCK/flock" "26-k flock:不可执行行点名实际路径"
|
|
13891
|
+
assert_has "$TMP/p10-doctor-badflock.log" "chmod +x" "26-k flock:不可执行行给出权限修复方式"
|
|
13892
|
+
else
|
|
13893
|
+
cond_skip "26-k flock paths/doctor" "本机缺 flock 或 JS 运行时;权威夹具另有缺锁负例"
|
|
13894
|
+
fi
|
|
13464
13895
|
|
|
13465
13896
|
# ---------------------------------------------------------------- 26-l. 文档契约 + 隔离(真项目零污染)
|
|
13466
13897
|
# R11-S2 的另一半:活动列的新默认值是**写在文档里**的契约变更,不是悄悄改的
|
|
@@ -14735,10 +15166,10 @@ PYRC
|
|
|
14735
15166
|
assert_eq "28-i2 项目根软链:还原后 change/decision 照常服务" "$P28I2_RL_CTL" "ok"
|
|
14736
15167
|
|
|
14737
15168
|
# ---- 28-i3 项目内的软链(P424)
|
|
14738
|
-
#
|
|
14739
|
-
#
|
|
14740
|
-
#
|
|
14741
|
-
P28I3="$P27R/
|
|
15169
|
+
# 现场形状:`docs/team → module/docs/team`(同一项目内)。旧判据按「路径上任一段是软链」拒绝,
|
|
15170
|
+
# 详情面整页不可用;新判据只看**解析后的落点**。翻转证据在报告里(判据改回「任一段是软链就拒」→
|
|
15171
|
+
# 「项目内软链的详情可读」那条必须变红),这里钉正向与反面。
|
|
15172
|
+
P28I3="$P27R/module"
|
|
14742
15173
|
mkdir -p "$P28I3/docs"
|
|
14743
15174
|
mv "$P27R/docs/team" "$P28I3/docs/team"
|
|
14744
15175
|
ln -sfn "$P28I3/docs/team" "$P27R/docs/team"
|
|
@@ -17063,97 +17494,6 @@ fi
|
|
|
17063
17494
|
# 不碰 $REPO、不起真进程([real] 子段除外,那里 live_mark 并真起 tmux 场地)。
|
|
17064
17495
|
# 判据编号对应 openspec/changes/change-centric-discipline/tasks.md;B2(digest/面板归组)本任务不做。
|
|
17065
17496
|
# ═════════════════════════════════════════════════════════════════════════════
|
|
17066
|
-
P24_ROOT="$TMP/p24"
|
|
17067
|
-
P24_SHIM="$P24_ROOT/shim"
|
|
17068
|
-
P24_SHIM_LOG="$P24_ROOT/shim-calls.log"
|
|
17069
|
-
mkdir -p "$P24_SHIM"
|
|
17070
|
-
printf '#!/usr/bin/env bash\nprintf "%%s\\n" "$*" >> "%s"\nexit 0\n' "$P24_SHIM_LOG" > "$P24_SHIM/tmux"
|
|
17071
|
-
chmod +x "$P24_SHIM/tmux"
|
|
17072
|
-
|
|
17073
|
-
p24_project() { # <名字> [<agents>] → 打印项目路径(git + team init + openspec/specs + change alpha 目录)
|
|
17074
|
-
local name="$1" agents="${2:-dev verify dev2}" p
|
|
17075
|
-
p="$P24_ROOT/$name"
|
|
17076
|
-
rm -rf "$p"; mkdir -p "$p"
|
|
17077
|
-
( cd "$p" && git init -q -b main && git config user.email p24@smoke && git config user.name p24 \
|
|
17078
|
-
&& git commit -q --allow-empty -m "chore: init" ) >/dev/null 2>&1
|
|
17079
|
-
( cd "$p" && $TEAM init --session "p24-$name" --agents "$agents" --vcs local --gates "true" --docs docs/team "${P235_MODELS[@]}" ) >"$p/.init.log" 2>&1
|
|
17080
|
-
printf 'TEAM_PI_BIN="/bin/true"\n' >> "$p/.pi/team/config.sh"
|
|
17081
|
-
mkdir -p "$p/openspec/specs/panel" "$p/openspec/specs/dispatch"
|
|
17082
|
-
printf '### Requirement: The board page is a kanban over the board\x27s states\n' > "$p/openspec/specs/panel/spec.md"
|
|
17083
|
-
printf '### Requirement: A brief is self-contained and names its evidence\n' > "$p/openspec/specs/dispatch/spec.md"
|
|
17084
|
-
p24_change "$p" alpha
|
|
17085
|
-
printf '%s\n' "$p"
|
|
17086
|
-
}
|
|
17087
|
-
p24_change() { # <项目> <change id> → 建一个带 panel delta 的 change 目录
|
|
17088
|
-
local p="$1" c="$2"
|
|
17089
|
-
mkdir -p "$p/openspec/changes/$c/specs/panel"
|
|
17090
|
-
printf '## MODIFIED Requirements\n\n### Requirement: %s delta fixture\n' "$c" > "$p/openspec/changes/$c/specs/panel/spec.md"
|
|
17091
|
-
}
|
|
17092
|
-
p24_brief() { # <项目> <ID> <agent> <phase> <change> <deltas|@absent> [<anchor>] [<specs>]
|
|
17093
|
-
local p="$1" id="$2" agent="$3" phase="$4" change="$5" deltas="$6" anchor="${7:-}" specs="${8:--}"
|
|
17094
|
-
mkdir -p "$p/docs/team/tasks"
|
|
17095
|
-
{
|
|
17096
|
-
printf '# %s · fixture\n\n```\n' "$id"
|
|
17097
|
-
# P242/A2:唯一 category: 头是新合同的合法输入(本节测锚/delta/独立性,类别不是被测对象)。
|
|
17098
|
-
printf 'task: %s\nagent: %s\nissue: -\ncategory: routine\n' "$id" "$agent"
|
|
17099
|
-
printf 'change: %s\nspecs: %s\nphase: %s\ndeps: -\nstatus: todo\nbudget: -\n' "$change" "$specs" "$phase"
|
|
17100
|
-
[ -n "$anchor" ] && printf 'anchor: %s\n' "$anchor"
|
|
17101
|
-
[ "$deltas" = "@absent" ] || printf 'deltas: %s\n' "$deltas"
|
|
17102
|
-
printf '```\n\nbody\n'
|
|
17103
|
-
} > "$p/docs/team/tasks/$id-fixture.md"
|
|
17104
|
-
return 0
|
|
17105
|
-
}
|
|
17106
|
-
p24_add() { # <项目> <ID> [<agent>]
|
|
17107
|
-
local p="$1" id="$2" agent="${3:-dev}"
|
|
17108
|
-
( cd "$p" && $TEAM board add "$id" "$id fixture" "$agent" - - ) >/dev/null 2>&1
|
|
17109
|
-
return 0
|
|
17110
|
-
}
|
|
17111
|
-
p24_team() { # <项目> <args...> → team CLI(stdout+stderr 合并)
|
|
17112
|
-
local p="$1"; shift
|
|
17113
|
-
( cd "$p" && $TEAM "$@" ) 2>&1
|
|
17114
|
-
}
|
|
17115
|
-
p24_dispatch() { # <项目> <agent> <ID> <brief> [args...] → 记录式 shim 下的 dispatch(stdout+stderr)
|
|
17116
|
-
local p="$1" agent="$2" id="$3" brief="$4"; shift 4
|
|
17117
|
-
: > "$P24_SHIM_LOG"
|
|
17118
|
-
( cd "$p" && env PATH="$P24_SHIM:$PATH" TEAM_DISPATCH_VERIFY_SEC=1 TEAM_DISPATCH_ALIVE_SEC=0 \
|
|
17119
|
-
$TEAM dispatch "$agent" "$id" "$brief" "$@" ) 2>&1
|
|
17120
|
-
}
|
|
17121
|
-
p24_shim_windows() { grep -cE 'new-window|new-session|respawn-pane' "$P24_SHIM_LOG" 2>/dev/null || true; }
|
|
17122
|
-
p24_branch() { # <项目> <agent> <ID> → 规范任务分支(canon_branch 绑死在 $REPO,这里自己算)
|
|
17123
|
-
( cd "$1" && env -u TEAM_ROOT -u TEAM_MAIN_ROOT -u TEAM_SKILL_DIR \
|
|
17124
|
-
bash -c '. "'"$SKILL_DIR"'/scripts/lib/common.sh"; for _f in "'"$SKILL_DIR"'"/scripts/lib/cmd-*.sh; do . "$_f" 2>/dev/null || true; done; team_load_config >/dev/null 2>&1; team_branch_for_agent "'"$2"'" "'"$3"'"' )
|
|
17125
|
-
}
|
|
17126
|
-
p24_wt() { # <项目> <agent> <ID> → 把该 agent 的 worktree 停在 <ID> 的规范分支上(可重复调用)
|
|
17127
|
-
local p="$1" a="$2" id="$3" br
|
|
17128
|
-
git -C "$p" worktree remove --force "$p/.worktrees/$a" >/dev/null 2>&1 || true
|
|
17129
|
-
git -C "$p" worktree prune >/dev/null 2>&1 || true
|
|
17130
|
-
br="$(p24_branch "$p" "$a" "$id")"
|
|
17131
|
-
[ -n "$br" ] || return 1
|
|
17132
|
-
git -C "$p" branch -D "$br" >/dev/null 2>&1 || true
|
|
17133
|
-
git -C "$p" worktree add -b "$br" "$p/.worktrees/$a" main >/dev/null 2>&1 || return 1
|
|
17134
|
-
rm -f "$p/.pi/team/state/$a.env"
|
|
17135
|
-
return 0
|
|
17136
|
-
}
|
|
17137
|
-
p24_pass() { # <项目> <id> → review 记录 PASS
|
|
17138
|
-
local p="$1" id="$2"
|
|
17139
|
-
mkdir -p "$p/docs/team/reviews"
|
|
17140
|
-
printf -- '- 2026-09-20T00:00:00Z · `team review %s` · 判定: **PASS**\n' "$id" > "$p/docs/team/reviews/$id.md"
|
|
17141
|
-
}
|
|
17142
|
-
p24_board_row() { p24_team "$1" board row "$2" 2>/dev/null | tail -1; }
|
|
17143
|
-
p24_unchanged() { # <项目> <ID> <原行> <说明>
|
|
17144
|
-
assert_eq "$4:看的板行没被改动" "$(p24_board_row "$1" "$2")" "$3"
|
|
17145
|
-
}
|
|
17146
|
-
p24_json_ok() { # <文本> → 0=是合法 JSON(没有解析器时退化成形状检查)
|
|
17147
|
-
local t="$1"
|
|
17148
|
-
if command -v python3 >/dev/null 2>&1; then printf '%s' "$t" | python3 -c 'import json,sys; json.load(sys.stdin)' >/dev/null 2>&1; return $?; fi
|
|
17149
|
-
if [ -n "$JS_RUNNER" ]; then printf '%s' "$t" | "$JS_RUNNER" -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>JSON.parse(s))' >/dev/null 2>&1; return $?; fi
|
|
17150
|
-
case "$t" in '{"id":'*'}') return 0 ;; esac
|
|
17151
|
-
return 1
|
|
17152
|
-
}
|
|
17153
|
-
p24_read() { # <项目> <函数名> <brief> → 在项目上下文里直接驱动读取器(stdout+stderr 原样)
|
|
17154
|
-
( cd "$1" && env -u TEAM_ROOT -u TEAM_MAIN_ROOT -u TEAM_SKILL_DIR \
|
|
17155
|
-
bash -c '. "'"$SKILL_DIR"'/scripts/lib/common.sh"; for _f in "'"$SKILL_DIR"'"/scripts/lib/cmd-*.sh; do . "$_f" 2>/dev/null || true; done; team_load_config >/dev/null 2>&1; "$@"' _ "$2" "$3" ) 2>&1
|
|
17156
|
-
}
|
|
17157
17497
|
|
|
17158
17498
|
# ---------------------------------------------------------------- 12e · change 视图(B1)
|
|
17159
17499
|
section "12e · change 视图(P24/B1:严格头部读取 + 就绪判据)"
|
|
@@ -17828,10 +18168,10 @@ assert_eq "12i --force 越过守卫" "$([ "$(p24_shim_windows)" -ge 1 ] && echo
|
|
|
17828
18168
|
section "12j · 归档前提(P24/B6)"
|
|
17829
18169
|
P24J="$(p24_project 12j)"
|
|
17830
18170
|
mkdir -p "$P24J/openspec/changes/archive/2026-09-20-alpha"
|
|
17831
|
-
p24_brief "$P24J" A1
|
|
18171
|
+
p24_brief "$P24J" A1 verify archive alpha -
|
|
17832
18172
|
p24_brief "$P24J" M1 dev apply alpha -
|
|
17833
|
-
p24_brief "$P24J" C1
|
|
17834
|
-
p24_add "$P24J" A1
|
|
18173
|
+
p24_brief "$P24J" C1 verify archive - -
|
|
18174
|
+
p24_add "$P24J" A1 verify; p24_add "$P24J" M1 dev; p24_add "$P24J" C1 verify
|
|
17835
18175
|
p24_team "$P24J" board set M1 wip >/dev/null 2>&1
|
|
17836
18176
|
A1_ROW="$(p24_board_row "$P24J" A1)"
|
|
17837
18177
|
J_OUT="$(p24_team "$P24J" board set A1 done)"; J_RC=$?
|
|
@@ -17875,8 +18215,8 @@ P209A="$(p24_project 12j-checklist)"
|
|
|
17875
18215
|
p24_change "$P209A" alpha
|
|
17876
18216
|
mkdir -p "$P209A/openspec/changes/archive/2026-10-03-alpha"
|
|
17877
18217
|
p24_brief "$P209A" M1 dev apply alpha -
|
|
17878
|
-
p24_brief "$P209A" A1
|
|
17879
|
-
p24_add "$P209A" M1 dev; p24_add "$P209A" A1
|
|
18218
|
+
p24_brief "$P209A" A1 verify archive alpha -
|
|
18219
|
+
p24_add "$P209A" M1 dev; p24_add "$P209A" A1 verify
|
|
17880
18220
|
p24_pass "$P209A" M1
|
|
17881
18221
|
p24_team "$P209A" board set M1 done >/dev/null 2>&1
|
|
17882
18222
|
cat > "$P209A/openspec/changes/alpha/tasks.md" <<'EOT'
|
|
@@ -17920,8 +18260,8 @@ assert_file "$P209A/docs/team/reviews/A1-done.md" "12j P209 done 证据落盘"
|
|
|
17920
18260
|
p24_brief "$P209A" M2 dev2 apply alpha -
|
|
17921
18261
|
p24_add "$P209A" M2 dev2
|
|
17922
18262
|
p24_team "$P209A" board set M2 wip >/dev/null 2>&1
|
|
17923
|
-
p24_brief "$P209A" A2
|
|
17924
|
-
p24_add "$P209A" A2
|
|
18263
|
+
p24_brief "$P209A" A2 verify archive alpha -
|
|
18264
|
+
p24_add "$P209A" A2 verify
|
|
17925
18265
|
A_RV="$(p24_team "$P209A" change status alpha)"; A_RV_RC=$?
|
|
17926
18266
|
assert_eq "12j P209 清单全勾但兄弟没结束 → 仍然非 0" "$A_RV_RC" "1"
|
|
17927
18267
|
assert_has_echo "$A_RV" "M2 · apply · wip ·" "12j P209 反向阻塞来自映射任务(不是清单)"
|
|
@@ -17932,8 +18272,8 @@ assert_has_echo "$A_RV_DONE" "M2 · apply · wip ·" "12j P209 反向拒绝点
|
|
|
17932
18272
|
assert_not_echo "$A_RV_DONE" "checklist" "12j P209 反向拒绝不提清单(新检查没顶掉旧的)"
|
|
17933
18273
|
# 归档之后:活动目录没了,读归档那份(真实时序里归档任务的 done 闸门这时才跑)
|
|
17934
18274
|
P209B="$(p24_project 12j-archived)"
|
|
17935
|
-
p24_brief "$P209B" B1
|
|
17936
|
-
p24_add "$P209B" B1
|
|
18275
|
+
p24_brief "$P209B" B1 verify archive beta -
|
|
18276
|
+
p24_add "$P209B" B1 verify
|
|
17937
18277
|
mkdir -p "$P209B/openspec/changes/archive/2026-10-03-beta"
|
|
17938
18278
|
printf '# Tasks: beta\n\n- [ ] 1.1 没勾\n' > "$P209B/openspec/changes/archive/2026-10-03-beta/tasks.md"
|
|
17939
18279
|
B_NC="$(p24_team "$P209B" change status beta)"; B_NC_RC=$?
|
|
@@ -23055,8 +23395,8 @@ assert_eq "P95 ⑥ 红侧:记录下来在暂存区里(checkout 只动了索
|
|
|
23055
23395
|
# ① `tests/routes.sh`——Walk A(team help 的每条用法行 ↔ 解析器)、非空洞控制臂(打印旗标的
|
|
23056
23396
|
# 每条路径必须拒未知参数)、Walk B(schema 注释点名的命令 ↔ 承诺探针)与翻转(把树改坏必须
|
|
23057
23397
|
# 红并点名)。FAST 由 TEAM_SMOKE_FAST 透传:它只跳翻转(一行可见 SKIP),前三段照跑。
|
|
23058
|
-
# ②
|
|
23059
|
-
#
|
|
23398
|
+
# ② `tests/help-surface.sh`:覆盖/语言机制/声明与探针/不变量/路由。
|
|
23399
|
+
# 两件都自带私有临时根,不碰 $REPO。
|
|
23060
23400
|
section "51 · 用法诚实性:help 的每条承诺与名册的每条路线都有夹具兑现(P99)"
|
|
23061
23401
|
# P410 拆段:routes.sh 的**产品面**留在这里(walk A:help 印出来的每条命令/每个 flag 都要被真解析器接住;
|
|
23062
23402
|
# 控制臂:吞掉未知参数的解析器要被点名;promises:schema 注释点名的承诺必须在真夹具里兑现;refusals),
|
|
@@ -23095,18 +23435,6 @@ if [ -f "$SKILL_DIR/tests/help-surface.sh" ]; then
|
|
|
23095
23435
|
else
|
|
23096
23436
|
bad "51 缺 tests/help-surface.sh(cli-help 的帮助面夹具)"
|
|
23097
23437
|
fi
|
|
23098
|
-
if [ -f "$SKILL_DIR/tests/config-cli.sh" ]; then
|
|
23099
|
-
P99_ROSTER_RC=0
|
|
23100
|
-
bash "$SKILL_DIR/tests/config-cli.sh" list validate roster >"$TMP/p99-roster.log" 2>&1 || P99_ROSTER_RC=$?
|
|
23101
|
-
if [ "$P99_ROSTER_RC" -eq 0 ]; then
|
|
23102
|
-
ok "51 名册/契约夹具(list+validate+roster)全绿($(grep -ac '✓' "$TMP/p99-roster.log" || true) 条断言)"
|
|
23103
|
-
else
|
|
23104
|
-
bad "51 名册/契约夹具有失败(rc=$P99_ROSTER_RC)"
|
|
23105
|
-
grep -a '✗' "$TMP/p99-roster.log" | head -8 | sed 's/^/ /'
|
|
23106
|
-
fi
|
|
23107
|
-
else
|
|
23108
|
-
bad "51 缺 tests/config-cli.sh"
|
|
23109
|
-
fi
|
|
23110
23438
|
|
|
23111
23439
|
# ---------------------------------------------------------------- 51m. 用法诚实性的二阶腿
|
|
23112
23440
|
# routes.sh 的 `flips`:十次变异(场缺失 / 兄弟 flag / 吞参数 / 不可归属的 help 行 / 假 schema 路由 /
|
|
@@ -24757,7 +25085,7 @@ else
|
|
|
24757
25085
|
if [ "$P406_RC" -eq 0 ]; then
|
|
24758
25086
|
P406_SUM="$(smoke_inner_summary "$TMP/p406-state-authority.log" state-authority)" || P406_SUM=""
|
|
24759
25087
|
if [ -n "$P406_SUM" ]; then
|
|
24760
|
-
ok "P406 权威层夹具全绿($P406_SUM:状态根 / 快照 / flock / 原子写 /
|
|
25088
|
+
ok "P406 权威层夹具全绿($P406_SUM:状态根 / 快照 / flock / 原子写 / 八条翻转臂)"
|
|
24761
25089
|
else
|
|
24762
25090
|
bad "P406 权威层夹具绿了但读不到它自己的结果行(夹具契约破了)"
|
|
24763
25091
|
fi
|
|
@@ -24776,7 +25104,7 @@ fi
|
|
|
24776
25104
|
# 覆盖 CLI 面(add/list/show/cancel)/ 输入拒绝 / key 幂等与释放 / 派生视图(手工改快照后计数跟着变)/
|
|
24777
25105
|
# 有界终结历史与已签发高水位 / 主项目隔离;五条翻转臂在 scratch 副本上把实现逐条改坏,要求具名断言变红。
|
|
24778
25106
|
# 纯逻辑:不建 tmux、不起 pi,FAST 与全量都跑。
|
|
24779
|
-
section "67 · 提醒:CLI / 派生视图 / 到期入队与投递(P409+P423
|
|
25107
|
+
section "67 · 提醒:CLI / PM 工具 / 派生视图 / 到期入队与投递(P409+P423+P442)"
|
|
24780
25108
|
P409_FIX="$SKILL_DIR/tests/remind-cli.sh"
|
|
24781
25109
|
if [ ! -f "$P409_FIX" ]; then
|
|
24782
25110
|
bad "P409 缺 tests/remind-cli.sh(提醒 CLI 夹具)"
|
|
@@ -24824,6 +25152,128 @@ else
|
|
|
24824
25152
|
fi
|
|
24825
25153
|
fi
|
|
24826
25154
|
|
|
25155
|
+
# P442:PM 工具的身份拒绝/全文红绿在假宿主上跑;真实 Pi/tmux + controlled model 是全量段的另一腿,
|
|
25156
|
+
# 不接触真实团队、真实模型或默认 tmux server。FAST 只显式跳过后者。
|
|
25157
|
+
P442_NODE_FIX="$SKILL_DIR/tests/remind-tool-node.mjs"
|
|
25158
|
+
if [ ! -f "$P442_NODE_FIX" ]; then
|
|
25159
|
+
bad "P442 缺 tests/remind-tool-node.mjs(PM 工具身份与全文夹具)"
|
|
25160
|
+
else
|
|
25161
|
+
node "$P442_NODE_FIX" >"$TMP/p442-remind-tool-node.log" 2>&1; P442_NODE_RC=$?
|
|
25162
|
+
if [ "$P442_NODE_RC" -eq 0 ]; then
|
|
25163
|
+
assert_has "$TMP/p442-remind-tool-node.log" "remind-tool-node: passed=9 failed=0" "P442 假宿主:身份零读写、配置解析与全文红绿全绿"
|
|
25164
|
+
else
|
|
25165
|
+
bad "P442 假宿主工具夹具红(rc=$P442_NODE_RC)"
|
|
25166
|
+
tail -12 "$TMP/p442-remind-tool-node.log" | sed 's/^/ /'
|
|
25167
|
+
fi
|
|
25168
|
+
fi
|
|
25169
|
+
P442_REAL_FIX="$SKILL_DIR/tests/remind-tool-real.sh"
|
|
25170
|
+
if [ "$FAST" = "1" ]; then
|
|
25171
|
+
cond_skip "P442 真实 Pi 工具夹具" "FAST:私有真实 Pi/tmux + controlled model 另跑"
|
|
25172
|
+
elif [ ! -f "$P442_REAL_FIX" ]; then
|
|
25173
|
+
bad "P442 缺 tests/remind-tool-real.sh"
|
|
25174
|
+
elif ! command -v "${P442_PI:-pi}" >/dev/null 2>&1; then
|
|
25175
|
+
cond_skip "P442 真实 Pi 工具夹具" "找不到真实 Pi(可设 P442_PI)"
|
|
25176
|
+
else
|
|
25177
|
+
P442_EVIDENCE="$TMP/p442" P442_KEEP=1 bash "$P442_REAL_FIX" >"$TMP/p442-remind-tool-real.log" 2>&1; P442_REAL_RC=$?
|
|
25178
|
+
if [ "$P442_REAL_RC" -eq 0 ]; then
|
|
25179
|
+
assert_has "$TMP/p442-remind-tool-real.log" "remind-tool-real: passed=10 failed=0" "P442 真实 Pi:PM 工具/身份/配置错误/doctor 十组全绿"
|
|
25180
|
+
else
|
|
25181
|
+
bad "P442 真实 Pi 工具夹具红(rc=$P442_REAL_RC)"
|
|
25182
|
+
tail -16 "$TMP/p442-remind-tool-real.log" | sed 's/^/ /'
|
|
25183
|
+
fi
|
|
25184
|
+
fi
|
|
25185
|
+
|
|
25186
|
+
# ---------------------------------------------------------------- 68. Reminder 生命周期与恢复(P443)
|
|
25187
|
+
section "68 · 提醒:停止恢复 / 两种 Pulse / 并发与迟到生命周期(P443)"
|
|
25188
|
+
P443_LIFE="$SKILL_DIR/tests/remind-lifecycle.sh"
|
|
25189
|
+
if [ ! -f "$P443_LIFE" ]; then
|
|
25190
|
+
bad "P443 缺 tests/remind-lifecycle.sh"
|
|
25191
|
+
else
|
|
25192
|
+
bash "$P443_LIFE" >"$TMP/p443-lifecycle.log" 2>&1; P443_LIFE_RC=$?
|
|
25193
|
+
if [ "$P443_LIFE_RC" -eq 0 ]; then
|
|
25194
|
+
P443_LIFE_SUM="$(smoke_inner_summary "$TMP/p443-lifecycle.log" remind-lifecycle)" || P443_LIFE_SUM=""
|
|
25195
|
+
[ -n "$P443_LIFE_SUM" ] && ok "P443 生命周期夹具全绿($P443_LIFE_SUM)" || bad "P443 生命周期绿了但缺结果行"
|
|
25196
|
+
assert_has "$TMP/p443-lifecycle.log" "flip(去掉活跃 key 检查)" "P443 并发 key 的红侧真的跑了"
|
|
25197
|
+
assert_has "$TMP/p443-lifecycle.log" "flip(修剪丢掉 unknown)" "P443 活跃记录保留的红侧真的跑了"
|
|
25198
|
+
elif [ "$P443_LIFE_RC" -eq 3 ]; then
|
|
25199
|
+
cond_skip "P443 生命周期夹具" "缺少生命周期夹具前提"
|
|
25200
|
+
else
|
|
25201
|
+
bad "P443 生命周期夹具红(rc=$P443_LIFE_RC)"; tail -14 "$TMP/p443-lifecycle.log" | sed 's/^/ /'
|
|
25202
|
+
fi
|
|
25203
|
+
fi
|
|
25204
|
+
P443_UNIT="$SKILL_DIR/tests/remind-recovery-unit.sh"
|
|
25205
|
+
if [ ! -f "$P443_UNIT" ]; then
|
|
25206
|
+
bad "P443 缺 tests/remind-recovery-unit.sh"
|
|
25207
|
+
else
|
|
25208
|
+
bash "$P443_UNIT" >"$TMP/p443-recovery-unit.log" 2>&1; P443_UNIT_RC=$?
|
|
25209
|
+
if [ "$P443_UNIT_RC" -eq 0 ]; then
|
|
25210
|
+
P443_UNIT_SUM="$(smoke_inner_summary "$TMP/p443-recovery-unit.log" remind-recovery-unit)" || P443_UNIT_SUM=""
|
|
25211
|
+
[ -n "$P443_UNIT_SUM" ] && ok "P443 无提示启动与恢复拒绝矩阵全绿($P443_UNIT_SUM)" || bad "P443 恢复单元夹具绿了但缺结果行"
|
|
25212
|
+
else
|
|
25213
|
+
bad "P443 恢复单元夹具红(rc=$P443_UNIT_RC)"; tail -14 "$TMP/p443-recovery-unit.log" | sed 's/^/ /'
|
|
25214
|
+
fi
|
|
25215
|
+
fi
|
|
25216
|
+
P443_PULSE="$SKILL_DIR/tests/remind-pulse.sh"
|
|
25217
|
+
if [ "$FAST" = "1" ]; then
|
|
25218
|
+
cond_skip "P443 两种 Pulse 形状" "FAST:真实 headless/console 调度另跑"
|
|
25219
|
+
elif [ ! -f "$P443_PULSE" ]; then
|
|
25220
|
+
bad "P443 缺 tests/remind-pulse.sh"
|
|
25221
|
+
else
|
|
25222
|
+
bash "$P443_PULSE" >"$TMP/p443-pulse.log" 2>&1; P443_PULSE_RC=$?
|
|
25223
|
+
if [ "$P443_PULSE_RC" -eq 0 ]; then
|
|
25224
|
+
P443_PULSE_SUM="$(smoke_inner_summary "$TMP/p443-pulse.log" remind-pulse)" || P443_PULSE_SUM=""
|
|
25225
|
+
[ -n "$P443_PULSE_SUM" ] && ok "P443 两种 Pulse:长巡检入队、合并恢复与子进程回收全绿($P443_PULSE_SUM)" || bad "P443 Pulse 夹具绿了但缺结果行"
|
|
25226
|
+
assert_has "$TMP/p443-pulse.log" "停止后 watchdog.pid 不存在" "P443 停止清理释放巡检锁"
|
|
25227
|
+
assert_has "$TMP/p443-pulse.log" "停止前登记的循环子进程全部消失" "P443 停止清理回收循环自己的子进程"
|
|
25228
|
+
else
|
|
25229
|
+
bad "P443 Pulse 夹具红(rc=$P443_PULSE_RC)"; tail -16 "$TMP/p443-pulse.log" | sed 's/^/ /'
|
|
25230
|
+
fi
|
|
25231
|
+
fi
|
|
25232
|
+
P443_REAL="$SKILL_DIR/tests/remind-recovery-real.sh"
|
|
25233
|
+
if [ "$FAST" = "1" ]; then
|
|
25234
|
+
cond_skip "P443 真实 Pi 停止恢复" "FAST:私有真实 Pi/tmux + controlled model 另跑"
|
|
25235
|
+
elif [ ! -f "$P443_REAL" ]; then
|
|
25236
|
+
bad "P443 缺 tests/remind-recovery-real.sh"
|
|
25237
|
+
elif ! command -v "${P442_PI:-pi}" >/dev/null 2>&1; then
|
|
25238
|
+
cond_skip "P443 真实 Pi 停止恢复" "找不到真实 Pi(可设 P442_PI)"
|
|
25239
|
+
else
|
|
25240
|
+
P442_EVIDENCE="$TMP/p443" P442_KEEP=1 bash "$P443_REAL" >"$TMP/p443-recovery-real.log" 2>&1; P443_REAL_RC=$?
|
|
25241
|
+
if [ "$P443_REAL_RC" -eq 0 ]; then
|
|
25242
|
+
assert_has "$TMP/p443-recovery-real.log" "remind-tool-real: passed=3 failed=0" "P443 真实 Pi:无通用提示恢复、忙碌不重复启动、切换/分叉立即撤下工具"
|
|
25243
|
+
else
|
|
25244
|
+
bad "P443 真实 Pi 恢复夹具红(rc=$P443_REAL_RC)"; tail -16 "$TMP/p443-recovery-real.log" | sed 's/^/ /'
|
|
25245
|
+
fi
|
|
25246
|
+
fi
|
|
25247
|
+
|
|
25248
|
+
# ---------------------------------------------------------------- 69. Reminder 受控对抗验收(P444)
|
|
25249
|
+
section "69 · 提醒:真实事件顺序 / 重放 / 进程死亡原子边界(P444)"
|
|
25250
|
+
P444_FAULTS="$SKILL_DIR/tests/remind-adversarial-faults.sh"
|
|
25251
|
+
if [ ! -f "$P444_FAULTS" ]; then
|
|
25252
|
+
bad "P444 缺 tests/remind-adversarial-faults.sh"
|
|
25253
|
+
else
|
|
25254
|
+
bash "$P444_FAULTS" >"$TMP/p444-faults.log" 2>&1; P444_FAULTS_RC=$?
|
|
25255
|
+
if [ "$P444_FAULTS_RC" -eq 0 ]; then
|
|
25256
|
+
assert_has "$TMP/p444-faults.log" "fault-matrix: passed=12 failed=0" "P444 intent/观察在 apply、rename、file/fsync 与目录 fsync 前后死亡均有恢复证据"
|
|
25257
|
+
assert_has "$TMP/p444-faults.log" "remind-adversarial-faults: isolation=ok" "P444 原子故障矩阵不碰主项目"
|
|
25258
|
+
else
|
|
25259
|
+
bad "P444 原子故障矩阵红(rc=$P444_FAULTS_RC)"; tail -18 "$TMP/p444-faults.log" | sed 's/^/ /'
|
|
25260
|
+
fi
|
|
25261
|
+
fi
|
|
25262
|
+
P444_REAL="$SKILL_DIR/tests/remind-adversarial-real.sh"
|
|
25263
|
+
if [ "$FAST" = "1" ]; then
|
|
25264
|
+
cond_skip "P444 真实 Pi 受控对抗" "FAST:真实事件、60 秒未知边界与进程死亡另跑(不记为通过)"
|
|
25265
|
+
elif [ ! -f "$P444_REAL" ]; then
|
|
25266
|
+
bad "P444 缺 tests/remind-adversarial-real.sh"
|
|
25267
|
+
else
|
|
25268
|
+
P442_EVIDENCE="$TMP/p444" P442_KEEP=1 bash "$P444_REAL" >"$TMP/p444-real.log" 2>&1; P444_REAL_RC=$?
|
|
25269
|
+
if [ "$P444_REAL_RC" -eq 0 ]; then
|
|
25270
|
+
assert_has "$TMP/p444-real.log" "remind-tool-real: passed=7 failed=0" "P444 真实 Pi:A+B、G1/G2、外部会话、调用/事件死亡与迟到重放全绿"
|
|
25271
|
+
assert_has "$TMP/p444-real.log" "remind-adversarial-real: isolation=ok" "P444 真实 Pi 受控对抗不碰主项目"
|
|
25272
|
+
else
|
|
25273
|
+
bad "P444 真实 Pi 受控对抗红(rc=$P444_REAL_RC)"; tail -20 "$TMP/p444-real.log" | sed 's/^/ /'
|
|
25274
|
+
fi
|
|
25275
|
+
fi
|
|
25276
|
+
|
|
24827
25277
|
section "14d · P70 本套自述对账(段落账目 + 无误判)"
|
|
24828
25278
|
P70_S_STARTS="$(grep -c '^== #[0-9][0-9]* ' "$SG_LOG" 2>/dev/null || true)"
|
|
24829
25279
|
P70_S_SHAPED="$(grep -cE '^== #[0-9]+ .+ == [0-9]{4}-[0-9]{2}-[0-9]{2}T[^ ]+$' "$SG_LOG" 2>/dev/null || true)"
|