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.
Files changed (91) hide show
  1. package/README.md +6 -6
  2. package/package.json +1 -1
  3. package/skills/teamsmith/CHANGELOG.md +35 -0
  4. package/skills/teamsmith/SKILL.md +43 -30
  5. package/skills/teamsmith/extension/team-bg.ts +5 -3
  6. package/skills/teamsmith/extension/team-inbox-watch.ts +14 -3
  7. package/skills/teamsmith/extension/team-notify.ts +20 -13
  8. package/skills/teamsmith/extension/team-remind.ts +189 -0
  9. package/skills/teamsmith/extension/team-reply.ts +4 -7
  10. package/skills/teamsmith/references/config.md +11 -12
  11. package/skills/teamsmith/references/migration.md +101 -0
  12. package/skills/teamsmith/references/openspec.md +43 -27
  13. package/skills/teamsmith/references/protocol.md +26 -15
  14. package/skills/teamsmith/references/reminders.md +153 -161
  15. package/skills/teamsmith/references/troubleshooting.md +12 -7
  16. package/skills/teamsmith/references/workflows.md +84 -31
  17. package/skills/teamsmith/scripts/lib/cmd-agents.sh +10 -4
  18. package/skills/teamsmith/scripts/lib/cmd-project.sh +88 -6
  19. package/skills/teamsmith/scripts/lib/cmd-remind.sh +88 -2
  20. package/skills/teamsmith/scripts/lib/cmd-review.sh +61 -35
  21. package/skills/teamsmith/scripts/lib/cmd-watch.sh +48 -11
  22. package/skills/teamsmith/scripts/lib/common.sh +83 -13
  23. package/skills/teamsmith/scripts/panel/README.md +35 -33
  24. package/skills/teamsmith/scripts/panel/panel.js +217 -199
  25. package/skills/teamsmith/scripts/panel/src/App.tsx +221 -66
  26. package/skills/teamsmith/scripts/panel/src/data.ts +71 -15
  27. package/skills/teamsmith/scripts/panel/src/layout.ts +159 -310
  28. package/skills/teamsmith/scripts/panel/src/main.tsx +83 -21
  29. package/skills/teamsmith/scripts/panel/src/project-settings.ts +46 -0
  30. package/skills/teamsmith/scripts/panel/src/strings/en.ts +71 -205
  31. package/skills/teamsmith/scripts/panel/src/strings/index.ts +3 -5
  32. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +72 -204
  33. package/skills/teamsmith/scripts/panel/src/types.ts +23 -4
  34. package/skills/teamsmith/scripts/remind-capability.mjs +261 -0
  35. package/skills/teamsmith/scripts/remind-store.mjs +55 -24
  36. package/skills/teamsmith/scripts/remind-tick.mjs +5 -2
  37. package/skills/teamsmith/scripts/reply-capture.mjs +8 -9
  38. package/skills/teamsmith/scripts/state-authority.mjs +72 -6
  39. package/skills/teamsmith/scripts/strings/commands.tsv +1 -1
  40. package/skills/teamsmith/scripts/team +1 -0
  41. package/skills/teamsmith/templates/AGENTS.section.md.tmpl +18 -8
  42. package/skills/teamsmith/templates/DECISIONS.md.tmpl +2 -2
  43. package/skills/teamsmith/templates/OWNERSHIP.md.tmpl +3 -3
  44. package/skills/teamsmith/templates/PROTOCOL.md.tmpl +19 -14
  45. package/skills/teamsmith/templates/memory-seed.md.tmpl +2 -2
  46. package/skills/teamsmith/templates/pm-prompt.md.tmpl +41 -25
  47. package/skills/teamsmith/templates/report.md.tmpl +33 -0
  48. package/skills/teamsmith/tests/bg-ledger-harness.mjs +217 -33
  49. package/skills/teamsmith/tests/bg-ledger.sh +24 -10
  50. package/skills/teamsmith/tests/checkout-shape-probe.sh +7 -6
  51. package/skills/teamsmith/tests/fixtures/remind-adversarial-delay.ts +27 -0
  52. package/skills/teamsmith/tests/fixtures/remind-tool-provider.ts +65 -0
  53. package/skills/teamsmith/tests/help-surface.sh +78 -12
  54. package/skills/teamsmith/tests/install-shape.sh +7 -7
  55. package/skills/teamsmith/tests/isolation-ledger.sh +6 -2
  56. package/skills/teamsmith/tests/key-replies-ui.sh +64 -5
  57. package/skills/teamsmith/tests/key-replies.sh +307 -106
  58. package/skills/teamsmith/tests/lib/main-team-fingerprint.sh +2 -0
  59. package/skills/teamsmith/tests/lib/model-routing-boundary.sh +255 -90
  60. package/skills/teamsmith/tests/lib/model-routing-expansion.sh +181 -61
  61. package/skills/teamsmith/tests/lib/model-routing-roles.sh +125 -67
  62. package/skills/teamsmith/tests/lib/reply-fixture.sh +14 -9
  63. package/skills/teamsmith/tests/lib/routes-pages.sh +243 -0
  64. package/skills/teamsmith/tests/lib/tmp-root.sh +1 -1
  65. package/skills/teamsmith/tests/loop-inventory.tsv +3 -0
  66. package/skills/teamsmith/tests/panel-b2.sh +91 -31
  67. package/skills/teamsmith/tests/panel-b3-stub.sh +9 -2
  68. package/skills/teamsmith/tests/panel-p21.sh +607 -1162
  69. package/skills/teamsmith/tests/panel-strings.mjs +21 -113
  70. package/skills/teamsmith/tests/remind-adversarial-faults.mjs +190 -0
  71. package/skills/teamsmith/tests/remind-adversarial-faults.sh +78 -0
  72. package/skills/teamsmith/tests/remind-adversarial-real.sh +28 -0
  73. package/skills/teamsmith/tests/remind-cli.sh +108 -3
  74. package/skills/teamsmith/tests/remind-delivery-node.mjs +13 -0
  75. package/skills/teamsmith/tests/remind-delivery.sh +123 -35
  76. package/skills/teamsmith/tests/remind-lifecycle.sh +197 -0
  77. package/skills/teamsmith/tests/remind-pulse.sh +199 -0
  78. package/skills/teamsmith/tests/remind-recovery-real.sh +5 -0
  79. package/skills/teamsmith/tests/remind-recovery-unit.sh +118 -0
  80. package/skills/teamsmith/tests/remind-tool-node.mjs +159 -0
  81. package/skills/teamsmith/tests/remind-tool-real.mjs +801 -0
  82. package/skills/teamsmith/tests/remind-tool-real.sh +180 -0
  83. package/skills/teamsmith/tests/reply-capture-real.mjs +93 -2
  84. package/skills/teamsmith/tests/routes.sh +213 -293
  85. package/skills/teamsmith/tests/section-paths.tsv +19 -17
  86. package/skills/teamsmith/tests/smoke.sh +583 -133
  87. package/skills/teamsmith/tests/state-authority.sh +152 -8
  88. package/skills/teamsmith/tests/task-model-routing.sh +57 -26
  89. package/skills/teamsmith/tests/tmp-hygiene.sh +1 -1
  90. package/skills/teamsmith-init/SKILL.md +5 -5
  91. package/skills/teamsmith/tests/fixtures/delivery-truth-real/__pycache__/judge-second.cpython-313.pyc +0 -0
