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
@@ -42,7 +42,9 @@ import {
42
42
  loadPanelData,
43
43
  panelDirOf,
44
44
  runRemindTick,
45
+ runReminderRecovery,
45
46
  runTick,
47
+ signalPulseChild,
46
48
  type BlockName,
47
49
  } from './data.js'
48
50
  import type { DataOptions, DataResult, PanelCache } from './data.js'
@@ -268,9 +270,17 @@ if (mode === 'palette') {
268
270
  process.exit(0)
269
271
  }
270
272
 
271
- // ---------------------------------------------------------------- the tick loop (owned here)
273
+ // ---------------------------------------------------------------- Pulse scheduling (one patrol + one recovery)
272
274
  let lastTick = 0
273
275
  const tickLog = argOf('tick-log') || `${root}/.pi/team/state/watchdog.tick.log`
276
+ const pulseChildren = new Set<ReturnType<typeof spawn>>()
277
+ let patrolRun: ReturnType<typeof runTick> | null = null
278
+ let recoveryRun: ReturnType<typeof runReminderRecovery> | null = null
279
+ let admissionRun: ReturnType<typeof runRemindTick> | null = null
280
+ let recoveryPending = false
281
+ let recoverySeen = ''
282
+ let pendingRecoverySignature = ''
283
+ let pulseStopping: Promise<unknown> | null = null
274
284
 
