teamsmith 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +16 -8
  2. package/package.json +1 -1
  3. package/skills/teamsmith/CHANGELOG.md +55 -0
  4. package/skills/teamsmith/SKILL.md +18 -7
  5. package/skills/teamsmith/extension/team-bg.ts +47 -11
  6. package/skills/teamsmith/extension/team-notify.ts +143 -4
  7. package/skills/teamsmith/references/agent-adapters.md +7 -7
  8. package/skills/teamsmith/references/config.md +29 -15
  9. package/skills/teamsmith/references/migration.md +38 -2
  10. package/skills/teamsmith/references/openspec.md +23 -9
  11. package/skills/teamsmith/references/protocol.md +81 -13
  12. package/skills/teamsmith/references/workflows.md +31 -19
  13. package/skills/teamsmith/scripts/lib/cmd-agents.sh +210 -70
  14. package/skills/teamsmith/scripts/lib/cmd-bootstrap.sh +70 -9
  15. package/skills/teamsmith/scripts/lib/cmd-config.sh +222 -70
  16. package/skills/teamsmith/scripts/lib/cmd-death.sh +2 -15
  17. package/skills/teamsmith/scripts/lib/cmd-docs.sh +6 -3
  18. package/skills/teamsmith/scripts/lib/cmd-project.sh +134 -17
  19. package/skills/teamsmith/scripts/lib/cmd-reply.sh +96 -0
  20. package/skills/teamsmith/scripts/lib/cmd-review.sh +13 -10
  21. package/skills/teamsmith/scripts/lib/cmd-status.sh +42 -13
  22. package/skills/teamsmith/scripts/lib/cmd-watch.sh +75 -13
  23. package/skills/teamsmith/scripts/lib/common.sh +797 -71
  24. package/skills/teamsmith/scripts/monitor.mjs +34 -3
  25. package/skills/teamsmith/scripts/panel/README.md +22 -11
  26. package/skills/teamsmith/scripts/panel/panel.js +217 -215
  27. package/skills/teamsmith/scripts/panel/src/App.tsx +421 -164
  28. package/skills/teamsmith/scripts/panel/src/data.ts +84 -4
  29. package/skills/teamsmith/scripts/panel/src/layout.ts +502 -91
  30. package/skills/teamsmith/scripts/panel/src/main.tsx +97 -12
  31. package/skills/teamsmith/scripts/panel/src/settings.ts +1 -1
  32. package/skills/teamsmith/scripts/panel/src/strings/en.ts +56 -21
  33. package/skills/teamsmith/scripts/panel/src/strings/zh.ts +56 -21
  34. package/skills/teamsmith/scripts/panel/src/types.ts +178 -16
  35. package/skills/teamsmith/scripts/replies.mjs +893 -0
  36. package/skills/teamsmith/scripts/team +1 -0
  37. package/skills/teamsmith/templates/AGENTS.section.md.tmpl +15 -2
  38. package/skills/teamsmith/templates/BOARD.md.tmpl +2 -2
  39. package/skills/teamsmith/templates/OWNERSHIP.md.tmpl +7 -3
  40. package/skills/teamsmith/templates/PROTOCOL.md.tmpl +17 -0
  41. package/skills/teamsmith/templates/config.sh.tmpl +10 -5
  42. package/skills/teamsmith/templates/memory-seed.md.tmpl +3 -0
  43. package/skills/teamsmith/templates/pm-prompt.md.tmpl +20 -1
  44. package/skills/teamsmith/templates/report.md.tmpl +12 -0
  45. package/skills/teamsmith/templates/task.md.tmpl +4 -0
  46. package/skills/teamsmith/tests/bg-ledger-harness.mjs +682 -0
  47. package/skills/teamsmith/tests/bg-ledger.sh +307 -0
  48. package/skills/teamsmith/tests/checkout-shape-probe.sh +287 -58
  49. package/skills/teamsmith/tests/config-cli.sh +162 -288
  50. package/skills/teamsmith/tests/death-cause.sh +5 -2
  51. package/skills/teamsmith/tests/install-shape.sh +4 -2
  52. package/skills/teamsmith/tests/key-replies-pty.sh +375 -0
  53. package/skills/teamsmith/tests/key-replies-ui.sh +332 -0
  54. package/skills/teamsmith/tests/key-replies.sh +1075 -0
  55. package/skills/teamsmith/tests/ledger-ban.sh +5 -5
  56. package/skills/teamsmith/tests/ledger-claim.sh +247 -0
  57. package/skills/teamsmith/tests/lib/checkout-shape.sh +66 -14
  58. package/skills/teamsmith/tests/lib/model-policy.sh +26 -0
  59. package/skills/teamsmith/tests/lib/model-routing-boundary.sh +420 -0
  60. package/skills/teamsmith/tests/lib/model-routing-expansion.sh +155 -0
  61. package/skills/teamsmith/tests/lib/model-routing-flips.py +136 -0
  62. package/skills/teamsmith/tests/lib/model-routing-roles.sh +250 -0
  63. package/skills/teamsmith/tests/lib/proc-io.sh +103 -0
  64. package/skills/teamsmith/tests/lib/reply-fixture.sh +372 -0
  65. package/skills/teamsmith/tests/lib/tmux-iso.sh +8 -0
  66. package/skills/teamsmith/tests/panel-b2.sh +1 -1
  67. package/skills/teamsmith/tests/panel-b3-stub.sh +27 -0
  68. package/skills/teamsmith/tests/panel-b3.sh +14 -10
  69. package/skills/teamsmith/tests/panel-choices.sh +74 -61
  70. package/skills/teamsmith/tests/panel-cpu.sh +1 -1
  71. package/skills/teamsmith/tests/panel-p21.sh +311 -190
  72. package/skills/teamsmith/tests/perf.sh +1 -1
  73. package/skills/teamsmith/tests/pm-box-real.sh +1 -1
  74. package/skills/teamsmith/tests/pulse-nudge-key.sh +1 -1
  75. package/skills/teamsmith/tests/routes.sh +43 -22
  76. package/skills/teamsmith/tests/section-budgets.tsv +9 -5
  77. package/skills/teamsmith/tests/section-paths.tsv +26 -16
  78. package/skills/teamsmith/tests/section-select.sh +99 -16
  79. package/skills/teamsmith/tests/smoke.sh +930 -216
  80. package/skills/teamsmith/tests/snapshots/zh-dark-120-detail.txt +2 -2
  81. package/skills/teamsmith/tests/snapshots/zh-dark-120-p4.txt +2 -2
  82. package/skills/teamsmith/tests/snapshots/zh-dark-120.txt +9 -9
  83. package/skills/teamsmith/tests/snapshots/zh-dark-160-p4.txt +2 -2
  84. package/skills/teamsmith/tests/snapshots/zh-dark-160.txt +9 -9
  85. package/skills/teamsmith/tests/snapshots/zh-dark-59-detail.txt +1 -1
  86. package/skills/teamsmith/tests/snapshots/zh-dark-59-p4.txt +1 -1
  87. package/skills/teamsmith/tests/snapshots/zh-dark-59.txt +5 -5
  88. package/skills/teamsmith/tests/snapshots/zh-dark-99-p4.txt +2 -2
  89. package/skills/teamsmith/tests/snapshots/zh-dark-99.txt +5 -5
  90. package/skills/teamsmith/tests/snapshots/zh-light-120-detail.txt +2 -2
  91. package/skills/teamsmith/tests/snapshots/zh-light-120-p4.txt +2 -2
  92. package/skills/teamsmith/tests/snapshots/zh-light-120.txt +9 -9
  93. package/skills/teamsmith/tests/snapshots/zh-light-160-p4.txt +2 -2
  94. package/skills/teamsmith/tests/snapshots/zh-light-160.txt +9 -9
  95. package/skills/teamsmith/tests/snapshots/zh-light-59-detail.txt +1 -1
  96. package/skills/teamsmith/tests/snapshots/zh-light-59-p4.txt +1 -1
  97. package/skills/teamsmith/tests/snapshots/zh-light-59.txt +5 -5
  98. package/skills/teamsmith/tests/snapshots/zh-light-99-p4.txt +2 -2
  99. package/skills/teamsmith/tests/snapshots/zh-light-99.txt +5 -5
  100. package/skills/teamsmith/tests/task-header-model.sh +2 -1
  101. package/skills/teamsmith/tests/task-model-routing.sh +1014 -0
  102. package/skills/teamsmith-init/SKILL.md +38 -38
  103. package/skills/teamsmith-init/references/bootstrap.md +6 -4
  104. package/skills/teamsmith-init/templates/bootstrap-prompt.md.tmpl +9 -5