@@ -1,6 +1,139 @@
1
1
  #!/usr/bin/env bash
2
2
  # F3: run real shell argv against files that turn an innocent-looking token into
3
3
  # an owned selector. Only the routing front door's private repo/HOME/socket is used.
4
+
5
+ # Short resplit samples branch before the full fixture's git/process preparation.
6
+ # Keep the PM guard and metadata publisher/loader real, with a private legal policy.
7
+ routing_argv_setup() {
8
+ mkdir -p "$STATE" || return 1
9
+ printf "TEAM_TASK_MODELS='routine=vendor/routine'\nTEAM_PM_MODEL='vendor/pm:high'\n" > "$CONFIG" || return 1
10
+ printf 'identity decoy\n' > "$REPO/--model=wrong:low" || return 1
11
+ export TEAM_ROOT="$REPO" TEAM_MAIN_ROOT="$REPO" TEAM_STATE_DIR="$STATE" TEAM_CONFIG="$CONFIG" TEAM_SKILL_DIR="$SKILL"
12
+ TEAM_CLI=team; TEAM_PM_WINDOW=pm
13
+ source "$SKILL/scripts/lib/common.sh" || return 1
14
+ source "$SKILL/scripts/lib/cmd-agents.sh" || return 1
15
+ source "$CONFIG" || return 1
16
+ TEAM_EXTRA_PI_ARGS=''; TEAM_PM_CMD=''; TEAM_PM_SESSION_ID=''
17
+ TEAM_PM_EXTRA_PI_ARGS=''; TEAM_PM_RESUME_ARGS=''
18
+ cd "$REPO" || return 1
19
+ }
20
+
21
+ routing_worker_argv_probe() {
22
+ local rendered rc=0
23
+ TEAM_EXTRA_PI_ARGS=' --label "two words" "--mod*" "{safe,words}" "~/routing-note"'
24
+ TEAM_EXTRA_PI_ARGS+=" 'one\\two'"
25
+ rendered="$(team_pi_args vendor/deep/model:high)" || rc=$?
26
+ check worker-argv-renderer eq "$rc" 0
27
+ [ "$rc" = 0 ] || return 1
28
+ bash --noprofile --norc -c "printf '%s\\0' $rendered" > "$TMP/worker-argv.nul"; rc=$?
29
+ check worker-argv-shell eq "$rc" 0
30
+ [ "$rc" = 0 ] || return 1
31
+ check worker-expansion-literal-argv:extra python3 - "$TMP/worker-argv.nul" <<'PY'
32
+ import json, pathlib, sys
33
+ raw = pathlib.Path(sys.argv[1]).read_bytes()
34
+ assert raw.endswith(b'\0'), raw
35
+ argv = raw[:-1].decode().split('\0')
36
+ print('ARGV worker-extra ' + json.dumps(argv))
37
+ assert argv[:4] == ['--provider', 'vendor', '--model', 'deep/model:high'], argv
38
+ assert argv.count('--provider') == argv.count('--model') == 1, argv
39
+ assert argv[argv.index('--label'):] == ['--label', 'two words', '--mod*', '{safe,words}', '~/routing-note', r'one\two'], argv
40
+ assert '--model=wrong:low' not in argv, argv
41
+ PY
42
+ }
43
+
44
+ routing_pm_argv_probes() {
45
+ local field rendered rc metadata_before
46
+ TEAM_PM_FRESH_LAUNCH=0
47
+ TEAM_PM_RESUME_ARGS=" --session-id 'fixture-literal-session'"
48
+ team_pm_metadata_publish fixture-argv || { check pm-argv-metadata-publish eq 1 0; return 1; }
49
+ team_pm_metadata_load || { check pm-argv-metadata-load eq 1 0; return 1; }
50
+ metadata_before="$(sha "$STATE/pm-launch.env")"
51
+ for field in extra resume; do
52
+ if [ "$field" = extra ]; then
53
+ TEAM_PM_FRESH_LAUNCH=1; TEAM_PM_RESUME_ARGS=''
54
+ TEAM_PM_EXTRA_PI_ARGS=' --label "two words" "--mod*" "{safe,words}" "~/routing-note"'
55
+ TEAM_PM_EXTRA_PI_ARGS+=" 'one\\two'"
56
+ else
57
+ TEAM_PM_FRESH_LAUNCH=0; TEAM_PM_EXTRA_PI_ARGS=''
58
+ TEAM_PM_RESUME_ARGS=" --session-id 'fixture-literal-session'"
59
+ fi
60
+ rc=0; rendered="$(team_pm_pi_args)" || rc=$?
61
+ check "pm-argv-renderer:$field" eq "$rc" 0
62
+ [ "$rc" = 0 ] || continue
63
+ bash --noprofile --norc -c "printf '%s\\0' $rendered" > "$TMP/pm-argv-$field.nul"; rc=$?
64
+ check "pm-argv-shell:$field" eq "$rc" 0
65
+ [ "$rc" = 0 ] || continue
66
+ local name=pm-expansion-literal-argv:extra
67
+ [ "$field" != resume ] || name=pm-resume-literal-argv:builtin
68
+ check "$name" python3 - "$TMP/pm-argv-$field.nul" "$field" <<'PY'
69
+ import json, pathlib, sys
70
+ raw = pathlib.Path(sys.argv[1]).read_bytes()
71
+ assert raw.endswith(b'\0'), raw
72
+ argv = raw[:-1].decode().split('\0')
73
+ print('ARGV pm-' + sys.argv[2] + ' ' + json.dumps(argv))
74
+ assert argv[:4] == ['--provider', 'vendor', '--model', 'pm:high'], argv
75
+ assert argv.count('--provider') == argv.count('--model') == 1, argv
76
+ assert not any(x in argv for x in ['-c', '--continue', '--model=wrong:low']), argv
77
+ if sys.argv[2] == 'extra':
78
+ assert argv[argv.index('--label'):] == ['--label', 'two words', '--mod*', '{safe,words}', '~/routing-note', r'one\two'], argv
79
+ assert '--session-id' not in argv, argv
80
+ else:
81
+ assert argv.count('--session-id') == 1 and argv[argv.index('--session-id'):] == ['--session-id', 'fixture-literal-session'], argv
82
+ PY
83
+ done
84
+ check pm-argv-metadata-unchanged eq "$(sha "$STATE/pm-launch.env")" "$metadata_before"
85
+ }
86
+
87
+ routing_expansion_faults() {
88
+ faults=(
89
+ 'provider-glob|--pro*' 'model-glob|--mod*' 'sid-glob|--sess*'
90
+ 'continue-glob|--cont*' 'resume-glob|--resu*' 'short-class|-?[r]ong'
91
+ 'session-file-glob|*.jsonl' 'provider-class|--[p]rovider*'
92
+ 'mixed-quote|"--mod"*' 'brace|{--model=wrong:low,--no-tools}'
93
+ 'tilde|~/routing-note' 'doublequote-escape|"two\\\\words"'
94
+ )
95
+ # Match an actual short selector too (the first pattern deliberately matches
96
+ # nothing but still has unprovable pathname semantics).
97
+ faults+=('short-glob|-m*')
98
+ }
99
+ routing_resume_expansion_faults() {
100
+ faults=('--mod*' '--pro*' '--sess*' '--cont*' '--resu*' '{--model=wrong:low,--continue}' '--session-id ~')
101
+ }
102
+ routing_parameter_expansion_probes() {
103
+ local fragment tag seat kind body observed rc literal
104
+ local -a faults
105
+ routing_expansion_faults
106
+ for fragment in "${faults[@]}"; do
107
+ tag="${fragment%%|*}"; fragment="${fragment#*|}"
108
+ for seat in worker pm; do
109
+ kind=launch; body='--provider {provider} --model {model} --session-id {session_id}'
110
+ if [ "$seat" = pm ]; then kind=pm; body='--provider {provider} --model {model} {resume_args} {prompt}'; fi
111
+ routing_parameter_template "parameter-expansion-refused:$seat-template:$tag" "$kind" "fixture-pi $body $fragment" fresh 1 ''
112
+ done
113
+ rc=0; observed="$(TEAM_EXTRA_PI_ARGS=''; TEAM_PM_EXTRA_PI_ARGS=''; TEAM_PM_RESUME_ARGS=''; team_identity_extra_guard "$fragment" 2>&1)" || rc=$?
114
+ printf 'OBSERVE parameter-expansion-refused:shared-extra:%s rc=%s value=%s\n' "$tag" "$rc" "$observed"
115
+ check "parameter-expansion-refused:shared-extra:$tag" eq "$rc" 1
116
+ done
117
+ routing_resume_expansion_faults
118
+ for fragment in "${faults[@]}"; do
119
+ rc=0; observed="$(TEAM_EXTRA_PI_ARGS=''; TEAM_PM_EXTRA_PI_ARGS=''; TEAM_PM_RESUME_ARGS="$fragment"; team_pm_resume_args_guard 2>&1)" || rc=$?
120
+ printf 'OBSERVE parameter-resume-expansion-refused:%s rc=%s value=%s\n' "$fragment" "$rc" "$observed"
121
+ check "parameter-resume-expansion-refused:$fragment" eq "$rc" 1
122
+ done
123
+ literal='--label "two words" "--mod*" "{safe,words}" "~/routing-note"'
124
+ literal+=" 'one\\two'"
125
+ for seat in worker pm; do
126
+ kind=launch; body='--provider {provider} --model {model} --session-id {session_id}'; local bound='provider model session_id'
127
+ if [ "$seat" = pm ]; then kind=pm; body='--provider {provider} --model {model} {resume_args} {prompt}'; bound='provider model'; fi
128
+ routing_parameter_template "parameter-expansion-literal:$seat-template" "$kind" "fixture-pi $body $literal" fresh 0 "$bound"
129
+ done
130
+ rc=0; observed="$(TEAM_EXTRA_PI_ARGS=''; TEAM_PM_EXTRA_PI_ARGS=''; TEAM_PM_RESUME_ARGS=''; team_identity_extra_guard "$literal" && printf '%s\n' "${TEAM_LITERAL_TOKENS[@]}")" || rc=$?
131
+ check parameter-expansion-literal:shared-extra eq "$rc" 0
132
+ check parameter-expansion-literal-values eq "$observed" $'--label\ntwo words\n--mod*\n{safe,words}\n~/routing-note\none\\two'
133
+ rc=0; observed="$(TEAM_EXTRA_PI_ARGS=''; TEAM_PM_EXTRA_PI_ARGS=''; TEAM_PM_RESUME_ARGS=" --session-id 'fixture-literal-session'"; team_pm_resume_args_guard && printf '%s\n' "${TEAM_LITERAL_TOKENS[@]}")" || rc=$?
134
+ check parameter-resume-literal eq "$rc" 0
135
+ check parameter-resume-literal-value eq "$observed" $'--session-id\nfixture-literal-session'
136
+ }
4
137
  routing_expansion_probes() { # worker|pm
5
138
  local seat="$1" field tag fragment mode before sid='' previous_map
6
139
  previous_map="$(team_config_file_value "$CONFIG" TEAM_TASK_MODELS)"
@@ -20,52 +153,7 @@ routing_expansion_probes() { # worker|pm
20
153
  [ "$seat" != worker ] || root="$REPO/.worktrees/dev"
21
154
  local -a decoys=('--provider=other' '--model=wrong:low' '--session-id=other-history' '--continue' '--resume=other-history' '-mwrong' 'other-history.jsonl')
22
155
  for fragment in "${decoys[@]}"; do printf 'identity decoy\n' > "$root/$fragment"; done
23
- local -a faults=(
24
- 'provider-glob|--pro*' 'model-glob|--mod*' 'sid-glob|--sess*'
25
- 'continue-glob|--cont*' 'resume-glob|--resu*' 'short-class|-?[r]ong'
26
- 'session-file-glob|*.jsonl' 'provider-class|--[p]rovider*'
27
- 'mixed-quote|"--mod"*' 'brace|{--model=wrong:low,--no-tools}'
28
- 'tilde|~/routing-note' 'doublequote-escape|"two\\\\words"'
29
- )
30
- # Match an actual short selector too (the first pattern deliberately matches
31
- # nothing but still has unprovable pathname semantics).
32
- faults+=('short-glob|-m*')
33
- for field in template extra; do
34
- for fragment in "${faults[@]}"; do
35
- tag="${fragment%%|*}"; fragment="${fragment#*|}"
36
- if [ "$seat" = worker ]; then
37
- run config set TEAM_EXTRA_PI_ARGS '' --yes
38
- custom="$TMP/recording-pi --provider {provider} --model {model} --session-id {session_id}"
39
- if [ "$field" = template ]; then
40
- run config set TEAM_AGENT_CMD "$custom $fragment" --yes
41
- else
42
- run config set TEAM_AGENT_CMD '' --yes
43
- run config set TEAM_EXTRA_PI_ARGS " $fragment" --yes
44
- fi
45
- else
46
- run config set TEAM_PM_EXTRA_PI_ARGS '' --yes
47
- custom="$TMP/recording-pi --provider {provider} --model {model} {resume_args} {prompt}"
48
- if [ "$field" = template ]; then
49
- run config set TEAM_PM_CMD "$custom $fragment" --yes
50
- else
51
- run config set TEAM_PM_CMD '' --yes
52
- run config set TEAM_PM_EXTRA_PI_ARGS " $fragment" --yes
53
- fi
54
- fi
55
- check "$seat-expansion-config:$field:$tag" eq "$RC" 0
56
- for mode in preview launch; do
57
- before="$(routing_observable_snapshot)"
58
- if [ "$seat" = worker ]; then
59
- if [ "$mode" = preview ]; then run dispatch dev T1 docs/team/tasks/T1-fixture.md --print; else run dispatch dev T1 docs/team/tasks/T1-fixture.md; fi
60
- else
61
- if [ "$mode" = preview ]; then run up --fresh-pm --print; else run up --fresh-pm; fi
62
- fi
63
- check "$seat-expansion-refused:$field:$tag:$mode" eq "$RC" 1
64
- check "$seat-expansion-pure:$field:$tag:$mode" eq "$(routing_observable_snapshot)" "$before"
65
- if [ "$seat" = worker ]; then stop_fixture_seat dev; else stop_fixture_seat pm; fi
66
- done
67
- done
68
- done
156
+ local -a faults; routing_expansion_faults
69
157
  # Quoted wildcard/brace/tilde text is literal data, not an expansion. Builtin
70
158
  # PM must consume the lexer's tokens, not re-split the original quoted text.
71
159
  local literal='--label "two words" "--mod*" "{safe,words}" "~/routing-note"'
@@ -104,6 +192,40 @@ else:
104
192
  PY
105
193
  if [ "$seat" = worker ]; then stop_fixture_seat dev; else stop_fixture_seat pm; fi
106
194
  done
195
+ for field in template extra; do
196
+ for fragment in "${faults[@]}"; do
197
+ tag="${fragment%%|*}"; fragment="${fragment#*|}"
198
+ [ "$tag" = model-glob ] || continue
199
+ if [ "$seat" = worker ]; then
200
+ run config set TEAM_EXTRA_PI_ARGS '' --yes
201
+ custom="$TMP/recording-pi --provider {provider} --model {model} --session-id {session_id}"
202
+ if [ "$field" = template ]; then
203
+ run config set TEAM_AGENT_CMD "$custom $fragment" --yes
204
+ else
205
+ run config set TEAM_AGENT_CMD '' --yes
206
+ run config set TEAM_EXTRA_PI_ARGS " $fragment" --yes
207
+ fi
208
+ else
209
+ run config set TEAM_PM_EXTRA_PI_ARGS '' --yes
210
+ custom="$TMP/recording-pi --provider {provider} --model {model} {resume_args} {prompt}"
211
+ if [ "$field" = template ]; then
212
+ run config set TEAM_PM_CMD "$custom $fragment" --yes
213
+ else
214
+ run config set TEAM_PM_CMD '' --yes
215
+ run config set TEAM_PM_EXTRA_PI_ARGS " $fragment" --yes
216
+ fi
217
+ fi
218
+ check "$seat-expansion-config:$field:$tag" eq "$RC" 0
219
+ [ "$RC" = 0 ] || return 1
220
+ if [ "$seat" = worker ]; then
221
+ routing_refusal_observe "$seat-expansion" "$seat-expansion" "$field:$tag" launch 'identity argv cannot contain unquoted pathname/tilde expansion' dispatch dev T1 docs/team/tasks/T1-fixture.md
222
+ stop_fixture_seat dev
223
+ else
224
+ routing_refusal_observe "$seat-expansion" "$seat-expansion" "$field:$tag" launch 'identity argv cannot contain unquoted pathname/tilde expansion' up --fresh-pm
225
+ stop_fixture_seat pm
226
+ fi
227
+ done
228
+ done
107
229
  if [ "$seat" = pm ]; then routing_pm_resume_expansion_probes; fi
108
230
  for fragment in "${decoys[@]}"; do rm -- "$root/$fragment"; done
109
231
  if [ "$seat" = worker ]; then
@@ -121,21 +243,6 @@ routing_pm_resume_expansion_probes() {
121
243
  if [ "$field" = builtin ]; then run config set TEAM_PM_CMD '' --yes
122
244
  else run config set TEAM_PM_CMD "$TMP/recording-pi --provider {provider} --model {model} {resume_args} {prompt}" --yes; fi
123
245
  run config set TEAM_PM_EXTRA_PI_ARGS '' --yes
124
- for fragment in '--mod*' '--pro*' '--sess*' '--cont*' '--resu*' '{--model=wrong:low,--continue}' '--session-id ~'; do
125
- run config set TEAM_PM_RESUME_ARGS " $fragment" --yes
126
- check "pm-resume-expansion-config:$field:$fragment" eq "$RC" 0
127
- # Controlled same-key metadata makes this a real continuation test, not a
128
- # fresh-pm call that discards resume_args before it can reach the shell.
129
- (TEAM_PM_FRESH_LAUNCH=0; TEAM_PM_RESUME_ARGS=" $fragment"; team_pm_metadata_publish fixture-resume-expansion)
130
- check "pm-resume-expansion-record:$field:$fragment" eq "$?" 0
131
- for mode in preview launch; do
132
- before="$(routing_observable_snapshot)"
133
- if [ "$mode" = preview ]; then run up --print; else run up; fi
134
- check "pm-resume-expansion-refused:$field:$fragment:$mode" eq "$RC" 1
135
- check "pm-resume-expansion-pure:$field:$fragment:$mode" eq "$(routing_observable_snapshot)" "$before"
136
- stop_fixture_seat pm
137
- done
138
- done
139
246
  fragment=" --session-id 'fixture-literal-session'"
140
247
  run config set TEAM_PM_RESUME_ARGS "$fragment" --yes
141
248
  check "pm-resume-literal-config:$field" eq "$RC" 0
@@ -149,6 +256,19 @@ routing_pm_resume_expansion_probes() {
149
256
  check "pm-resume-literal-launch:$field" eq "$RC" 0
150
257
  check "pm-resume-literal-argv:$field" python3 -c 'import json,sys; a=json.loads(open(sys.argv[1]).readlines()[-1]); assert a.count("--session-id")==1 and a[a.index("--session-id")+1]=="fixture-literal-session",a; assert a[a.index("--model")+1]=="pm:high",a' "$TMP/argv-jsonl"
151
258
  stop_fixture_seat pm
259
+ local -a faults; routing_resume_expansion_faults
260
+ for fragment in "${faults[@]}"; do
261
+ [ "$fragment" = '--mod*' ] || continue
262
+ run config set TEAM_PM_RESUME_ARGS " $fragment" --yes
263
+ check "pm-resume-expansion-config:$field:$fragment" eq "$RC" 0
264
+ [ "$RC" = 0 ] || return 1
265
+ # Real same-key continuation metadata; fresh would discard this input.
266
+ (TEAM_PM_MODEL=vendor/pm:high; TEAM_PM_FRESH_LAUNCH=0; TEAM_PM_SESSION_ID=''; TEAM_PM_RESUME_ARGS=" $fragment"; team_pm_metadata_publish fixture-resume-expansion)
267
+ check "pm-resume-expansion-record:$field:$fragment" eq "$?" 0
268
+ check "pm-resume-expansion-trusted:$field:$fragment" routing_pm_continuation_ready " $fragment"
269
+ routing_refusal_observe pm-resume-expansion pm-resume-expansion "$field:$fragment" launch 'identity argv cannot contain unquoted pathname/tilde expansion' up
270
+ stop_fixture_seat pm
271
+ done
152
272
  done
153
273
  run config set TEAM_PM_RESUME_ARGS '' --yes
154
274
  cp -p "$saved" "$STATE/pm-launch.env"
@@ -1,29 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
  # F5: isolated parameter-role controls; no runtime Pi/parser dependency.
3
3
  # Uses only the routing front door's real recorder/repo/HOME/private socket.
4
- routing_role_probes() { # worker|pm
5
- local seat="$1" oldmap tag body mode before sid='' field tool good
6
- oldmap="$(team_config_file_value "$CONFIG" TEAM_TASK_MODELS)"
7
- run config set-task-model routine vendor/routine
8
- check "$seat-role-category-ready" eq "$RC" 0
9
- if [ "$seat" = worker ]; then
10
- run config set TEAM_AGENT_CMD '' --yes
11
- run config set TEAM_EXTRA_PI_ARGS '' --yes
12
- run dispatch dev T1 docs/team/tasks/T1-fixture.md --model vendor/deep/model:high --fresh
13
- check worker-role-assignment-ready eq "$RC" 0
14
- team_assignment_load dev; sid="${TEAM_ASSIGN[sid]}"; stop_fixture_seat dev
15
- good='--provider {provider} --model {model} --session-id {session_id}'
16
- else
17
- routing_fixture_tmux new-window -d -t routing-fixture -n role-anchor 'sleep 1200'
18
- stop_fixture_seat pm
19
- run config set TEAM_PM_EXTRA_PI_ARGS '' --yes
20
- # config set 的前门拒收 `-` 开头的值:按既有夹具惯例用前导空格写入(读取侧 team_trim)。
21
- run config set TEAM_PM_RESUME_ARGS ' --continue' --yes
22
- (TEAM_PM_MODEL=vendor/pm:high; TEAM_PM_RESUME_ARGS=--continue; TEAM_PM_FRESH_LAUNCH=0; team_pm_metadata_publish fixture-role-control)
23
- cp -p "$STATE/pm-launch.env" "$TMP/role-pm-trusted"
24
- good='--provider {provider} --model {model} {resume_args}'
25
- fi
26
- local -a faults=()
4
+ routing_role_faults() { # caller supplies seat/good and a local faults array
5
+ faults=()
27
6
  # Both emitted tool scalar roles, every identity selector and argv-list seam.
28
7
  # Unknown arity is NOT guessed, including unknown equals/quoted option forms.
29
8
  for tool in '--skill' '-e' '--unknown' '--unknown=value' '"--unknown"'; do
@@ -49,44 +28,66 @@ routing_role_probes() { # worker|pm
49
28
  faults+=('extra-consumes-model|--provider {provider} {extra_args} --model {model} --session-id {session_id}'
50
29
  'extra-unknown-before-model|--provider {provider} {extra_args} --model {model} --session-id {session_id}')
51
30
  fi
52
- for body in "${faults[@]}"; do
53
- tag="${body%%|*}"; body="${body#*|}"
54
- if [ "$seat" = worker ]; then
55
- run config set TEAM_AGENT_CMD "$TMP/recording-pi $body {prompt}" --yes
56
- case "$tag" in extra-consumes-*) run config set TEAM_EXTRA_PI_ARGS ' --skill' --yes ;; extra-unknown-*) run config set TEAM_EXTRA_PI_ARGS ' --unknown harmless' --yes ;; esac
57
- else
58
- run config set TEAM_PM_CMD "$TMP/recording-pi $body {prompt}" --yes
31
+ }
32
+ routing_resume_role_faults() {
33
+ faults=('--skill --continue' '-e -c' '--unknown --continue' '--unknown harmless --continue' '--skill --session-id fixture-sid' '-e -s fixture-sid' '--unknown --session-id fixture-sid')
34
+ }
35
+ routing_parameter_role_probes() {
36
+ local seat kind good tool body tag extra resume field bound bad observed rc mode
37
+ local -a faults
38
+ for seat in worker pm; do
39
+ kind=launch; good='--provider {provider} --model {model} --session-id {session_id}'; bound='provider model session_id'
40
+ if [ "$seat" = pm ]; then kind=pm; good='--provider {provider} --model {model} {resume_args}'; bound='provider model'; fi
41
+ routing_role_faults
42
+ for body in "${faults[@]}"; do
43
+ tag="${body%%|*}"; body="${body#*|}"; extra=''; resume=''
44
+ [ "$seat" != pm ] || resume=' --continue'
59
45
  case "$tag" in
60
- extra-consumes-*) run config set TEAM_PM_EXTRA_PI_ARGS ' --skill' --yes ;;
61
- extra-unknown-*) run config set TEAM_PM_EXTRA_PI_ARGS ' --unknown harmless' --yes ;;
62
- resume-unknown-*) run config set TEAM_PM_RESUME_ARGS ' --continue --unknown' --yes ;;
46
+ extra-consumes-*) extra=' --skill' ;;
47
+ extra-unknown-*) extra=' --unknown harmless' ;;
48
+ resume-unknown-*) resume=' --continue --unknown' ;;
63
49
  esac
