@polymorphism-tech/morph-spec 10.11.1 → 10.12.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 (77) hide show
  1. package/README.md +2 -2
  2. package/bin/morph-spec.js +2 -0
  3. package/claude-plugin.json +1 -1
  4. package/docs/CHEATSHEET.md +1 -1
  5. package/docs/QUICKSTART.md +1 -1
  6. package/framework/CLAUDE.md +4 -3
  7. package/framework/MORPH.md +14 -12
  8. package/framework/commands/morph-review.md +1 -1
  9. package/framework/commands/morph-status.md +2 -6
  10. package/framework/docs/CLI.md +21 -6
  11. package/framework/hooks/claude-code/core/enforce-phase-writes.js +12 -11
  12. package/framework/hooks/claude-code/core/gate-guard.js +19 -14
  13. package/framework/hooks/claude-code/core/heavy-gate.js +4 -1
  14. package/framework/hooks/claude-code/core/loop-detect.js +8 -7
  15. package/framework/hooks/claude-code/core/masked-exit.js +5 -2
  16. package/framework/hooks/claude-code/core/protect-spec-files.js +13 -11
  17. package/framework/hooks/claude-code/core/state-sync.js +20 -12
  18. package/framework/hooks/claude-code/core/validate-completion.js +6 -5
  19. package/framework/hooks/claude-code/core/worktree-context.js +47 -43
  20. package/framework/hooks/shared/gate-question.js +8 -0
  21. package/framework/hooks/shared/next-step.js +54 -23
  22. package/framework/hooks/shared/owner-words.js +146 -0
  23. package/framework/hooks/shared/report-progress.js +84 -10
  24. package/framework/phases.json +7 -7
  25. package/framework/rules/implement-report.md +8 -7
  26. package/framework/rules/plan-grammar.md +4 -1
  27. package/framework/schemas/feature.schema.json +3 -2
  28. package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
  29. package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
  30. package/framework/skills/core/morph-apply/SKILL.md +6 -5
  31. package/framework/skills/core/morph-apply/references/hotfix.md +6 -2
  32. package/framework/skills/core/morph-apply/references/review.md +9 -5
  33. package/framework/skills/core/morph-plan/SKILL.md +5 -5
  34. package/framework/skills/core/morph-plan/references/interview.md +1 -1
  35. package/framework/skills/core/morph-uiux/SKILL.md +10 -6
  36. package/framework/templates/docs/plan.md +1 -1
  37. package/package.json +1 -1
  38. package/src/commands/e2e/e2e.js +31 -29
  39. package/src/commands/project/status.js +28 -184
  40. package/src/commands/state/advance.js +44 -20
  41. package/src/commands/state/approve.js +70 -59
  42. package/src/commands/state/archive.js +20 -15
  43. package/src/commands/state/auto-approval.js +25 -23
  44. package/src/commands/state/create.js +35 -32
  45. package/src/commands/state/finish.js +179 -58
  46. package/src/commands/state/gate-check.js +43 -31
  47. package/src/commands/state/gate-decision.js +18 -14
  48. package/src/commands/state/list.js +23 -14
  49. package/src/commands/state/next.js +4 -5
  50. package/src/commands/state/report-check.js +47 -23
  51. package/src/commands/validation/plan-check.js +30 -14
  52. package/src/commands/validation/verify.js +39 -18
  53. package/src/dashboard/app/components/ActivityFeed.jsx +8 -8
  54. package/src/dashboard/app/components/CommandPalette.jsx +1 -1
  55. package/src/dashboard/app/components/GatePauses.jsx +8 -8
  56. package/src/dashboard/app/components/PhaseRail.jsx +6 -6
  57. package/src/dashboard/app/components/SessionMap.jsx +7 -7
  58. package/src/dashboard/app/lib/format.js +6 -2
  59. package/src/dashboard/app/lib/phases.js +48 -16
  60. package/src/dashboard/app/pages/FeatureDetail.jsx +87 -59
  61. package/src/dashboard/app/pages/Features.jsx +18 -18
  62. package/src/dashboard/app/pages/Guide.jsx +4 -4
  63. package/src/dashboard/app/pages/PhasePipeline.jsx +7 -7
  64. package/src/dashboard/app/pages/Portfolio.jsx +3 -3
  65. package/src/dashboard/scanner/activity-scanner.js +20 -6
  66. package/src/dashboard/scanner/features-scanner.js +43 -8
  67. package/src/dashboard/scanner/project-api.js +2 -0
  68. package/src/dashboard/vite.config.js +2 -0
  69. package/src/lib/next-step.js +3 -2
  70. package/src/lib/plan/checks.js +30 -15
  71. package/src/lib/plan/critique.js +6 -4
  72. package/src/lib/recap/recap.js +46 -20
  73. package/src/lib/risk-detector.js +260 -98
  74. package/src/lib/view/feature-html.js +19 -25
  75. package/src/lib/view/feature-view.js +6 -6
  76. package/src/utils/audience.js +27 -0
  77. package/src/utils/refusal-line.js +2 -2