@@ -33,7 +33,17 @@ import { clockOf } from './format.js'
33
33
  import { dispWidth } from './width.js'
34
34
  import type { Palette } from './theme.js'
35
35
  import type { Segment } from './types.js'
36
- import { BLOCK_NAMES, MACHINE_BLOCKS, cleanIdentityEnv, createPanelCache, findTeamCli, loadPanelData, panelDirOf, runTick } from './data.js'
36
+ import {
37
+ BLOCK_NAMES,
38
+ MACHINE_BLOCKS,
39
+ cleanIdentityEnv,
40
+ createPanelCache,
41
+ findTeamCli,
42
+ loadPanelData,
43
+ panelDirOf,
44
+ runTick,
45
+ type BlockName,
46
+ } from './data.js'
37
47
  import type { DataOptions, DataResult, PanelCache } from './data.js'
38
48
  import { normalizeNewlines, parseSendResult, mapReceipt, DRAFT_FILE } from './compose.js'
39
49
  import type { Receipt } from './compose.js'
@@ -99,12 +109,35 @@ function argOf(name: string): string | undefined {
99
109
 
100
110
  const has = (name: string): boolean => process.argv.includes(`--${name}`)
101
111
 
112
+ /**
113
+ * Write every byte to a raw fd. Node puts fd 1 (and 2) in non-blocking mode when it is a pipe, so a
114
+ * single `writeSync` of a whole frame may return a **short count** — the tail is then simply lost.
115
+ * Measured on this pinned stack: a 160-column `--snapshot` piped through `sed` dropped its last 462
116
+ * bytes roughly one run in five (a frame cut mid-character). A full-write loop is the fix; `EAGAIN`
117
+ * means the pipe's buffer is full, so wait a millisecond and continue instead of dropping the tail.
118
+ */
119
+ function writeAll(fd: number, text: string): void {
120
+ const buf = Buffer.from(text, 'utf8')
121
+ let off = 0
122
+ let spins = 0
123
+ while (off < buf.length) {
124
+ try {
125
+ off += writeSync(fd, buf, off, buf.length - off)
126
+ spins = 0
127
+ } catch (e) {
128
+ if ((e as NodeJS.ErrnoException)?.code !== 'EAGAIN') throw e
129
+ if (++spins > 10000) throw e // ~10s of a full pipe: fail loudly instead of spinning forever
130
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 1)
131
+ }
132
+ }
133
+ }
134
+
102
135
  /** Machine-readable output must not be lost to an async pipe write. */