64
- (TEAM_PM_MODEL=vendor/pm:high; TEAM_PM_RESUME_ARGS="$(team_config_file_value "$CONFIG" TEAM_PM_RESUME_ARGS)"; TEAM_PM_FRESH_LAUNCH=0; team_pm_metadata_publish fixture-role-control)
65
- cp -p "$STATE/pm-launch.env" "$TMP/role-pm-trusted"
66
- fi
67
- check "$seat-role-template-config:$tag" eq "$RC" 0
68
- for mode in preview launch fresh-preview fresh-launch; do
69
- [ "$seat" != pm ] || cp -p "$TMP/role-pm-trusted" "$STATE/pm-launch.env"
70
- before="$(routing_observable_snapshot)"
71
- check "role-capture:$seat:$tag:$mode:before" routing_binding_capture "$seat-role" "$tag" "$mode" before
72
- if [ "$seat" = worker ]; then
73
- case "$mode" in
74
- preview) run dispatch dev T1 docs/team/tasks/T1-fixture.md --print ;;
75
- launch) run dispatch dev T1 docs/team/tasks/T1-fixture.md ;;
76
- fresh-preview) run dispatch dev T1 docs/team/tasks/T1-fixture.md --fresh --print ;;
77
- fresh-launch) run dispatch dev T1 docs/team/tasks/T1-fixture.md --fresh ;;
78
- esac
79
- else
80
- case "$mode" in preview) run up --print ;; launch) run up ;; fresh-preview) run up --fresh-pm --print ;; fresh-launch) run up --fresh-pm ;; esac
81
- fi
82
- check "$seat-role-refused:$tag:$mode" eq "$RC" 1
83
- check "$seat-role-pure:$tag:$mode" eq "$(routing_observable_snapshot)" "$before"
84
- check "role-capture:$seat:$tag:$mode:after" routing_binding_capture "$seat-role" "$tag" "$mode" after
85
- if [ "$seat" = worker ]; then stop_fixture_seat dev; else stop_fixture_seat pm; fi
50
+ routing_parameter_template "parameter-role-refused:$seat:$tag" "$kind" "fixture-pi $body {prompt}" continued 1 '' "$extra" "$resume"
86
51
  done