275
285
  function tickDue(): boolean {
276
286
  if (noPulse || tickEvery <= 0) return false
@@ -282,16 +292,36 @@ function tickDue(): boolean {
282
292
  return false
283
293
  }
284
294
 
295
+ function scheduleRecovery(): void {
296
+ if (!teamCli || !recoveryPending) return
297
+ if (patrolRun || recoveryRun || admissionRun) return
298
+ recoveryPending = false
299
+ recoverySeen = pendingRecoverySignature
300
+ recoveryRun = runReminderRecovery(teamCli, root, tickLog, 30000, pulseChildren)
301
+ void recoveryRun.finally(() => {
302
+ recoveryRun = null
303
+ if (recoveryPending) scheduleRecovery()
304
+ })
305
+ }
306
+
307
+ function schedulePatrol(): void {
308
+ if (!teamCli || patrolRun || recoveryRun) return
309
+ patrolRun = runTick(teamCli, root, tickLog, 180000, pulseChildren)
310
+ void patrolRun.finally(() => {
311
+ patrolRun = null
312
+ recoverySeen = '' // at most one recheck for the same queued IDs after each full patrol
313
+ if (recoveryPending) scheduleRecovery()
314
+ })
315
+ }
316
+
285
317
  async function runTickIfDue(): Promise<void> {
286
- if (!tickDue()) return
287
- if (!teamCli) return
288
- await runTick(teamCli, root, tickLog)
318
+ if (!tickDue() || !teamCli || patrolRun || recoveryRun) return
319
+ schedulePatrol()
320
+ if (patrolRun) await patrolRun
289
321
  }
290
322
 
291
- // ---------------------------------------------------------------- the lightweight Reminder due tick
292
- // agent-self-reminder 4.1: apart from (and much more often than) the full patrol, both pulse shapes own a
293
- // ~10s due check. It reads one bounded snapshot and only takes the authority lock when something is due;
294
- // it never scans the project, never starts the patrol and never calls a model.
323
+ // The due tick remains independent of a long patrol. Its result sets one coalesced recovery bit;
324
+ // recovery runs after the active patrol/recovery, never as an ordinary backlog nudge or second patrol.
295
325
  const remindEvery = Math.max(1, Number(process.env.TEAM_REMIND_TICK_SECS ?? 10) || 10)
296
326
  const remindStartedAt = new Date().toISOString()
297
327
  const remindScript = teamCli ? join(dirname(teamCli), 'remind-tick.mjs') : ''
@@ -308,8 +338,33 @@ function remindDue(): boolean {
308
338
  }
309
339
 
310
340
  async function runRemindIfDue(): Promise<void> {
311
- if (!remindDue()) return
312
- await runRemindTick(remindScript, root, stateDir, remindStartedAt, tickLog)
341
+ if (!remindDue() || admissionRun) return
342
+ admissionRun = runRemindTick(remindScript, root, stateDir, remindStartedAt, tickLog, 30000, pulseChildren)
343
+ try {
344
+ const result = await admissionRun
345
+ if (result.output.trim()) {
346
+ try {
347
+ const tick = JSON.parse(result.output)
348
+ const signature = Array.isArray(tick.recoveryIds) ? tick.recoveryIds.join(',') : ''
349
+ if (tick.recoveryRequired === true && signature !== recoverySeen) {
350
+ recoveryPending = true
351
+ pendingRecoverySignature = signature
352
+ }
353
+ }
354
+ catch { /* the child already logged a visible failure; the next interval re-reads the authority */ }
355
+ }
356
+ } finally { admissionRun = null }
357
+ scheduleRecovery()
358
+ }
359
+
360
+ async function stopPulseChildren(): Promise<void> {
361
+ recoveryPending = false
362
+ for (const child of pulseChildren) signalPulseChild(child, 'SIGTERM')
363
+ if (!pulseStopping) {
364
+ const runs = [patrolRun, recoveryRun, admissionRun].filter((run): run is NonNullable<typeof run> => Boolean(run))
365
+ pulseStopping = Promise.allSettled(runs).then(() => { pulseChildren.clear() })
366
+ }
367
+ await pulseStopping
313
368
  }
314
369
 
315
370
  function frameOf(res: DataResult, activity: boolean, scroll?: number): FrameInput {
@@ -418,11 +473,14 @@ async function main(): Promise<void> {
418
473
 
419
474
  if (mode === 'headless') {
420
475
  // The tick loop with no renderer. `team monitor --headless` is the bash loop (lock + drift
421
- // reexec); this branch serves a direct bundle invocation and keeps the same cadence.
476
+ // reexec); this branch serves a direct bundle invocation and keeps the same non-overlap rules.
477
+ const stop = async (code: number): Promise<void> => { await stopPulseChildren(); process.exit(code) }
478
+ process.on('SIGTERM', () => { void stop(143) })
479
+ process.on('SIGHUP', () => { void stop(129) })
422
480
  for (;;) {
423
- await runTickIfDue()
424
- await runRemindIfDue()
425
- sleepSync(Math.max(1, tickEvery || refresh) * 1000)
481
+ void runTickIfDue()
482
+ void runRemindIfDue()
483
+ await new Promise(resolve => setTimeout(resolve, remindEvery * 1000))
426
484
  }
427
485
  }
428
486
 
@@ -1002,18 +1060,22 @@ async function main(): Promise<void> {
1002
1060
  }
1003
1061
  }
1004
1062
  process.on('exit', restoreTerminal)
1005
- process.on('SIGTERM', () => {
1063
+ let pulseShutdown = false
1064
+ const shutdownPulse = async (code: number): Promise<void> => {
1065
+ if (pulseShutdown) return
1066
+ pulseShutdown = true
1006
1067
  restoreTerminal()
1007
- process.exit(143)
1008
- })
1009
- process.on('SIGHUP', () => {
1010
- restoreTerminal()
1011
- process.exit(129)
1012
- })
1068
+ await stopPulseChildren()
1069
+ cache.dispose()
1070
+ process.exit(code)
1071
+ }
1072
+ process.on('SIGTERM', () => { void shutdownPulse(143) })
1073
+ process.on('SIGHUP', () => { void shutdownPulse(129) })
1013
1074
 
1014
1075
  if (once) await runTickIfDue()
1015
1076
  await app.waitUntilExit()
1016
1077
  restoreTerminal()
1078
+ await stopPulseChildren()
1017
1079
  cache.dispose()
1018
1080
  process.exit(0)
1019
1081
  }
@@ -0,0 +1,46 @@
1
+ import type { SettingsKey, SettingsPage, LimitsDraft } from './types.js'
2
+ import type { Strings } from './strings/index.js'
3
+
4
+ // Presentation references only. Values, permissions and validation remain in the command read.
5
+ export const MODEL_SETTINGS = ['TEAM_PM_MODEL', 'TEAM_MODEL_LIMITS'] as const
6
+ export const CHECK_SETTINGS = ['TEAM_PULSE_INTERVAL', 'TEAM_PULSE_MAX_RESTARTS', 'TEAM_UPDATE_CHECK'] as const
7
+ export const COMMAND_SETTINGS = ['TEAM_INSTALL_CMD', 'TEAM_GATES', 'TEAM_REVIEW_TIMEOUT'] as const
8
+ export const SELECTED_SETTINGS = [...MODEL_SETTINGS, ...CHECK_SETTINGS, ...COMMAND_SETTINGS]
9
+ export const effectiveSetting = (key: SettingsKey): string => key.set ? key.value : key.value || key.default
10
+ export const settingLabel = (s: Strings, key: string): string => s[`label_${key}`] || key
11
+ export const isSecondsSetting = (key: string): boolean => key === 'TEAM_PULSE_INTERVAL' || key === 'TEAM_REVIEW_TIMEOUT'
12
+ export function settingTiming(s: Strings, key: string, category?: string): string {
13
+ if (category) return s.settingsNewTasks
14
+ if (key === 'TEAM_PM_MODEL') return `${s.settingsAfterPmRestart} · team up --fresh-pm`
15
+ if (key === 'TEAM_PULSE_INTERVAL') return `${s.settingsAfterPulseRestart} · team pulse restart`
16
+ return ''
17
+ }
18
+ export function settingsPageTitle(s: Strings, page: SettingsPage): string {
19
+ return page === 'commands' ? s.settingsCommands : page === 'records' ? s.settingsRecords
20
+ : page === 'limits' ? s.label_TEAM_MODEL_LIMITS : page === 'rule' ? s.settingsRuleEdit : s.settingsViewTitle
21
+ }
22
+ // Keep every token, including repeated expressions, in its original position. The writer owns
23
+ // accepted patterns; this shape check only decides whether field editing can represent the source.
24
+ export function limitsTokens(value: string): string[] | null {
25
+ const tokens = value.match(/\S+/g) ?? []
26
+ return tokens.every((t) => /^\S+=\d+$/.test(t)) ? tokens : null
27
+ }
28
+ export function limitFields(token: string): [string, string] {
29
+ const at = token.lastIndexOf('=')
30
+ return [token.slice(0, at), token.slice(at + 1)]
31
+ }
32
+ export function withLimitsTokens(draft: LimitsDraft, tokens: string[]): LimitsDraft {
33
+ return { ...draft, tokens, changed: tokens.join(' ') !== (limitsTokens(draft.original) ?? []).join(' ') }
34
+ }
35
+ export function limitsValue(draft: LimitsDraft): string {
36
+ return draft.changed ? draft.tokens.join(' ') : draft.original
37
+ }
38
+ export function limitsDisplay(value: string, s: Strings): string[] {
39
+ const tokens = limitsTokens(value)
40
+ if (!tokens) return [value]
41
+ if (!tokens.length) return [s.settingsUnfilled]
42
+ return tokens.map((t) => {
43
+ const [model, count] = limitFields(t)
44
+ return `${s.settingsRuleModel}: ${model} · ${s.settingsRuleCount}: ${count === '0' ? s.settingsRuleUnlimited : count}`
45
+ })
46
+ }
@@ -176,76 +176,73 @@ export const en = {
176
176
  prefProjectSettings: 'Project settings',
177
177
  prefNavArrow: '›',
178
178
  settingsViewTitle: 'Project settings',
179
- // P30/D2: the grouping comes from the schema row's tenth column (`group_<token>`), never from
180
- // the class — the three class-group labels are gone.
181
- group_identity: 'Identity & ledger layout',
182
- group_branch: 'Branch & forge',
183
- group_policy: 'Permissions & dependencies',
184
- group_roster: 'Roster, models & adapters',
185
- 'group_task-model': 'Task categories & PM model',
186
- group_workflow: 'Workflow & gates',
187
- group_delivery: 'Capacity & delivery',
188
- group_panel: 'Pulse & panel',
189
- group_patrol: 'Patrol',
190
- 'group_pm-lifecycle': 'PM lifecycle',
191
- group_session: 'Live sessions',
192
- group_meeting: 'Cross-project meetings',
193
- settingsGroupUngrouped: 'Ungrouped',
194
- settingsGroupCategories: 'The model the next task will use',
195
- settingsGroupAssignments: 'The model running tasks actually use',
196
- settingsBadgeApply: 'apply',
197
- settingsBadgeRestart: 'restart',
198
- settingsBadgeRefuse: 'change in file',
199
- settingsUnknownBadge: 'not recognized',
200
- settingsUnset: 'unset · default {value}',
201
- settingsKeyHint: '↑/↓ rows · Enter edit · / filter · Esc back',
179
+ settingsChecks: 'Automatic checks',
180
+ settingsCommands: 'Project commands',
181
+ settingsRecords: 'Model records',
182
+ settingsNewTasks: 'New tasks',
183
+ settingsAfterPmRestart: 'After PM restart',
184
+ settingsAfterPulseRestart: 'After Pulse restart',
185
+ settingsNoRecovery: 'No automatic recovery',
186
+ settingsUnfilled: 'Unfilled',
187
+ settingsEntries: '{n} entries',
188
+ settingsRuleModel: 'Applicable model',
189
+ settingsRuleCount: 'Simultaneous quantity',
190
+ settingsRuleUnlimited: 'No limit from this entry',
191
+ settingsRuleAdd: 'Add limit',
192
+ settingsRuleDelete: 'Delete limit',
193
+ settingsRuleEdit: 'Edit limit',
194
+ settingsSave: 'Save',
195
+ settingsRuleOther: 'Other applicable model',
196
+ settingsRuleCountInvalid: 'Enter a non-negative integer',
197
+ settingsOld: 'Old',
198
+ settingsNew: 'New',
199
+ settingsFieldHint: 'Enter Done · Esc Back',
200
+ settingsConfirmHint: 'Enter Save · Esc Cancel',
201
+ settingsEditHint: 'Enter Continue · Esc Cancel',
202
+ settingsSeconds: 's',
203
+ settingsSecondsEditHint: 'Type seconds · Enter Continue · Esc Cancel',
204
+ keySettingsBack: 'Esc back',
205
+ settingsKeepEmpty: 'Leave unset',
206
+ settingsRecordTask: 'Task',
207
+ settingsRecordCategory: 'Category',
208
+ settingsRecordModel: 'Model',
209
+ settingsRecordSid: 'Session ID',
210
+ settingsRecordSelected: 'Model selection',
211
+ settingsRecordLaunch: 'Launch method',
212
+ settingsRecordTime: 'Time',
213
+ settingsRecordWindow: 'Window',
214
+ settingsRecordMode: 'Launch method',
215
+ settingsGroupCategories: 'Models',
202
216
  keyFilter: '/ filter',
203
217
  settingFilterTitle: 'Filter settings',
204
- settingConfirm: 'Confirm: {key} {old} → {next} · {timing} (Enter again to write)',
205
- settingTimingApply: 'the next process that reads it',
206
- settingTimingRestart: 'needs a restart',
207
- settingDanger: 'Danger: {reason} (press Enter once more to confirm)',
208
- settingRejected: '✗ refused: {line}',
209
- settingWritten: '✓ wrote {key} = {value} · {timing}',
210
- settingRefused: '✗ this value is changed in the project config file: {line}',
211
- settingInvalid: '✗ invalid value: {line}',
212
- settingConflict: '! the contract changed under the editor (fingerprint mismatch) — nothing written; reloaded',
213
- settingWriteError: '✗ write failed (file unchanged): {line}',
214
- settingsRefusedRoute: 'change this value in the project config file .pi/team/config.sh; the panel cannot change it',
215
- settingsCategoryHint: 'category {category}: team config set-task-model {category} <model> — new tasks only; a task already dispatched keeps the model it was given (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 task already dispatched keeps the model it was given 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: 'once a task is dispatched it keeps the model it was given; this setting does not change it',
224
- settingsAssignmentNote: 'task {task} · category {category} · session {sid} · origin {selected}/{launch}',
225
- settingsAssignmentNone: 'this seat has not been given a task yet',
226
- settingsAssignmentUnreadable: 'this seat was given a task, but its record could not be read, so the panel does not show its model',
227
- settingsReadOnlyBadge: 'change in file',
228
- settingsPmLaunchLabel: 'last PM start',
229
- settingsPmLaunchNote: 'window {window} · {mode} · {time}',
230
- settingsPmLaunchHint: 'the model the PM used the last time it started; it cannot be changed here',
231
- settingsDiagnosisHeading: 'these settings need an upgrade',
232
- settingsCliHint: 'CLI: team config set {key} <value>',
233
- settingsRefusedHint: 'change this value in the project config file .pi/team/config.sh; the panel cannot change it',
234
- settingsUnknownHint: '{key}: the file carries this setting but the tool does not know it; the panel cannot change it',
235
- settingsChoiceTitle: 'Choose a value for {label} · {key}',
236
- settingsChoiceHint: '↑/↓ choose · Enter writes that value now (danger needs one more) · only free text opens the editor · Esc back',
218
+ settingConfirm: '{key}\nOld {old}\nNew {next}\n{timing}',
219
+ settingDanger: 'Danger: {reason} · Enter Confirm',
220
+ settingWritten: 'Saved {key} · {timing}',
221
+ settingRefused: 'Cannot edit: {line}',
222
+ settingInvalid: 'Invalid value: {line}',
223
+ settingConflict: 'Settings changed; not saved',
224
+ settingWriteError: 'Save failed: {line}',
225
+ settingsRefusedRoute: 'Edit .pi/team/config.sh',
226
+ settingsCategoryRow: '{category}',
227
+ settingsCategoryPickerHint: 'New tasks',
228
+ settingsAssignmentNone: 'No dispatch record',
229
+ settingsAssignmentUnreadable: 'Record could not be read',
230
+ settingsPmLaunchLabel: 'Last PM startup',
231
+ settingsDiagnosisHeading: 'Configuration needs updating',
232
+ settingsLaunchFresh: 'Fresh startup',
233
+ settingsLaunchContinued: 'Continue previous session',
234
+ settingsChoiceHint: '↑/↓ Select · Enter Save · Esc Cancel',
237
235
  settingsChoiceCurrent: 'current',
238
236
  settingsChoiceDefault: 'default',
239
- settingsChoiceKeepUnset: 'keep unset (cancel, nothing written)',
240
- settingsChoiceClear: 'clear (write the empty value)',
241
- settingsChoiceFree: '… (free text)',
242
- settingsChoiceInterval: 'accepted interval {min}–{max} (empty = unbounded)',
243
- settingsChoiceNoChoice: 'the kind {kind} has no choice set; the command still validates the write (Enter opens free text)',
244
- settingCategoryConfirm: 'Confirm category {category}: {old} → {next} · new tasks only; a task already dispatched keeps the model it was given (Enter again to write)',
245
- settingCategoryWritten: '✓ wrote category {category} = {value} · new tasks only; tasks already dispatched keep the model they were given; no process was restarted',
246
- settingPmWritten: '✓ wrote the PM model = {value} · changing the model needs team up --fresh-pm, which starts a new conversation; no process was restarted',
247
- settingsBoolOn: 'on (1)',
248
- settingsBoolOff: 'off (0)',
237
+ settingsChoiceKeepUnset: 'Keep default value',
238
+ settingsChoiceClear: 'Clear',
239
+ settingsChoiceFree: 'Enter another value',
240
+ settingsChoiceInterval: '{min}–{max}',
241
+ settingCategoryConfirm: '{category}\nOld {old}\nNew {next}\nNew tasks',
242
+ settingCategoryWritten: 'Saved {category} model · New tasks',
243
+ settingPmWritten: 'Saved PM model · After PM restart · team up --fresh-pm',
244
+ settingsBoolOn: 'On',
245
+ settingsBoolOff: 'Off',
249
246
  settingsPathExists: 'exists',
250
247
  settingsPathMissing: 'missing',
251
248
  settingsPathNotExec: 'not executable',
@@ -253,148 +250,17 @@ export const en = {
253
250
  seatSourceExplicit: 'chosen at dispatch',
254
251
  seatSourcePolicy: 'set by category',
255
252
  seatSourceAssignment: 'kept from the record',
253
+ seatSourceRecord: 'from dispatch record',
256
254
 
257
- // The human labels of the contract keys (M49): one per key of `lib/cmd-config.sh`'s schema, and
258
- // the row's main text — the bare TEAM_* stays where it aligns with the CLI (the editor's title,
259
- // the confirmation line, the view's command hint). A key the schema does not know has no label
260
- // and falls back to its raw name (`keyLabel()`). Completeness is asserted by
261
- // tests/panel-strings.mjs (schema ↔ both tables, both directions). Order follows the schema.
262
- // -- identity and ledger layout (read-only)
263
- label_TEAM_PROJECT: 'Project name',
264
- label_TEAM_SESSION: 'Session name',
265
- label_TEAM_PM_WINDOW: 'PM window',
266
- label_TEAM_AGENTS: 'Roster',
267
- label_TEAM_DOCS_DIR: 'Ledger dir',
268
- label_TEAM_WORKTREES_DIR: 'Worktree dir',
269
- label_TEAM_STATE_DIR: 'State dir',
270
- label_TEAM_MEETINGS_DIR: 'Meeting dir',
271
- label_TEAM_SPEC_DIR: 'Spec dir',
272
- label_TEAM_ROOT: 'Project root',
273
- label_TEAM_MAIN_ROOT: 'Main checkout root',
274
- label_TEAM_TMP_ROOT: 'Temp root',
275
- label_TEAM_CONFIG_FILE: 'Contract file',
276
- // -- branch and forge (read-only)
277
- label_TEAM_BRANCH_MODE: 'Branch naming mode',
278
- label_TEAM_TASK_BRANCH_PREFIX: 'Task branch prefix',
279
- label_TEAM_AGENT_BRANCH_PREFIX: 'Seat branch prefix',
280
- label_TEAM_PROTECTED_BRANCH: 'Protected branch',
281
- label_TEAM_REMOTE: 'Remote',
282
- label_TEAM_VCS: 'Forge',
283
- label_TEAM_TOKEN_FILE: 'Token file',
284
- label_TEAM_GITLAB_HOST: 'GitLab host',
285
- label_TEAM_GITLAB_PROJECT: 'GitLab project',
286
- label_TEAM_GITLAB_TOKEN_FILE: 'GitLab token file',
287
- label_TEAM_MERGE_PREFER_THEIRS: 'Prefer branch side',
288
- // -- permissions and dependencies (read-only)
289
- label_TEAM_CONFIRM_WRITES: 'Confirm writes',
290
- label_TEAM_ALLOW_FOREIGN_IDENTITY: 'Allow foreign ID',
291
- label_TEAM_ALLOW_FOREIGN_SESSION: 'Allow foreign window',
292
- label_TEAM_GUARD_FOREIGN_TARGET: 'Guard foreign targets',
293
- label_TEAM_REPLACE_FOREIGN_PM: 'Replace foreign PM',
294
- label_TEAM_ALLOW_DESTRUCTIVE_TMUX: 'Allow destructive ops',
295
- label_TEAM_ASSUME_YES: 'Assume yes',
296
- label_TEAM_REQUIRE_JS: 'Require JS runtime',
297
- label_TEAM_REQUIRE_OPENSPEC: 'Require OpenSpec',
298
- label_TEAM_REQUIRE_MAGIC_CONTEXT: 'Require Magic Context',
299
- label_TEAM_PI_AGENT_DIR: 'Pi agent dir',
300
- label_TEAM_PI_SETTINGS_FILE: 'Pi settings file',
301
- label_TEAM_MEMINFO_FILE: 'meminfo file',
302
- label_TEAM_DISK_STATS_FILE: 'Disk stats fixture',
303
- label_TEAM_SMOKE_FAST: 'Smoke fast mode',
304
- // -- roster, model resolution and adapters
305
- label_TEAM_MODEL_LIMITS: 'Concurrency limits',
306
- label_TEAM_MODEL_WINDOWS: 'Context windows',
307
- label_TEAM_SESSION_WARN_TOKENS: 'Context warn tokens',
308
- label_TEAM_EXTRA_PI_ARGS: 'Seat extra args',
309
- label_TEAM_AGENT_CMD: 'Seat launch command',
310
- label_TEAM_AGENT_NOTIFY_CMD: 'Turn-end notify cmd',
311
- label_TEAM_AGENT_LOG_GLOB: 'Seat log glob',
312
- label_TEAM_PI_BIN: 'pi binary',
313
- label_TEAM_AGENT_BIN: 'Seat binary',
314
- label_TEAM_OPENSPEC_BIN: 'openspec binary',
315
- label_TEAM_JS_BIN: 'JS runtime',
316
- // -- task categories and the PM model (apply/restart)
317
- label_TEAM_TASK_MODELS: 'Task category models',
255
+ // Labels only for selected settings; the complete CLI schema is unchanged.
256
+ label_TEAM_MODEL_LIMITS: 'Concurrent tasks by model',
318
257
  label_TEAM_PM_MODEL: 'PM model',
319
- label_TEAM_CONFIG_VERSION: 'Config shape version',
320
- // -- workflow and gates
321
- label_TEAM_UPDATE_CHECK: 'Startup version notice',
322
- label_TEAM_GATES: 'Gate commands',
258
+ label_TEAM_UPDATE_CHECK: 'Check for updates at startup',
259
+ label_TEAM_GATES: 'Acceptance command',
323
260
  label_TEAM_INSTALL_CMD: 'Install command',
324
- label_TEAM_TASK_BRANCH_RESET: 'Reset task branch',
325
- label_TEAM_DISPATCH_VERIFY_SEC: 'Dispatch check wait',
326
- label_TEAM_DISPATCH_ALIVE_SEC: 'Alive check wait',
327
- label_TEAM_SQUASH_LOOKBACK: 'Squash look-back',
328
- label_TEAM_REVIEW_TIMEOUT: 'Review timeout',
329
- label_TEAM_REVIEW_TIMEOUT_GRACE: 'Timeout grace',
330
- label_TEAM_REVIEW_ALLOW_DIRTY: 'Allow dirty checkout',
331
- label_TEAM_REVIEW_ALLOW_IGNORED: 'Allow ignored files',
332
- label_TEAM_REVIEW_ALLOW_UNRESOLVED_BRANCH: 'Allow unresolved tip',
333
- label_TEAM_REVIEW_ANY_DIR: 'Skip checkout guard',
334
- label_TEAM_BOARD_DONE_FORCE: 'Force board done',
335
- label_TEAM_BOARD_DONE_REASON: 'Force-done reason',
336
- // -- capacity and delivery
337
- label_TEAM_MIN_FREE_SWAP_MB: 'Free swap floor',
338
- label_TEAM_MIN_TOTAL_MB: 'RAM+swap floor',
339
- label_TEAM_MIN_AVAIL_MB: 'Free memory floor',
340
- label_TEAM_TMP_MIN_FREE_MB: 'Temp root space floor',
341
- label_TEAM_TMP_MIN_FREE_INODES: 'Temp root inode floor',
342
- label_TEAM_WARN_AVAIL_MB: 'Memory warn line',
343
- label_TEAM_ZRAM_WARN_PCT: 'zram warn percent',
344
- label_TEAM_AGENT_MEM_MB: 'Seat memory cap',
345
- label_TEAM_NOTIFY_TMUX: 'tmux delivery',
346
- label_TEAM_NOTIFY_DEDUP_SEC: 'Notify dedup window',
347
- label_TEAM_INBOX_MAX_CHARS: 'Preview chars',
348
- label_TEAM_NOTIFY_LOG: 'Notify debug log',
349
- label_TEAM_NOTIFY_DETAIL_MAX: 'Notify detail bound',
350
- label_TEAM_DEFER_TTL: 'Queued delivery TTL',
351
- label_TEAM_OUTBOX_MAX: 'Outbox cap',
352
- label_TEAM_PANEL_DETAIL_CAP: 'Detail read cap',
353
- label_TEAM_ORPHAN_WARN_MB: 'Orphan memory hint',
354
- label_TEAM_ORPHAN_SCAN: 'Scan orphan seats',
355
- label_TEAM_ORPHAN_PROC_ROOT: 'Census proc root',
356
- // -- pulse and panel (needs a restart)
357
- label_TEAM_PULSE_INTERVAL: 'Patrol interval',
358
- label_TEAM_MONITOR_REFRESH: 'Panel refresh period',
359
- label_TEAM_MONITOR_EVENTS: 'Initial event rows',
360
- label_TEAM_MONITOR_UI: 'Panel renderer',
361
- label_TEAM_MONITOR_ACTIVITY: 'Activity column',
362
- label_TEAM_AGENT_LOG_TAIL_BYTES: 'Log tail read cap',
363
- label_TEAM_PULSE_WINDOW: 'Pulse window name',
364
- // -- patrol policy
365
- label_TEAM_PULSE_NUDGE_GAP: 'Nudge gap',
366
- label_TEAM_PULSE_PENDING_BOARD: 'Wake on board to-do',
367
- label_TEAM_PULSE_REBUILD_TMUX: 'Rebuild tmux server',
368
- label_TEAM_PULSE_MAX_RESTARTS: 'Max auto-restarts',
369
- // -- PM lifecycle (needs a restart)
370
- label_TEAM_PM_SESSION_ID: 'PM session id',
371
- label_TEAM_PM_CMD: 'PM launch command',
372
- label_TEAM_PM_BIN: 'PM binary',
373
- label_TEAM_PM_EXTRA_PI_ARGS: 'PM extra args',
374
- label_TEAM_PM_RESUME_ARGS: 'PM resume args',
375
- label_TEAM_PM_START_WAIT: 'PM start wait',
376
- // -- live sessions (needs a restart)
377
- label_TEAM_INBOX_WATCH_MAX_BYTES: 'Watcher read cap',
378
- label_TEAM_INBOX_WATCH_PREVIEW: 'Preview lines',
379
- label_TEAM_INBOX_WATCH_REPLAY_MAX: 'Replay cap',
380
- label_TEAM_INBOX_WATCH_SEEN_MAX: 'Seen-record cap',
381
- label_TEAM_INBOX_WATCH_STALE: 'Stale threshold',
382
- label_TEAM_INBOX_WATCH_STALE_SEC: 'Wake freshness (s)',
383
- label_TEAM_INBOX_WATCH_FORCE_FAIL: 'Force watch failure',
384
- label_TEAM_IW_REQUIRE_WATCH: 'Strict gate mode',
385
- label_TEAM_INBOX_WATCH_POLL_MS: 'Poll interval',
386
- label_TEAM_INBOX_WATCH_HEARTBEAT_MS: 'Heartbeat interval',
387
- label_TEAM_INBOX_WATCH_TARGET: 'Delivery target',
388
- label_TEAM_BG_LOG_MAX_BYTES: 'Background log cap',
389
- // -- signal discipline (P159)
390
- label_TEAM_SIGNAL_CALLS_LOG: 'Signal call log',
391
- label_TEAM_SIGNAL_REAL: 'Real signal tool',
392
- label_TEAM_BG_STOP_GRACE: 'Job stop grace',
393
- // -- cross-project meetings
394
- label_TEAM_MEETING_TTL_HOURS: 'Meeting TTL',
395
- label_TEAM_MEETING_MAX_TURNS: 'Meeting turn cap',
396
- label_TEAM_MEETING_KNOCK: 'Allow knocking',
397
- label_TEAM_MEETING_ALLOW_USER_ID: 'Users who may knock',
261
+ label_TEAM_REVIEW_TIMEOUT: 'Acceptance time limit',
262
+ label_TEAM_PULSE_INTERVAL: 'Check interval',
263
+ label_TEAM_PULSE_MAX_RESTARTS: 'PM recoveries per hour',
398
264
 
399
265
  // Key replies (pulse-key-replies)
400
266
  replyHeading: 'key replies',
@@ -51,11 +51,9 @@ export function fill(template: string, vars: Record<string, string | number>): s
51
51
  const KEY_LABEL_PREFIX = 'label_'
52
52
 
53
53
  /**
54
- * The human label of a contract key (M49), looked up in the table by the key the **command**
55
- * reported — the panel carries no key list of its own, so a key added to the schema still shows up
56
- * (its row, class and default come from the command); a key the table has no label for (a key the
57
- * schema does not know, e.g. hand-added to the file) falls back to its **raw name**, which is
58
- * deliberate: a nameless row would be worse, and the raw name is what the file and the CLI carry.
54
+ * The human label of a selected operation, looked up by the command's key.
55
+ * Unknown labels fall back to the source name; selecting the visible operations belongs to
56
+ * project-settings.ts, not to the complete command schema.
59
57
  *
60
58
  * Static lookup, no file read: the render path stays inside the CPU contract.
61
59
  */