103
136
  function out(text: string): void {
104
- writeSync(1, text)
137
+ writeAll(1, text)
105
138
  }
106
139
  function fail(message: string): never {
107
- writeSync(2, `✗ ${message}\n`)
140
+ writeAll(2, `✗ ${message}\n`)
108
141
  process.exit(1)
109
142
  }
110
143
 
@@ -135,6 +168,15 @@ const pageArg = argOf('page')
135
168
  const langArg = argOf('lang')
136
169
  /** `--detail <ID>`: render the read-only detail view in a snapshot (the overlay's sibling exit). */
137
170
  const detailArg = argOf('detail') || ''
171
+ /**
172
+ * Page 5's snapshot/demand knobs (pulse-key-replies). `--reply-no N` opens that number's viewer,
173
+ * `--reply-before N` pins the list cursor and `--reply-focus N` pins the focused slot, so the
174
+ * snapshot matrix can render summary/list/empty/corrupt/continuation/long-body deterministically.
175
+ * They are read options only: nothing here writes to the store.
176
+ */
177
+ const replyNoArg = Number(argOf('reply-no') ?? 0) || 0
178
+ const replyBeforeArg = Number(argOf('reply-before') ?? 0) || 0
179
+ const replyFocusArg = Number(argOf('reply-focus') ?? 0) || 0
138
180
 