87
- if [ "$seat" = worker ]; then run config set TEAM_EXTRA_PI_ARGS '' --yes
88
- else run config set TEAM_PM_EXTRA_PI_ARGS '' --yes; run config set TEAM_PM_RESUME_ARGS ' --continue' --yes; fi
52
+ for field in tool-prefix unknown-suffix extra-prefix; do
53
+ body="--skill harmless -e 'literal extension' $good --unknown 'two words'"; extra=''
54
+ [ "$field" != unknown-suffix ] || body="$good --unknown 'two words'"
55
+ if [ "$field" = extra-prefix ]; then body="{extra_args} $body"; extra=' --skill harmless -e "literal extension" --no-tools'; fi
56
+ for mode in fresh continued; do
57
+ routing_parameter_template "parameter-role-legal:$seat:$field:$mode" "$kind" "fixture-pi $body {prompt}" "$mode" 0 "$bound" "$extra" ' --continue'
58
+ done
59
+ done
60
+ done
61
+ routing_resume_role_faults
62
+ for bad in "${faults[@]}"; do
63
+ rc=0; observed="$(TEAM_EXTRA_PI_ARGS=''; TEAM_PM_EXTRA_PI_ARGS=''; TEAM_PM_RESUME_ARGS="$bad"; team_pm_resume_args_guard 2>&1)" || rc=$?
64
+ printf 'OBSERVE parameter-resume-role-refused:%s rc=%s value=%s\n' "$bad" "$rc" "$observed"
65
+ check "parameter-resume-role-refused:$bad" eq "$rc" 1
89
66
  done