@@ -22,6 +22,9 @@ import {
22
22
  DETACH_RUN_ENV, DETACH_STAGE_ENV, DETACH_WORKER_ENV, launchWorker, markWorkerExit, runFilesOf, superviseVerify,
23
23
  } from '../../lib/verify/detached.js';
24
24
  import { watchRun } from '../../lib/heavy/watchdog.js';
25
+ import { RESULT_SAY, TESTS, VERIFY_STEP_SAY, featureRef } from '../../../framework/hooks/shared/owner-words.js';
26
+ import { SESSION_MARK } from '../../../framework/hooks/shared/next-step.js';
27
+ import { ownerRef } from '../../../framework/hooks/shared/report-progress.js';
25
28
 
26
29
  const detachedArgs = () => process.argv.slice(2).filter((arg) => arg !== '--detach');
27
30
 
@@ -44,22 +47,24 @@ function statusIcon(status) {
44
47
  return chalk.gray('–');
45
48
  }
46
49
 
47
- function formatVerifyResult(result) {
50
+ const seconds = (ms) => (ms >= 1000 ? `${(ms / 1000).toFixed(1).replace('.', ',')} s` : `${ms} ms`);
51
+
52
+ function formatVerifyResult(result, name = result.feature) {
48
53
  const lines = [];
49
54
 
50
55
  lines.push('');
51
- lines.push(chalk.bold(`Verify — ${result.feature}`));
52
- if (result.stack) lines.push(chalk.gray(`stack: ${result.stack}`));
56
+ lines.push(chalk.bold(`Testes automáticos de ${name}`));
57
+ if (result.stack) lines.push(chalk.gray(`Tecnologia: ${result.stack}`));
53
58
  lines.push('');
54
- lines.push(result.status === 'pass' ? chalk.green.bold('✓ PASS') : chalk.red.bold('✗ FAIL'));
59
+ lines.push(result.status === 'pass' ? chalk.green.bold('✓ Passou: tudo o que rodou deu certo.') : chalk.red.bold('✗ Falhou: algo não funcionou. O detalhe está abaixo.'));
55
60
  lines.push('');
56
61
  const env = result.nodes.tests?.environment;
57
62
  if (env) {
58
- lines.push(chalk.cyan(`environment: ${env.kind} (${env.image})`));
63
+ lines.push(chalk.cyan(`Ambiente: ${env.kind} (${env.image})`));
59
64
  lines.push('');
60
65
  }
61
- lines.push('Nodes:');
62
- for (const [name, node] of Object.entries(result.nodes)) {
66
+ lines.push('Etapas:');
67
+ for (const [step, node] of Object.entries(result.nodes)) {
63
68
  const icon = statusIcon(node.status);
64
69
  let detail;
65
70
  if (node.status === 'skip') {
@@ -67,16 +72,16 @@ function formatVerifyResult(result) {
67
72
  } else if (node.reason) {
68
73
  // A green e2e still carries meaning worth showing: smoke-only vs specs,
69
74
  // warm reuse vs rebuild. Without it, "pass" hides how much was proven.
70
- detail = `${node.durationMs}ms — ${node.reason}`;
75
+ detail = `${seconds(node.durationMs)} — ${node.reason}`;
71
76
  } else {
72
- detail = `${node.durationMs}ms`;
77
+ detail = seconds(node.durationMs);
73
78
  }
74
- lines.push(` ${icon} ${name.padEnd(11)} ${node.status.padEnd(5)} ${chalk.gray(detail)}`);
79
+ lines.push(` ${icon} ${(VERIFY_STEP_SAY[step] ?? step).padEnd(24)} ${(RESULT_SAY[node.status] ?? node.status).padEnd(9)} ${chalk.gray(detail)}`);
75
80
  }
76
81
 
77
82
  if (result.feedback.length > 0) {
78
83
  lines.push('');
79
- lines.push('Feedback:');
84
+ lines.push('O que deu errado (saída das ferramentas):');
80
85
  for (const line of result.feedback) lines.push(` ${line}`);
81
86
  }
82
87
 
@@ -84,6 +89,21 @@ function formatVerifyResult(result) {
84
89
  return lines.join('\n');
85
90
  }
86
91
 
92
+ const NOT_SAVED = {
93
+ filtered: 'rodou só parte dos testes (--filter)',
94
+ 'skip-tests': 'pulou os testes (--skip-tests)',
95
+ 'skip-build': 'pulou a compilação (--skip-build)',
96
+ 'no-persist-flag': 'foi pedido para não gravar (--no-persist)',
97
+ 'owner-tree-elsewhere': 'a feature mora em outra pasta (worktree); só a rodada de lá conta',
98
+ 'unregistered-worktree': 'esta pasta não é a dona da feature; só a rodada da pasta dona conta',
99
+ };
100
+
101
+ function notSavedSay(reason) {
102
+ if (NOT_SAVED[reason]) return NOT_SAVED[reason];
103
+ if (String(reason).startsWith('record-baseline')) return 'a gravação da linha de base não aconteceu';
104
+ return reason;
105
+ }
106
+
87
107
  const samePath = (a, b) => canonicalPath(a).replace(/\\/g, '/') === canonicalPath(b).replace(/\\/g, '/');
88
108
 
89
109
  // Persists only in the tree that OWNS the feature (`resolveFeatureTree`, asked from the PRIMARY
@@ -167,7 +187,8 @@ async function runLocalVerify(featureName, options, fingerprint) {
167
187
  status: 'busy', persisted: false, busy: { reason: err.reason, holders, freeGb: err.freeGb, waitedMs: err.waitedMs },
168
188
  }, null, 2));
169
189
  }
170
- console.error(chalk.yellow(`\n⏳ verify não rodou: ${err.message}. Não é vermelho — a fila já esperou o prazo dela: não repita em laço — siga sem esta rodada e avise o usuário (\`morph-spec heavy status\` mostra quem segura os slots).\n`));
190
+ console.error(chalk.yellow(`\n⏳ ${TESTS[0].toUpperCase()}${TESTS.slice(1)} não rodaram: ${err.message}. Isso não é falha: a máquina estava ocupada e a fila já esperou o prazo dela.`));
191
+ console.error(chalk.gray(` ${SESSION_MARK} não repita em laço; siga sem esta rodada e avise o usuário (\`morph-spec heavy status\` mostra quem segura os slots).\n`));
171
192
  const hint = memoryBusyHint(err, process.cwd());
172
193
  if (hint) console.error(chalk.yellow(`${hint}\n`));
173
194
  process.exit(3);
@@ -246,7 +267,7 @@ export async function verifyCommand(featureName, options = {}) {
246
267
  feature = null;
247
268
  }
248
269
  if (!feature) {
249
- console.error(chalk.red(`\n❌ Feature not found: ${featureName}\n`));
270
+ console.error(chalk.red(`\n❌ Não achei a feature ${featureName} neste projeto.\n`));
250
271
  process.exit(2);
251
272
  }
252
273
  // A green run of this same tree, complete or affected, already covers what an affected run selects.
@@ -368,14 +389,14 @@ export async function verifyCommand(featureName, options = {}) {
368
389
  };
369
390
  console.log(JSON.stringify(output, null, 2));
370
391
  } else {
371
- console.log(formatVerifyResult(result));
392
+ console.log(formatVerifyResult(result, ownerRef(process.cwd(), featureName, feature)));
372
393
  if (cleanup.status !== 'skipped') {
373
394
  const mark = cleanup.status === 'ran' ? chalk.green('✓') : chalk.yellow('⚠');
374
395
  console.log(chalk.gray(`${mark} dotnet build-server shutdown: ${cleanup.status}${cleanup.reason ? ` (${cleanup.reason})` : ''}\n`));
375
396
  }
376
397
  if (repeatOf) {
377
- console.log(chalk.yellow(`⚠️ Mesma árvore do verify de ${repeatOf.ts} (${repeatOf.status}): nada mudou fora de .morph/ desde então. `
378
- + 'Esta rodada não prova nada novo — reuse o resultado anterior, a menos que o ambiente (Docker, banco, serviço externo) tenha mudado.\n'));
398
+ console.log(chalk.yellow(`⚠️ O código é o mesmo da rodada de ${repeatOf.ts} (${RESULT_SAY[repeatOf.status] ?? repeatOf.status}). Esta rodada não prova nada novo.`));
399
+ console.log(chalk.gray(` ${SESSION_MARK} reuse o resultado anterior, a menos que o ambiente (Docker, banco, serviço externo) tenha mudado.\n`));
379
400
  }
380
401
  if (result.baseline?.recorded) {
381
402
  for (const u of result.baseline.updates) {
@@ -388,9 +409,9 @@ export async function verifyCommand(featureName, options = {}) {
388
409
  `));
389
410
  }
390
411
  if (persist) {
391
- console.log(chalk.gray(`Persisted: ${historyKey} (attempts: ${compact.attempts})\n`));
412
+ console.log(chalk.gray(`Resultado gravado (${compact.attempts}ª rodada${scopedRun ? ', só o que a mudança alcança' : ''}).\n`));
392
413
  } else {
393
- console.log(chalk.yellow(`⚠️ Not persisted (${reason})\n`));
414
+ console.log(chalk.yellow(`⚠️ Resultado não gravado (${reason}): ${notSavedSay(reason)}. A aprovação só aceita uma rodada completa e gravada.\n`));
394
415
  }
395
416
  }
396
417
 
@@ -14,15 +14,15 @@ export const KIND_META = {
14
14
  prompt: { label: 'Você', icon: ChatCircleText },
15
15
  question: { label: 'Perguntas', icon: Question },
16
16
  skill: { label: 'Skills', icon: BookOpenText },
17
- dispatch: { label: 'Despachos', icon: PaperPlaneTilt },
17
+ dispatch: { label: 'Ajudantes chamados', icon: PaperPlaneTilt },
18
18
  handback: { label: 'Retornos', icon: ArrowBendDownLeft },
19
- verify: { label: 'Verify', icon: ShieldCheck },
20
- gate: { label: 'Gates', icon: Flag },
19
+ verify: { label: 'Testes automáticos', icon: ShieldCheck },
20
+ gate: { label: 'Aprovações', icon: Flag },
21
21
  failure: { label: 'Falhas', icon: WarningOctagon },
22
22
  write: { label: 'Escritas', icon: PencilSimpleLine },
23
23
  read: { label: 'Leituras', icon: Eye },
24
24
  command: { label: 'Comandos', icon: TerminalWindow },
25
- tool: { label: 'Outras tools', icon: Wrench },
25
+ tool: { label: 'Outras ferramentas', icon: Wrench },
26
26
  };
27
27
  const DEFAULT = ['prompt', 'question', 'skill', 'dispatch', 'handback', 'verify', 'gate', 'failure'];
28
28
 
@@ -38,12 +38,12 @@ function Line({ item, showFeature, project }) {
38
38
  <div className="min-w-0">
39
39
  <p className="text-sm text-[var(--color-fg)]">
40
40
  {item.refs?.persona ? (
41
- <>{item.title.replace(`morph-${item.refs.persona}`, '')}<EntityLink kind="persona" id={item.refs.persona}>morph-{item.refs.persona}</EntityLink></>
41
+ <>Chamou <EntityLink kind="persona" id={item.refs.persona}>{item.title.replace(/^Chamou /, '')}</EntityLink></>
42
42
  ) : item.refs?.skill ? (
43
43
  <>Carregou a skill <EntityLink kind="skill" id={item.refs.skill} /></>
44
44
  ) : item.title}
45
45
  {showFeature && item.feature && (
46
- <Link to={featureHref(project, item.feature)} className="ml-2 text-xs text-[var(--color-faint)] hover:text-[var(--color-dim)]">{item.feature}</Link>
46
+ <Link to={featureHref(project, item.feature)} className="ml-2 text-xs text-[var(--color-faint)] hover:text-[var(--color-dim)]">{item.featureTitle ?? item.feature}</Link>
47
47
  )}
48
48
  {item.phase && (
49
49
  <span className="ml-2 text-xs" style={{ color: phaseMeta(item.phase).color }}>{phaseMeta(item.phase).label.toLowerCase()}</span>
@@ -56,7 +56,7 @@ function Line({ item, showFeature, project }) {
56
56
  {item.nodes?.length > 0 && (
57
57
  <p className="mt-1 flex flex-wrap gap-x-3 gap-y-1 font-mono text-xs">
58
58
  {item.nodes.map((n) => (
59
- <span key={n.name} className={NODE_TONE[n.status] || 'text-[var(--color-dim)]'}>{n.name} {n.status}</span>
59
+ <span key={n.name} className={NODE_TONE[n.status] || 'text-[var(--color-dim)]'}>{n.label ?? `${n.name} ${n.status}`}</span>
60
60
  ))}
61
61
  </p>
62
62
  )}
@@ -100,7 +100,7 @@ export function FeedView({ items, kinds, onToggleKind, showFeature, onMore, hasM
100
100
  </div>
101
101
  {items.length === 0 && (
102
102
  <p className="text-sm text-[var(--color-dim)]">
103
- Nada registrado com esses filtros. A telemetria vem de <code className="font-mono">.morph/logs/events.jsonl</code>, gravada pelos hooks enquanto o Claude trabalha.
103
+ Nada registrado com esses filtros. O histórico é gravado automaticamente enquanto o Claude trabalha.
104
104
  </p>
105
105
  )}
106
106
  {byDay(items).map((g) => (
@@ -45,7 +45,7 @@ function featureIndex(project, features, projectName = null) {
45
45
  const out = [];
46
46
  const where = (text) => (projectName ? (text ? `${projectName}: ${text}` : projectName) : text);
47
47
  for (const f of features || []) {
48
- out.push({ kind: 'feature', title: f.name, hint: where(f.description), to: featureHref(project, f.name), hay: `${f.name} ${f.description || ''} ${projectName || ''}` });
48
+ out.push({ kind: 'feature', title: f.title || f.name, hint: where(f.description), to: featureHref(project, f.name), hay: `${f.title || ''} ${f.name} ${f.description || ''} ${projectName || ''}` });
49
49
  }
50
50
  return out;
51
51
  }
@@ -1,5 +1,6 @@
1
1
  import { useMorphQuery } from '../hooks/useMorphQuery.js';
2
2
  import { apiBase } from '../lib/project.js';
3
+ import { GATE_LABEL, signalLabel } from '../lib/phases.js';
3
4
 
4
5
  // Validated with the dataviz palette checker against --color-core (#12151b), dark mode.
5
6
  const SESSION = '#26a69a';
@@ -7,7 +8,6 @@ const HUMAN = '#d07f27';
7
8
  // Not a series: pauses logged before the resolver existed, so nobody knows who cleared them.
8
9
  const UNKNOWN = 'var(--color-gray-500)';
9
10
  const GATE_ORDER = ['plan', 'uiux', 'review'];
10
- const GATE_LABEL = { plan: 'Plano', uiux: 'Design', review: 'Gate 3' };
11
11
 
12
12
  function split(s = {}) {
13
13
  const unknown = s.pausedUnattributed ?? 0;
@@ -42,7 +42,7 @@ function Bar({ row, max }) {
42
42
  const total = row.session + row.human + row.unknown;
43
43
  const describe = parts.map(([, n, , what]) => `${what} ${n}`).join(', ');
44
44
  return (
45
- <div className="grid grid-cols-[4.5rem_1fr_auto] items-center gap-3">
45
+ <div className="grid grid-cols-[10rem_1fr_auto] items-center gap-3">
46
46
  <span className="text-sm text-[var(--color-fg)]">{row.label}</span>
47
47
  <div className="flex h-3 gap-[2px]" role="img" aria-label={`${row.label}: ${describe || 'nenhuma pausa'}`}>
48
48
  {parts.map(([key, n, color, what], i) => (
@@ -60,7 +60,7 @@ function Bar({ row, max }) {
60
60
  export function GatePausesView({ gates }) {
61
61
  const rows = gateRows(gates);
62
62
  if (rows.length === 0) {
63
- return <p className="text-sm text-[var(--color-faint)]">Nenhuma decisão de gate na telemetria ainda.</p>;
63
+ return <p className="text-sm text-[var(--color-faint)]">Nenhuma aprovação registrada ainda.</p>;
64
64
  }
65
65
  const max = Math.max(1, ...rows.map((r) => r.session + r.human + r.unknown));
66
66
  const signals = humanSignals(gates);
@@ -68,7 +68,7 @@ export function GatePausesView({ gates }) {
68
68
  return (
69
69
  <div className="space-y-5">
70
70
  <div className="flex flex-wrap items-baseline justify-between gap-2">
71
- <h2 className="text-base font-semibold">Pausas por gate</h2>
71
+ <h2 className="text-base font-semibold">Paradas em cada aprovação</h2>
72
72
  <div className="flex flex-wrap gap-x-4 gap-y-1 text-xs text-[var(--color-dim)]" aria-hidden="true">
73
73
  <Swatch color={SESSION}>a sessão resolveu</Swatch>
74
74
  <Swatch color={HUMAN}>foi para você</Swatch>
@@ -84,8 +84,8 @@ export function GatePausesView({ gates }) {
84
84
  <caption className="mb-2 text-left text-xs text-[var(--color-dim)]">O que mais te chamou</caption>
85
85
  <thead className="text-xs text-[var(--color-faint)]">
86
86
  <tr>
87
- <th className="pb-1 text-left font-normal">sinal</th>
88
- <th className="pb-1 text-left font-normal">gate</th>
87
+ <th className="pb-1 text-left font-normal">motivo</th>
88
+ <th className="pb-1 text-left font-normal">aprovação</th>
89
89
  <th className="pb-1 text-right font-normal">para você</th>
90
90
  <th className="pb-1 text-right font-normal">sessão</th>
91
91
  {anyUnknown && <th className="pb-1 text-right font-normal">antes</th>}
@@ -94,7 +94,7 @@ export function GatePausesView({ gates }) {
94
94
  <tbody>
95
95
  {signals.map((s) => (
96
96
  <tr key={`${s.gate}:${s.signal}`} className="border-t border-[var(--color-hair)]">
97
- <td className="py-1.5 font-mono text-xs text-[var(--color-fg)]">{s.signal}</td>
97
+ <td className="py-1.5 text-[var(--color-fg)]" title={s.signal}>{signalLabel(s.signal)}</td>
98
98
  <td className="py-1.5 text-[var(--color-dim)]">{GATE_LABEL[s.gate] ?? s.gate}</td>
99
99
  <td className="py-1.5 text-right tabular-nums text-[var(--color-fg)]">{s.human}</td>
100
100
  <td className="py-1.5 text-right tabular-nums text-[var(--color-dim)]">{s.session}</td>
@@ -110,7 +110,7 @@ export function GatePausesView({ gates }) {
110
110
 
111
111
  export default function GatePauses({ project }) {
112
112
  const { data, error } = useMorphQuery(`${apiBase(project)}/gates`, { scope: 'activity', project });
113
- if (error) return <p className="text-sm text-[var(--color-bad)]">Não consegui ler os gates: {error}</p>;
113
+ if (error) return <p className="text-sm text-[var(--color-bad)]">Não consegui ler as aprovações: {error}</p>;
114
114
  if (!data) return <p className="text-sm text-[var(--color-faint)]">Lendo a telemetria…</p>;
115
115
  return <GatePausesView gates={data.gates} />;
116
116
  }
@@ -28,9 +28,9 @@ const NOTCH_CLASS = {
28
28
 
29
29
  function gateTitle(g) {
30
30
  const label = GATE_LABEL[g.gate] || g.gate;
31
- if (g.approved) return `${label}: aprovado${g.approvedBy ? ` por ${g.approvedBy}` : ''}`;
32
- if (g.paused) return `${label}: pausado${g.reason ? `, ${g.reason}` : ''}`;
33
- return `${label}: pendente`;
31
+ if (g.approved) return `${label}: aprovada${g.approvedBy && g.approvedBy !== 'auto' ? ` por ${g.approvedBy}` : ''}`;
32
+ if (g.paused) return `${label}: esperando você${g.reason ? `, ${g.reason}` : ''}`;
33
+ return `${label}: ainda não chegou`;
34
34
  }
35
35
 
36
36
  export default function PhaseRail({ feature, size = 'sm' }) {
@@ -39,7 +39,7 @@ export default function PhaseRail({ feature, size = 'sm' }) {
39
39
  const current = phaseMeta(feature.phase);
40
40
  const summary = feature.status === 'completed'
41
41
  ? 'Concluída'
42
- : `Fase atual: ${current.label}${feature.inEvaluation ? ' (avaliação em andamento)' : ''}`;
42
+ : `Etapa atual: ${current.label}${feature.inEvaluation ? ' (revisão independente em andamento)' : ''}`;
43
43
 
44
44
  return (
45
45
  <div className={lg ? 'w-full' : 'w-full min-w-[9rem]'} role="img" aria-label={summary}>
@@ -85,10 +85,10 @@ export default function PhaseRail({ feature, size = 'sm' }) {
85
85
  >
86
86
  {s.label}
87
87
  </p>
88
- {s.state === 'skipped' && <p className="truncate text-[11px] text-[var(--color-faint)]">fase não usada</p>}
88
+ {s.state === 'skipped' && <p className="truncate text-[11px] text-[var(--color-faint)]">etapa não usada</p>}
89
89
  {s.state !== 'skipped' && s.gate && !s.gate.skipped && (
90
90
  <p className="truncate text-[11px] text-[var(--color-faint)]">
91
- {s.gate.approved ? `aprovado${s.gate.approvedBy ? `, ${s.gate.approvedBy}` : ''}` : s.gate.paused ? 'gate pausado' : 'gate pendente'}
91
+ {s.gate.approved ? `aprovada${s.gate.approvedBy && s.gate.approvedBy !== 'auto' ? `, ${s.gate.approvedBy}` : ''}` : s.gate.paused ? 'esperando você' : 'aprovação pendente'}
92
92
  </p>
93
93
  )}
94
94
  </div>
@@ -1,17 +1,17 @@
1
1
  import { clock, timeAgo } from '../lib/format.js';
2
2
 
3
3
  const MARK = {
4
- verify: { label: 'verify', color: (m) => (m.status === 'fail' ? 'var(--color-bad)' : 'var(--color-ok)') },
4
+ verify: { label: 'testes automáticos', color: (m) => (m.status === 'fail' ? 'var(--color-bad)' : 'var(--color-ok)') },
5
5
  failure: { label: 'falha', color: () => 'var(--color-bad)' },
6
- gate: { label: 'gate', color: () => 'var(--color-fg)' },
7
- dispatch: { label: 'sub-agent', color: () => 'var(--color-phase-uiux)' },
8
- handback: { label: 'sub-agent', color: () => 'var(--color-phase-uiux)' },
6
+ gate: { label: 'aprovação', color: () => 'var(--color-fg)' },
7
+ dispatch: { label: 'ajudante', color: () => 'var(--color-phase-uiux)' },
8
+ handback: { label: 'ajudante', color: () => 'var(--color-phase-uiux)' },
9
9
  prompt: { label: 'você', color: () => 'var(--color-dim)' },
10
10
  question: { label: 'você', color: () => 'var(--color-dim)' },
11
11
  };
12
12
  const LEGEND = [
13
- ['verify verde', 'var(--color-ok)'], ['verify vermelho ou falha', 'var(--color-bad)'],
14
- ['gate', 'var(--color-fg)'], ['sub-agent', 'var(--color-phase-uiux)'], ['você', 'var(--color-dim)'],
13
+ ['testes passaram', 'var(--color-ok)'], ['testes falharam ou erro', 'var(--color-bad)'],
14
+ ['aprovação', 'var(--color-fg)'], ['ajudante', 'var(--color-phase-uiux)'], ['você', 'var(--color-dim)'],
15
15
  ];
16
16
 
17
17
  function Strip({ session }) {
@@ -34,7 +34,7 @@ function Strip({ session }) {
34
34
  }
35
35
 
36
36
  export default function SessionMap({ session, now = Date.now() }) {
37
- if (session === undefined) return <p className="text-sm text-[var(--color-faint)]">Lendo a telemetria…</p>;
37
+ if (session === undefined) return <p className="text-sm text-[var(--color-faint)]">Lendo o histórico…</p>;
38
38
  if (!session) return <p className="text-sm text-[var(--color-faint)]">Nenhuma ação registrada para esta feature ainda.</p>;
39
39
  return (
40
40
  <div className="space-y-4">
@@ -1,4 +1,6 @@
1
- const rtf = new Intl.RelativeTimeFormat('pt-BR', { numeric: 'auto' });
1
+ import { VERDICT_SAY } from '../../../../framework/hooks/shared/owner-words.js';
2
+
3
+ const rtf =new Intl.RelativeTimeFormat('pt-BR', { numeric: 'auto' });
2
4
  const UNITS = [
3
5
  ['year', 365 * 24 * 3600],
4
6
  ['month', 30 * 24 * 3600],
@@ -61,5 +63,7 @@ export function splitFrontmatter(text) {
61
63
 
62
64
  export function verdictLabel(f) {
63
65
  if (!f?.verdict) return null;
64
- return f.blockers ? `${f.verdict} · ${f.blockers} bloq.` : f.verdict;
66
+ const word = VERDICT_SAY[f.verdict] ?? f.verdict;
67
+ if (!f.blockers) return word;
68
+ return `${word} · ${f.blockers} ${f.blockers === 1 ? 'problema' : 'problemas'}`;
65
69
  }
@@ -1,16 +1,17 @@
1
- /** The ORDER and the optional flag come from framework/phases.json; this file only adds words and colours. */
2
1
  import morphData from 'virtual:morph-data';
2
+ import {
3
+ PHASE_NAME, GATE_NAME, VERDICT_SAY, ROLE_NAME, STATUS_SAY, WORK_NAME, PROOF_SAY, CHECK_RESULT_SAY,
4
+ BLOCKER_SAY, VERIFY_STEP_SAY, RESULT_SAY, scenarioLabel,
5
+ } from '../../../../framework/hooks/shared/owner-words.js';
3
6
 
4
- const LABELS = {
5
- plan: 'Plano',
6
- uiux: 'UI/UX',
7
- implement: 'Implementação',
8
- review: 'Revisão',
7
+ export {
8
+ GATE_NAME as GATE_LABEL, VERDICT_SAY, ROLE_NAME, STATUS_SAY, WORK_NAME, PROOF_SAY, CHECK_RESULT_SAY,
9
+ BLOCKER_SAY, VERIFY_STEP_SAY, RESULT_SAY, scenarioLabel,
9
10
  };
10
11
 
11
12
  export const PHASES = (morphData.phases?.list || []).map((p) => ({
12
13
  id: p.id,
13
- label: LABELS[p.id] || p.displayName || p.id,
14
+ label: PHASE_NAME[p.id] || p.displayName || p.id,
14
15
  optional: Boolean(p.optional),
15
16
  folder: p.folder || null,
16
17
  skill: p.skill || null,
@@ -20,15 +21,9 @@ export const PHASES = (morphData.phases?.list || []).map((p) => ({
20
21
  export const PHASE_INDEX = Object.fromEntries(PHASES.map((p, i) => [p.id, i]));
21
22
 
22
23
  export function phaseMeta(id) {
23
- return PHASES.find((p) => p.id === id) || { id, label: LABELS[id] || id || '—', color: 'var(--color-faint)', optional: false };
24
+ return PHASES.find((p) => p.id === id) || { id, label: PHASE_NAME[id] || id || '—', color: 'var(--color-faint)', optional: false };
24
25
  }
25
26
 
26
- export const GATE_LABEL = {
27
- plan: 'Gate do plano',
28
- uiux: 'Gate UI/UX',
29
- review: 'Gate 3 (revisão)',
30
- };
31
-
32
27
  export const STATUS_LABEL = {
33
28
  draft: 'Rascunho',
34
29
  in_progress: 'Em andamento',
@@ -37,7 +32,44 @@ export const STATUS_LABEL = {
37
32
  };
38
33
 
39
34
  export const LOCATION_LABEL = {
40
- root: 'raiz',
41
- worktree: 'worktree',
35
+ root: 'pasta principal',
36
+ worktree: 'cópia de trabalho separada',
42
37
  archive: 'arquivo',
43
38
  };
39
+
40
+ export const TRUST_SAY = {
41
+ auto: 'aprova sozinho quando não há risco',
42
+ manual: 'você aprova tudo',
43
+ };
44
+
45
+ export const SIGNAL_SAY = {
46
+ 'design-system': 'tela fora do padrão visual do projeto',
47
+ 'e2e-skip': 'o teste do fluxo completo não rodou',
48
+ hotfix: 'correção urgente sempre passa por você',
49
+ manual: 'você pediu para aprovar tudo',
50
+ 'media-claims': 'a entrega gera imagem, áudio ou vídeo',
51
+ 'plan-checks': 'o plano tem um cenário que precisa de você',
52
+ 'plan-critique': 'a crítica do plano levantou dúvidas',
53
+ 'prompt-model-eval-skip': 'a avaliação da IA não rodou',
54
+ 'prompt-model-no-eval': 'mudança na IA sem avaliação da resposta',
55
+ 'review-reports': 'a revisão independente pediu correção',
56
+ rung: 'um passo dá trabalho para desfazer',
57
+ 'rung-undeclared': 'um passo sem volta que o plano não avisou',
58
+ 'screen-checklist': 'a conferência das telas está incompleta',
59
+ standards: 'o código foge das regras do projeto',
60
+ 'trust-manual': 'você pediu para aprovar tudo',
61
+ 'uiux-checklist': 'a conferência das telas está incompleta',
62
+ 'verify-missing': 'os testes automáticos ainda não rodaram',
63
+ 'verify-red': 'os testes automáticos estão falhando',
64
+ 'verify-stale': 'o código mudou depois dos testes automáticos',
65
+ };
66
+
67
+ export const signalLabel = (key) => SIGNAL_SAY[key] ?? String(key ?? '').replace(/-/g, ' ');
68
+
69
+ export const workLabel = (type) => WORK_NAME[type || 'feature'] ?? type;
70
+
71
+ export const featureTitle = (f) => f?.title || f?.name || '';
72
+
73
+ export function verdictWord(verdict) {
74
+ return verdict ? VERDICT_SAY[verdict] ?? verdict : null;
75
+ }