139
181
  if (has('version')) {
140
182
  out(`teamsmith panel ${PANEL_VERSION} · ink ${PIN_INK} · react ${PIN_REACT}\nbuilt by: ${BUILD_CMD}\n`)
@@ -144,7 +186,8 @@ if (has('help')) {
144
186
  out(
145
187
  'usage: panel.js [--root DIR] [--state-dir DIR] [--print|--json|--once|--headless|--snapshot|--palette]\n' +
146
188
  ' [--width N] [--height N] [--activity|--no-activity] [--events N] [--refresh N]\n' +
147
- ' [--no-pulse] [--theme dark|light] [--page 1|2|3|4] [--lang zh|en] [--overlay] [--detail ID] [--version]\n',
189
+ ' [--no-pulse] [--theme dark|light] [--page 1|2|3|4|5] [--lang zh|en] [--overlay] [--detail ID]\n' +
190
+ ' [--reply-no N] [--reply-before N] [--reply-focus N] [--version]\n',
148
191
  )
149
192
  process.exit(0)
150
193
  }
@@ -242,6 +285,7 @@ function frameOf(res: DataResult, activity: boolean, scroll?: number): FrameInpu
242
285
  activityBlocks: activity ? res.activity ?? [] : [],
243
286
  blocks: res.blocks ?? {},
244
287
  degraded: res.degraded ?? [],
288
+ replyBodyFailed: Boolean(res.errors?.reply_body),
245
289
  width: widthArg || stdoutColumns || 100,
246
290
  height: heightArg || stdoutRows || 0,
247
291
  activity,
@@ -290,14 +334,30 @@ async function main(): Promise<void> {
290
334
  const settings = readSettings(confFile)
291
335
  const themeName = themeArg === 'dark' || themeArg === 'light' ? themeArg : resolveTheme(settings.theme)
292
336
  const lang = langArg === 'en' || langArg === 'zh' ? langArg : settings.lang
293
- const page = pageArg === '1' || pageArg === '2' || pageArg === '3' || pageArg === '4' ? (Number(pageArg) as PageId) : settings.defaultPage
294
- const res = await loadPanelData({ root, teamCli, activity: rawActivityOn, events, detailId: detailArg || null })
337
+ const page =
338
+ pageArg === '1' || pageArg === '2' || pageArg === '3' || pageArg === '4' || pageArg === '5'
339
+ ? (Number(pageArg) as PageId)
340
+ : settings.defaultPage
341
+ // Page 5's demand reads are handed to the assembly exactly as the App hands them over: the list
342
+ // only for the cursor in view, the body only while the viewer is open.
343
+ const res = await loadPanelData({
344
+ root,
345
+ teamCli,
346
+ activity: rawActivityOn,
347
+ events,
348
+ detailId: detailArg || null,
349
+ replyListOpen: page === 5 && !replyNoArg,
350
+ replyBefore: replyBeforeArg || null,
351
+ replyNo: page === 5 && replyNoArg ? replyNoArg : null,
352
+ })
295
353
  const frame = frameOrFail(res, rawActivityOn)
296
354
  const view: ViewState = {
297
355
  ...defaultView(lang, page),
298
356
  tui: true,
299
357
  mouseOn: settings.mouse,
300
358
  density: settings.density,
359
+ replyFocus: replyFocusArg || null,
360
+ replyBody: replyNoArg || null,
301
361
  overlay: wantOverlay,
302
362
  detail: detailArg || null,
303
363
  // P123: the snapshot is the TUI's own render path, so it reads the fold keys (the machine exits
@@ -335,7 +395,7 @@ async function main(): Promise<void> {
335
395
  // `--page` is honoured here too (P123's machine-frame identity fixture renders page 4); absent,
336
396
  // the machine frame stays the overview it always was.
337
397
  const machinePage: PageId =
338
- pageArg === '1' || pageArg === '2' || pageArg === '3' || pageArg === '4' ? (Number(pageArg) as PageId) : 1
398
+ pageArg === '1' || pageArg === '2' || pageArg === '3' || pageArg === '4' || pageArg === '5' ? (Number(pageArg) as PageId) : 1
339
399
  if (once || wantPrint) {
340
400
  // One frame; `--once` then keeps today's tick semantics, `--print` (the observer) never ticks.
341
401
  const frame = frameOrFail(await loadPanelData({ root, teamCli, activity: rawActivityOn, events, blocks: MACHINE_BLOCKS }), rawActivityOn, MACHINE_BLOCKS)
@@ -539,14 +599,18 @@ async function main(): Promise<void> {
539
599
  return { code: res.rc, line }
540
600
  }
541
601
 
542
- /** One `team config set-agent-model <seat> <model|->` invocation (P22/B4). */
543
- async function setSeatModel(
544
- seat: string,
602
+ /**
603
+ * One `team config set-task-model <category> <model>` invocation (P232): a category row edits one
604
+ * mapping entry through the owning command — the console never composes or writes the pair list
605
+ * itself. Same dry-run/CAS/actor panel contract as `setSetting`.
606
+ */
607
+ async function setTaskModel(
608
+ category: string,
545
609
  model: string,
546
610
  o: { dryRun?: boolean; fingerprint?: string | null },
547
611
  ): Promise<{ code: number; line: string }> {
548
612
  if (!teamCli) return { code: 127, line: s.noTeamCli }
549
- const args = [teamCli, '--root', root, 'config', 'set-agent-model', seat, model || '-', '--actor', 'panel']
613
+ const args = [teamCli, '--root', root, 'config', 'set-task-model', category, model, '--actor', 'panel']
550
614
  if (o.dryRun) args.push('--dry-run')
551
615
  else args.push('--yes')
552
616
  if (o.fingerprint) args.push('--fingerprint', o.fingerprint)
@@ -769,9 +833,30 @@ async function main(): Promise<void> {
769
833
  if (cached?.id === nextId && nextFile && cached.file === nextFile) return
770
834
  void cache.refresh({ force: true, only: ['detail'] }).then(adopt)
771
835
  },
836
+ /**
837
+ * Page 5's demand reads: record the cursor/number as cache options and force exactly the block
838
+ * that changed. An unchanged pair (a re-render, the same page) rebuilds nothing — the effect in
839
+ * the App may run freely. Clearing both drops the blocks from the wanted set, so a parked page
840
+ * spawns no list/body child at all.
841
+ */
842
+ setReply: ({ list, before, no }: { list: boolean; before: number | null; no: number | null }) => {
843
+ const nextBefore = before ?? null
844
+ const nextNo = no ?? null
845
+ const listChanged = Boolean(opts.replyListOpen) !== Boolean(list) || (opts.replyBefore ?? null) !== nextBefore
846
+ const noChanged = (opts.replyNo ?? null) !== nextNo
847
+ if (!listChanged && !noChanged) return
848
+ opts.replyListOpen = Boolean(list)
849
+ opts.replyBefore = nextBefore
850
+ opts.replyNo = nextNo
851
+ const only: BlockName[] = []
852
+ if (listChanged && list) only.push('reply_list')
853
+ if (noChanged && nextNo != null) only.push('reply_body')
854
+ if (!only.length) return
855
+ void cache.refresh({ force: true, only }).then(adopt)
856
+ },
772
857
  collapse,
773
858
  setSetting,
774
- setSeatModel,
859
+ setTaskModel,
775
860
  /**
776
861
  * The path kind's existence mark (M55): resolved against the project root (`~` honoured), the
777
862
  * rule from the command's own note. `not-exec` is only reachable for `exec` — a directory is
@@ -52,7 +52,7 @@ function boolOf(value: string): boolean | null {
52
52
 
53
53
  function pageOf(value: string): PageId | null {
54
54
  const v = value.trim()
55
- if (v === '1' || v === '2' || v === '3' || v === '4') return Number(v) as PageId
55
+ if (v === '1' || v === '2' || v === '3' || v === '4' || v === '5') return Number(v) as PageId
56
56
  return null
57
57
  }
58
58
 
@@ -76,6 +76,12 @@ export const en = {
76
76
  pageWork: 'work',
77
77
  pageMessages: 'messages & logs',
78
78
  pageBoard: 'board',
79
+ pageReplies: 'key replies',
80
+ pageOverviewShort: 'overview',
81
+ pageWorkShort: 'work',
82
+ pageMessagesShort: 'msgs',
83
+ pageBoardShort: 'board',
84
+ pageRepliesShort: 'replies',
79
85
  pageTab: ' {name} ',
80
86
  pageTabActive: '▸{name}◂',
81
87
 
@@ -175,7 +181,7 @@ export const en = {
175
181
  group_branch: 'Branch & forge',
176
182
  group_policy: 'Permissions & dependencies',
177
183
  group_roster: 'Roster, models & adapters',
178
- 'group_seat-model': 'Per-seat models',
184
+ 'group_task-model': 'Task categories & PM model',
179
185
  group_workflow: 'Workflow & gates',
180
186
  group_delivery: 'Capacity & delivery',
181
187
  group_panel: 'Pulse & panel',
@@ -184,7 +190,8 @@ export const en = {
184
190
  group_session: 'Live sessions',
185
191
  group_meeting: 'Cross-project meetings',
186
192
  settingsGroupUngrouped: 'Ungrouped',
187
- settingsGroupSeats: 'Seats',
193
+ settingsGroupCategories: 'Task categories (future policy)',
194
+ settingsGroupAssignments: 'Committed assignments (read-only)',
188
195
  settingsBadgeApply: 'apply',
189
196
  settingsBadgeRestart: 'restart',
190
197
  settingsBadgeRefuse: 'read-only',
@@ -205,8 +212,22 @@ export const en = {
205
212
  settingConflict: '! the contract changed under the editor (fingerprint mismatch) — nothing written; reloaded',
206
213
  settingWriteError: '✗ write failed (file unchanged): {line}',
207
214
  settingsRefusedRoute: 'read-only key: edit .pi/team/config.sh by hand',
208
- settingsSeatHint: 'seat model: team config set-agent-model {seat} <model>',
209
- settingsPairlistHint: 'seat models: team config set-agent-model <seat> <model|-> — this row’s editor is the seats block (Enter moves there; the pair list is never composed here)',
215
+ settingsCategoryHint: 'category {category}: team config set-task-model {category} <model> — new tasks only; a committed task keeps its model/SID (this row never composes the map)',
216
+ settingsCategoryRow: 'category {category}',
217
+ settingsCategoryModel: 'model {model}',
218
+ settingsCategoryBadge: 'new tasks',
219
+ settingsCategoryPickerTitle: 'Pick the model for category {category}',
220
+ settingsCategoryPickerHint: '↑/↓ choose · Enter writes that value now · only free text opens the editor · Esc back (new tasks only; a committed task keeps its model/SID and no process is restarted)',
221
+ settingsCategoryMapHint: 'the categories block is this row’s editor (command: team config set-task-model <category> <model>) — the pair list is never composed in the console',
222
+ settingsCategoryMapEmpty: 'the categories block is this row’s editor (command: team config set-task-model <category> <model>) — the map is empty today; add a category through the CLI first',
223
+ settingsAssignmentHint: 'read-only: the actual model comes from a committed dispatch record (decided by dispatch/resume), not from the future policy above',
224
+ settingsAssignmentNote: 'task {task} · category {category} · SID {sid} · origin {selected}/{launch}',
225
+ settingsAssignmentNone: 'no complete dispatch record: {diagnostic}',
226
+ settingsReadOnlyBadge: 'read-only',
227
+ settingsPmLaunchLabel: 'PM launch record',
228
+ settingsPmLaunchNote: 'window {window} · {mode} · {time}',
229
+ settingsPmLaunchHint: 'read-only: the PM’s actual launch record (state/pm-launch.env)',
230
+ settingsDiagnosisHeading: 'Policy migration diagnosis',
210
231
  settingsCliHint: 'CLI: team config set {key} <value>',
211
232
  settingsRefusedHint: 'read-only: edit {key} in .pi/team/config.sh by hand',
212
233
  settingsUnknownHint: 'unknown key: {key} is in the file but not in the command schema',
@@ -219,25 +240,18 @@ export const en = {
219
240
  settingsChoiceFree: '… (free text)',
220
241
  settingsChoiceInterval: 'accepted interval {min}–{max} (empty = unbounded)',
221
242
  settingsChoiceNoChoice: 'the kind {kind} has no choice set; the command still validates the write (Enter opens free text)',
222
- settingsChoicePairlist: 'The seats block is this row’s editor (command: team config set-agent-model <seat> <model|->)',
243
+ settingCategoryConfirm: 'Confirm category {category}: {old} → {next} · new tasks only; a committed task keeps its model/SID (Enter again to write)',
244
+ settingCategoryWritten: '✓ wrote category {category} = {value} · new tasks only; committed tasks keep their model/SID; no process was restarted',
245
+ settingPmWritten: '✓ wrote the PM model = {value} · takes effect on the next team up (changing the model needs fresh-pm, judged by the launch guard); no process was restarted',
223
246
  settingsBoolOn: 'on (1)',
224
247
  settingsBoolOff: 'off (0)',
225
248
  settingsPathExists: 'exists',
226
249
  settingsPathMissing: 'missing',
227
250
  settingsPathNotExec: 'not executable',
228
- seatPickerTitle: 'Pick the model for {seat}',
229
- seatPickerHint: '↑/↓ select · Enter edit that value · Esc back (a running window keeps its model until the next dispatch/resume)',
230
- seatPickerRemove: '- (remove the override, fall back to the default)',
231
- seatPickerFree: '… (free text provider/model)',
232
- settingSeatConfirm: 'Confirm seat {seat}: {old} → {next} · takes effect on the next dispatch/resume (a running window keeps its model) (Enter again to write)',
233
- settingSeatWritten: '✓ wrote seat {seat} = {value} · effective on the next dispatch/resume',
234
- settingSeatRemoved: '✓ removed the override of seat {seat} · back to the default {value}',
235
- keySeatPick: 'Enter select',
236
- seatSourceConfig: 'config',
251
+ keyCategoryPick: 'Enter edit',
237
252
  seatSourceExplicit: 'explicit',
238
- seatSourceRecord: 'stale record',
239
- seatOverride: 'override',
240
- seatFallback: 'fallback',
253
+ seatSourcePolicy: 'category policy',
254
+ seatSourceAssignment: 'assignment',
241
255
 
242
256
  // The human labels of the contract keys (M49): one per key of `lib/cmd-config.sh`'s schema, and
243
257
  // the row's main text — the bare TEAM_* stays where it aligns with the CLI (the editor's title,
@@ -297,9 +311,8 @@ export const en = {
297
311
  label_TEAM_AGENT_BIN: 'Seat binary',
298
312
  label_TEAM_OPENSPEC_BIN: 'openspec binary',
299
313
  label_TEAM_JS_BIN: 'JS runtime',
300
- // -- per-seat models (needs a restart)
301
- label_TEAM_DEFAULT_MODEL: 'Default model',
302
- label_TEAM_AGENT_MODELS: 'Per-seat models',
314
+ // -- task categories and the PM model (apply/restart)
315
+ label_TEAM_TASK_MODELS: 'Task category models',
303
316
  label_TEAM_PM_MODEL: 'PM model',
304
317
  // -- workflow and gates
305
318
  label_TEAM_GATES: 'Gate commands',
@@ -375,12 +388,34 @@ export const en = {
375
388
  label_TEAM_MEETING_KNOCK: 'Allow knocking',
376
389
  label_TEAM_MEETING_ALLOW_USER_ID: 'Users who may knock',
377
390
 
391
+ // Key replies (pulse-key-replies)
392
+ replyHeading: 'key replies',
393
+ replyHeadingCount: 'key replies ({n})',
394
+ replyLatest: 'latest key reply',
395
+ replyEmpty: '(no key replies yet)',
396
+ replyUnavailable: '(unavailable)',
397
+ replyLatestUnavailable: 'latest reply unavailable: {reason}',
398
+ replyDeclared: 'declared by {from} · {at}',
399
+ replyDeclaredShort: 'declared by {from}',
400
+ replySlotUnavailable: '#{no} unavailable',
401
+ replyLoading: '… loading',
402
+ replyBodyMissing: 'this reply is unavailable',
403
+ replyBodyHint: 'read-only · declared publisher, not verified',
404
+ replyOlder: 'Older',
405
+ replyNewer: 'Newer',
406
+ replyBack: 'Back',
407
+ replyScrollHint: '↑/↓ PgUp/PgDn Home/End scroll',
408
+ replyTotalSlots: '{n} numbered slots',
409
+ replyTailWarning: 'the index tail is incomplete (the last append did not finish)',
410
+
378
411
  // Global keys (footer)
379
412
  keyCompose: 'm compose',
380
413
  keyFlush: 'f flush',
381
414
  keyStandby: 's standby',
382
415
  keySettings: ', settings',
383
- keyPages: 'Tab/1-4 pages',
416
+ keyPages: 'Tab/1-5 pages',
417
+ keyReplies: '←/→ older/newer',
418
+ keyReplyReset: 'r newest',
384
419
  keyScroll: '↑/↓ scroll',
385
420
  keyLanes: '←/→ lanes',
386
421
  keyCards: '↑/↓ cards',
@@ -76,6 +76,12 @@ export const zh = {
76
76
  pageWork: '工作',
77
77
  pageMessages: '消息与日志',
78
78
  pageBoard: '看板',
79
+ pageReplies: '关键回复',
80
+ pageOverviewShort: '总览',
81
+ pageWorkShort: '工作',
82
+ pageMessagesShort: '消息',
83
+ pageBoardShort: '看板',
84
+ pageRepliesShort: '回复',
79
85
  pageTab: ' {name} ',
80
86
  pageTabActive: '▸{name}◂',
81
87
 
@@ -174,7 +180,7 @@ export const zh = {
174
180
  group_branch: '分支与 forge',
175
181
  group_policy: '权限与依赖策略',
176
182
  group_roster: '名册、模型解析与适配器',
177
- 'group_seat-model': '按席位模型',
183
+ 'group_task-model': '任务类别与 PM 模型',
178
184
  group_workflow: '工作流与门禁',
179
185
  group_delivery: '容量与投递通知',
180
186
  group_panel: '巡检与面板',
@@ -183,7 +189,8 @@ export const zh = {
183
189
  group_session: '活着的会话',
184
190
  group_meeting: '跨项目会议',
185
191
  settingsGroupUngrouped: '未分组',
186
- settingsGroupSeats: '席位',
192
+ settingsGroupCategories: '任务类别(未来策略)',
193
+ settingsGroupAssignments: '实际派单记录(只读)',
187
194
  settingsBadgeApply: '立即生效',
188
195
  settingsBadgeRestart: '需重启',
189
196
  settingsBadgeRefuse: '只读',
@@ -204,8 +211,22 @@ export const zh = {
204
211
  settingConflict: '! 契约在编辑器打开后变过(指纹不符)—— 什么都没写;已重读',
205
212
  settingWriteError: '✗ 写入失败(原文件未动):{line}',
206
213
  settingsRefusedRoute: '只读键:手改 .pi/team/config.sh',
207
- settingsSeatHint: '席位模型:team config set-agent-model {seat} <model>',
208
- settingsPairlistHint: '席位模型:team config set-agent-model <seat> <model|-> —— 该行的编辑器是席位块(Enter 跳到那里,不在这里组合)',
214
+ settingsCategoryHint: '类别 {category}:team config set-task-model {category} <model> —— 只影响新任务;已派任务保留原模型/SID(这一行不组合映射)',
215
+ settingsCategoryRow: '类别 {category}',
216
+ settingsCategoryModel: '模型 {model}',
217
+ settingsCategoryBadge: '新任务',
218
+ settingsCategoryPickerTitle: '选择类别 {category} 的模型',
219
+ settingsCategoryPickerHint: '↑/↓ 选择 · Enter 直接写入该值 ·「自由输入」才进编辑器 · Esc 返回(只影响新任务;已派任务保留原模型/SID,没有进程被重启)',
220
+ settingsCategoryMapHint: '类别块就是这一行的编辑器(命令:team config set-task-model <category> <model>)—— 映射在面板里绝不被组合',
221
+ settingsCategoryMapEmpty: '类别块就是这一行的编辑器(命令:team config set-task-model <category> <model>)—— 当前映射为空,先用 CLI 添加一个类别',
222
+ settingsAssignmentHint: '只读:实际模型来自已提交的派单记录(由 dispatch/resume 决定),不是上面的未来策略',
223
+ settingsAssignmentNote: '任务 {task} · 类别 {category} · SID {sid} · 来源 {selected}/{launch}',
224
+ settingsAssignmentNone: '没有完整派单记录:{diagnostic}',
225
+ settingsReadOnlyBadge: '只读',
226
+ settingsPmLaunchLabel: 'PM 启动记录',
227
+ settingsPmLaunchNote: '窗口 {window} · {mode} · {time}',
228
+ settingsPmLaunchHint: '只读:PM 的实际启动记录(state/pm-launch.env)',
229
+ settingsDiagnosisHeading: '策略迁移诊断',
209
230
  settingsCliHint: '命令行:team config set {key} <新值>',
210
231
  settingsRefusedHint: '只读:手改 .pi/team/config.sh 里的 {key}',
211
232
  settingsUnknownHint: '未知键:{key} 在文件里,命令的 schema 不认识',
@@ -218,25 +239,18 @@ export const zh = {
218
239
  settingsChoiceFree: '…(自由输入)',
219
240
  settingsChoiceInterval: '接受区间 {min}–{max}(空 = 无界)',
220
241
  settingsChoiceNoChoice: '{kind} 这种 kind 没有选项集;写入仍由命令校验(Enter 打开自由输入)',
221
- settingsChoicePairlist: '席位块就是这一行的编辑器(命令:team config set-agent-model <seat> <model|->)',
242
+ settingCategoryConfirm: '确认类别 {category}:{old} → {next} · 只影响新任务;已派任务保留原模型/SID(再按 Enter 写入)',
243
+ settingCategoryWritten: '✓ 已写入类别 {category} = {value} · 只影响新任务;已派任务保留原模型/SID;没有重启任何进程',
244
+ settingPmWritten: '✓ 已写入 PM 模型 = {value} · 下次 team up 启动时生效(换模型须 fresh-pm,由启动守卫判定);没有重启任何进程',
222
245
  settingsBoolOn: '开(1)',
223
246
  settingsBoolOff: '关(0)',
224
247
  settingsPathExists: '存在',
225
248
  settingsPathMissing: '不存在',
226
249
  settingsPathNotExec: '不是可执行文件',
227
- seatPickerTitle: '选择 {seat} 的模型',
228
- seatPickerHint: '↑/↓ 选择 · Enter 编辑该值 · Esc 返回(运行中的窗口保持旧模型,下次 dispatch/resume 才换)',
229
- seatPickerRemove: '-(移除覆盖,回退默认)',
230
- seatPickerFree: '…(自由输入 provider/model)',
231
- settingSeatConfirm: '确认席位 {seat}:{old} → {next} · 下次 dispatch/resume 生效(运行中的窗口保持旧模型)(再按 Enter 写入)',
232
- settingSeatWritten: '✓ 已写入席位 {seat} = {value} · 下次 dispatch/resume 生效',
233
- settingSeatRemoved: '✓ 已移除席位 {seat} 的覆盖 · 回到默认 {value}',
234
- keySeatPick: 'Enter 选择',
235
- seatSourceConfig: '配置',
250
+ keyCategoryPick: 'Enter 编辑',
236
251
  seatSourceExplicit: '显式',
237
- seatSourceRecord: '历史记录',
238
- seatOverride: '覆盖',
239
- seatFallback: '回退默认',
252
+ seatSourcePolicy: '类别策略',
253
+ seatSourceAssignment: '已派记录',
240
254
 
241
255
  // 契约键的人话标签(M49):`lib/cmd-config.sh` 的 schema 每个键一条,行的主文本用它,
242
256
  // 裸 TEAM_* 只留在与 CLI 对齐的地方(编辑器标题、确认行、视图底部的命令行提示)。
@@ -295,9 +309,8 @@ export const zh = {
295
309
  label_TEAM_AGENT_BIN: '席位可执行文件',
296
310
  label_TEAM_OPENSPEC_BIN: 'openspec 可执行文件',
297
311
  label_TEAM_JS_BIN: 'JS 运行时',
298
- // —— 按席位模型(需重启)
299
- label_TEAM_DEFAULT_MODEL: '默认模型',
300
- label_TEAM_AGENT_MODELS: '按席位模型',
312
+ // —— 任务类别与 PM 模型(apply/restart)
313
+ label_TEAM_TASK_MODELS: '任务类别模型',
301
314
  label_TEAM_PM_MODEL: 'PM 模型',
302
315
  // —— 工作流与门禁
303
316
  label_TEAM_GATES: '门禁命令',
@@ -373,12 +386,34 @@ export const zh = {
373
386
  label_TEAM_MEETING_KNOCK: '允许敲门',
374
387
  label_TEAM_MEETING_ALLOW_USER_ID: '可敲门用户',
375
388
 
389
+ // 关键回复(pulse-key-replies)
390
+ replyHeading: '关键回复',
391
+ replyHeadingCount: '关键回复({n})',
392
+ replyLatest: '最新关键回复',
393
+ replyEmpty: '(还没有关键回复)',
394
+ replyUnavailable: '(不可用)',
395
+ replyLatestUnavailable: '最新回复不可用:{reason}',
396
+ replyDeclared: '自称来自 {from} · {at}',
397
+ replyDeclaredShort: '自称来自 {from}',
398
+ replySlotUnavailable: '#{no} 不可用',
399
+ replyLoading: '… 载入中',
400
+ replyBodyMissing: '这份回复不可用',
401
+ replyBodyHint: '只读 · 发布者自称,未经核验',
402
+ replyOlder: '更早',
403
+ replyNewer: '更新',
404
+ replyBack: '返回',
405
+ replyScrollHint: '↑/↓ PgUp/PgDn Home/End 滚动',
406
+ replyTotalSlots: '{n} 个编号槽位',
407
+ replyTailWarning: '索引尾部不完整(上一次追加没有写完)',
408
+
376
409
  // 全局键位(页脚)
377
410
  keyCompose: 'm 写信',
378
411
  keyFlush: 'f 冲刷',
379
412
  keyStandby: 's 待命',
380
413
  keySettings: ', 设置',
381
- keyPages: 'Tab/1-4 翻页',
414
+ keyPages: 'Tab/1-5 翻页',
415
+ keyReplies: '←/→ 更早/更新',
416
+ keyReplyReset: 'r 最新',
382
417
  keyScroll: '↑/↓ 滚动',
383
418
  keyLanes: '←/→ 车道',
384
419
  keyCards: '↑/↓ 卡片',