67
+ }
68
+ routing_role_probes() { # worker|pm
69
+ local seat="$1" oldmap tag body mode before sid='' field tool good
70
+ oldmap="$(team_config_file_value "$CONFIG" TEAM_TASK_MODELS)"
71
+ run config set-task-model routine vendor/routine
72
+ check "$seat-role-category-ready" eq "$RC" 0
73
+ if [ "$seat" = worker ]; then
74
+ run config set TEAM_AGENT_CMD '' --yes
75
+ run config set TEAM_EXTRA_PI_ARGS '' --yes
76
+ run dispatch dev T1 docs/team/tasks/T1-fixture.md --model vendor/deep/model:high --fresh
77
+ check worker-role-assignment-ready eq "$RC" 0
78
+ team_assignment_load dev; sid="${TEAM_ASSIGN[sid]}"; stop_fixture_seat dev
79
+ good='--provider {provider} --model {model} --session-id {session_id}'
80
+ else
81
+ routing_fixture_tmux new-window -d -t routing-fixture -n role-anchor 'sleep 1200'
82
+ stop_fixture_seat pm
83
+ run config set TEAM_PM_EXTRA_PI_ARGS '' --yes
84
+ # config set 的前门拒收 `-` 开头的值:按既有夹具惯例用前导空格写入(读取侧 team_trim)。
85
+ run config set TEAM_PM_RESUME_ARGS ' --continue' --yes
86
+ (TEAM_PM_MODEL=vendor/pm:high; TEAM_PM_RESUME_ARGS=--continue; TEAM_PM_FRESH_LAUNCH=0; team_pm_metadata_publish fixture-role-control)
87
+ cp -p "$STATE/pm-launch.env" "$TMP/role-pm-trusted"
88
+ good='--provider {provider} --model {model} {resume_args}'
89
+ fi
90
+ local -a faults; routing_role_faults
90
91
  if [ "$seat" = pm ]; then
91
92
  (TEAM_PM_MODEL=vendor/pm:high; TEAM_PM_RESUME_ARGS=--continue; TEAM_PM_FRESH_LAUNCH=0; team_pm_metadata_publish fixture-role-control)
92
93
  cp -p "$STATE/pm-launch.env" "$TMP/role-pm-trusted"
@@ -128,27 +129,84 @@ routing_role_probes() { # worker|pm
128
129
  done
129
130
  if [ "$seat" = worker ]; then run config set TEAM_EXTRA_PI_ARGS '' --yes; else run config set TEAM_PM_EXTRA_PI_ARGS '' --yes; fi
130
131
  done
132
+ local diagnostic
133
+ for body in "${faults[@]}"; do
134
+ tag="${body%%|*}"; body="${body#*|}"
135
+ case "$seat:$tag" in
136
+ worker:model:--skill|pm:provider:--skill) diagnostic='identity argv role unprovable: --skill needs one literal tool-data value' ;;
137
+ worker:extra-unknown-before-model) diagnostic='identity argv role unprovable: unknown arity --unknown before protected --model' ;;
138
+ pm:extra-unknown-before-resume) diagnostic='identity argv role unprovable: unknown arity --unknown before protected {resume_args}' ;;
139
+ *) continue ;;
140
+ esac
141
+ if [ "$seat" = worker ]; then
142
+ run config set TEAM_EXTRA_PI_ARGS '' --yes
143
+ run config set TEAM_AGENT_CMD "$TMP/recording-pi $body {prompt}" --yes
144
+ check "$seat-role-template-config:$tag" eq "$RC" 0
145
+ [ "$RC" = 0 ] || return 1
146
+ if [ "$tag" = extra-unknown-before-model ]; then
147
+ run config set TEAM_EXTRA_PI_ARGS ' --unknown harmless' --yes
148
+ check "$seat-role-extra-config:$tag" eq "$RC" 0
149
+ [ "$RC" = 0 ] || return 1
150
+ routing_refusal_observe worker-role worker-role "$tag" fresh-launch "$diagnostic" dispatch dev T1 docs/team/tasks/T1-fixture.md --fresh
151
+ else
152
+ routing_refusal_observe worker-role worker-role "$tag" launch "$diagnostic" dispatch dev T1 docs/team/tasks/T1-fixture.md
153
+ fi
154
+ stop_fixture_seat dev
155
+ run config set TEAM_EXTRA_PI_ARGS '' --yes
156
+ else
157
+ run config set TEAM_PM_EXTRA_PI_ARGS '' --yes
158
+ run config set TEAM_PM_RESUME_ARGS ' --continue' --yes
159
+ run config set TEAM_PM_CMD "$TMP/recording-pi $body {prompt}" --yes
160
+ check "$seat-role-template-config:$tag" eq "$RC" 0
161
+ [ "$RC" = 0 ] || return 1
162
+ if [ "$tag" = extra-unknown-before-resume ]; then
163
+ run config set TEAM_PM_EXTRA_PI_ARGS ' --unknown harmless' --yes
164
+ check "$seat-role-extra-config:$tag" eq "$RC" 0
165
+ [ "$RC" = 0 ] || return 1
166
+ (TEAM_PM_MODEL=vendor/pm:high; TEAM_PM_RESUME_ARGS=--continue; TEAM_PM_FRESH_LAUNCH=0; TEAM_PM_SESSION_ID=''; team_pm_metadata_publish fixture-role-control)
167
+ check "$seat-role-record:$tag" eq "$?" 0
168
+ check "$seat-role-trusted:$tag" routing_pm_continuation_ready ' --continue'
169
+ routing_refusal_observe pm-role pm-role "$tag" launch "$diagnostic" up
170
+ else
171
+ routing_refusal_observe pm-role pm-role "$tag" fresh-launch "$diagnostic" up --fresh-pm
172
+ fi
173
+ stop_fixture_seat pm
174
+ run config set TEAM_PM_EXTRA_PI_ARGS '' --yes
175
+ run config set TEAM_PM_RESUME_ARGS ' --continue' --yes
176
+ fi
177
+ done
131
178
  if [ "$seat" = worker ]; then run config set TEAM_AGENT_CMD '' --yes
132
179
  else run config set TEAM_PM_CMD '' --yes; run config set TEAM_PM_RESUME_ARGS '' --yes; fi
133
180
  run config set TEAM_TASK_MODELS "$oldmap" --yes
134
181
  check "$seat-role-policy-restored" eq "$RC" 0
135
182
  }
136
183
  routing_resume_role_probes() {
137
- local field bad mode before
184
+ local field bad mode diagnostic
185
+ local -a faults
138
186
  for field in builtin custom; do
139
187
  if [ "$field" = builtin ]; then run config set TEAM_PM_CMD '' --yes
140
188
  else run config set TEAM_PM_CMD "$TMP/recording-pi --provider {provider} --model {model} {resume_args} {prompt}" --yes; fi
141
- for bad in '--skill --continue' '-e -c' '--unknown --continue' '--unknown harmless --continue' '--skill --session-id fixture-sid' '-e -s fixture-sid' '--unknown --session-id fixture-sid'; do
189
+ check "pm-role-resume-template:$field" eq "$RC" 0
190
+ [ "$RC" = 0 ] || return 1
191
+ routing_resume_role_faults
192
+ for bad in "${faults[@]}"; do
193
+ case "$field:$bad" in
194
+ 'builtin:--skill --continue') mode=launch; diagnostic='identity argv role unprovable: --skill needs one literal tool-data value' ;;
195
+ 'custom:-e -c') mode=fresh-launch; diagnostic='identity argv role unprovable: -e needs one literal tool-data value' ;;
196
+ *) continue ;;
197
+ esac
142
198
  run config set TEAM_PM_RESUME_ARGS " $bad" --yes
143
199
  check "pm-role-resume-config:$field:$bad" eq "$RC" 0
144
- (TEAM_PM_MODEL=vendor/pm:high; TEAM_PM_FRESH_LAUNCH=0; TEAM_PM_RESUME_ARGS="$bad"; team_pm_metadata_publish fixture-role-resume)
145
- for mode in preview launch fresh-preview fresh-launch; do
146
- before="$(routing_observable_snapshot)"
147
- case "$mode" in preview) run up --print ;; launch) run up ;; fresh-preview) run up --fresh-pm --print ;; fresh-launch) run up --fresh-pm ;; esac
148
- check "pm-role-resume-refused:$field:$bad:$mode" eq "$RC" 1
149
- check "pm-role-resume-pure:$field:$bad:$mode" eq "$(routing_observable_snapshot)" "$before"
150
- stop_fixture_seat pm
151
- done
200
+ [ "$RC" = 0 ] || return 1
201
+ (TEAM_PM_MODEL=vendor/pm:high; TEAM_PM_FRESH_LAUNCH=0; TEAM_PM_SESSION_ID=''; TEAM_PM_RESUME_ARGS="$bad"; team_pm_metadata_publish fixture-role-resume)
202
+ check "pm-role-resume-record:$field:$bad" eq "$?" 0
203
+ check "pm-role-resume-trusted:$field:$bad" routing_pm_continuation_ready "$bad"
204
+ if [ "$mode" = launch ]; then
205
+ routing_refusal_observe pm-role-resume pm-role-resume "$field:$bad" "$mode" "$diagnostic" up
206
+ else
207
+ routing_refusal_observe pm-role-resume pm-role-resume "$field:$bad" "$mode" "$diagnostic" up --fresh-pm
208
+ fi
209
+ stop_fixture_seat pm
152
210
  done
153
211
  done
154
212
  run config set TEAM_PM_RESUME_ARGS '' --yes
@@ -5,8 +5,8 @@
5
5
  # 内容:断言器与计数、隔离守卫、夹具仓库(真 `team init` + 真 `team reply post`)、记录 argv 的
6
6
  # CLI shim、私有 tmux server 的起停与稳定帧等待、面板的起/捕/按键。夹具本体只写各自的场景。
7
7
  #
8
- # 调用方契约:先 source 本文件(它会 source tmp-root / tmux-iso / pty-wait),再定组;变量
9
- # sock/sess/tmp/ROOT/state/current 由 fixture_up 维护;TEAM_REPLY_EVIDENCE 指到仓外证据包。
8
+ # 调用方契约:先 source 本文件,再定组。fixture_prepare 写好项目、回复和 argv 记录入口;
9
+ # 真终端组用 fixture_up,另起私有会话。TEAM_REPLY_EVIDENCE 指到仓外证据包。
10
10
  set -uo pipefail
11
11
  SELF_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
12
12
  SKILL_DIR="$(cd -P "$SELF_DIR/.." && pwd)"
@@ -55,7 +55,7 @@ ev_note() { [ -n "$KR_EV" ] || return 0; mkdir -p "$KR_EV" 2>/dev/null || true;
55
55
  ev_save() { [ -n "$KR_EV" ] || return 0; [ -f "$1" ] || return 0; mkdir -p "$KR_EV" 2>/dev/null || true; cp "$1" "$KR_EV/$2" 2>/dev/null || true; }
56
56
 
57
57
  clean_env=(env -u TEAM_ROOT -u TEAM_MAIN_ROOT -u TEAM_PROJECT -u TEAM_SESSION -u TEAM_STATE_DIR
58
- -u TEAM_DOCS_ABS -u TEAM_DOCS_DIR -u TEAM_SKILL_DIR -u TEAM_ALLOW_FOREIGN_IDENTITY -u TEAM_JS_BIN)
58
+ -u TEAM_CONFIG_FILE -u TEAM_DOCS_ABS -u TEAM_DOCS_DIR -u TEAM_SKILL_DIR -u TEAM_ALLOW_FOREIGN_IDENTITY -u TEAM_JS_BIN)
59
59
 
60
60
  kr_cli() { local r="$1"; shift; ( cd "$r" && "${clean_env[@]}" bash "$team_cli" --root "$r" "$@" ); }
61
61
  # `--print` 的时钟在行中间:用固定形状把它掩掉再比对(除时钟逐字节一致)。
@@ -73,18 +73,15 @@ kr_mask_print() { sed -E 's/[0-9]{2}:[0-9]{2}:[0-9]{2}/HH:MM:SS/g'; }
73
73
  krg_guard_baseline
74
74
 
75
75
  # ---------------------------------------------------------------- fixture project + store
76
- fixture_up() { # <name> <replies…> 每份回复是 `<label>:<title>:<bodyfile>`
76
+ fixture_prepare() { # <name> <replies…> 每份回复是 `<label>|<title>|<bodyfile>`
77
77
  current="$1"
78
78
  ROOT="$tmp/$1/root"
79
79
  shift
80
80
  mkdir -p "$ROOT/docs/team" "$ROOT/.pi/team/state"
81
81
  ( cd "$ROOT" && git init -q -b main && git config user.email kr@teamsmith && git config user.name kr \
82
82
  && echo "# $1" > README.md && git add -A && git commit -qm init ) >/dev/null 2>&1
83
- tmux_iso_require "key-replies-panel" "重起私有 server 前的 kill-server" --tmpdir "${TMUX_TMPDIR:-}" --sock-name "$sock"
84
- tmux -L "$sock" kill-server 2>/dev/null || true
85
- rm -f "${TMUX_TMPDIR:-/tmp}/tmux-$(id -u)/$sock" 2>/dev/null || true
86
- ( cd "$ROOT" && bash "$team_cli" init --session "$sess" --agents "dev verify" --vcs local --gates "true" \
87
- --docs docs/team --task-models 'routine=deepseek/deepseek-flash' --pm-model 'deepseek/deepseek-flash' ) \
83
+ kr_cli "$ROOT" init --session "$sess" --agents "dev verify" --vcs local --gates "true" \
84
+ --docs docs/team --task-models 'routine=deepseek/deepseek-flash' --pm-model 'deepseek/deepseek-flash' \
88
85
  >"$tmp/$current/init.log" 2>&1 || { printf 'key-replies-panel: team init 失败\n' >&2; tail -3 "$tmp/$current/init.log" >&2; exit 3; }
89
86
  state="$ROOT/.pi/team/state"
90
87
  mkdir -p "$ROOT/docs/team" "$state"
@@ -96,6 +93,14 @@ fixture_up() { # <name> <replies…> 每份回复是 `<label>:<title>:<bodyfile
96
93
  done
97
94
  # 记录 argv 的 CLI shim:真 CLI 前面加一行日志(`__panel-data --block …` 的逐条调用可查)
98
95
  kr_shim_set_slow -
96
+ }
97
+
98
+ fixture_up() { # <name> <replies…>,供真终端组使用
99
+ tmux_iso_require "key-replies-panel" "重起私有 server 前的 kill-server" --tmpdir "${TMUX_TMPDIR:-}" --sock-name "$sock"
100
+ # 第一组启动前没有私有 server,kill-server 会返回非零。
101
+ tmux -L "$sock" kill-server 2>/dev/null || true
102
+ rm -f "${TMUX_TMPDIR:-/tmp}/tmux-$(id -u)/$sock" 2>/dev/null || true
103
+ fixture_prepare "$@"
99
104
  tmux -L "$sock" new-session -d -s "$sess" -x 120 -y 32 -n bootstrap -c "$ROOT" 'sleep 900'
100
105
  tmux -L "$sock" set -g window-size manual 2>/dev/null || true
101
106
  }