@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.
- package/README.md +2 -2
- package/bin/morph-spec.js +2 -0
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/CLAUDE.md +4 -3
- package/framework/MORPH.md +14 -12
- package/framework/commands/morph-review.md +1 -1
- package/framework/commands/morph-status.md +2 -6
- package/framework/docs/CLI.md +21 -6
- package/framework/hooks/claude-code/core/enforce-phase-writes.js +12 -11
- package/framework/hooks/claude-code/core/gate-guard.js +19 -14
- package/framework/hooks/claude-code/core/heavy-gate.js +4 -1
- package/framework/hooks/claude-code/core/loop-detect.js +8 -7
- package/framework/hooks/claude-code/core/masked-exit.js +5 -2
- package/framework/hooks/claude-code/core/protect-spec-files.js +13 -11
- package/framework/hooks/claude-code/core/state-sync.js +20 -12
- package/framework/hooks/claude-code/core/validate-completion.js +6 -5
- package/framework/hooks/claude-code/core/worktree-context.js +47 -43
- package/framework/hooks/shared/gate-question.js +8 -0
- package/framework/hooks/shared/next-step.js +54 -23
- package/framework/hooks/shared/owner-words.js +146 -0
- package/framework/hooks/shared/report-progress.js +84 -10
- package/framework/phases.json +7 -7
- package/framework/rules/implement-report.md +8 -7
- package/framework/rules/plan-grammar.md +4 -1
- package/framework/schemas/feature.schema.json +3 -2
- package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
- package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
- package/framework/skills/core/morph-apply/SKILL.md +6 -5
- package/framework/skills/core/morph-apply/references/hotfix.md +6 -2
- package/framework/skills/core/morph-apply/references/review.md +9 -5
- package/framework/skills/core/morph-plan/SKILL.md +5 -5
- package/framework/skills/core/morph-plan/references/interview.md +1 -1
- package/framework/skills/core/morph-uiux/SKILL.md +10 -6
- package/framework/templates/docs/plan.md +1 -1
- package/package.json +1 -1
- package/src/commands/e2e/e2e.js +31 -29
- package/src/commands/project/status.js +28 -184
- package/src/commands/state/advance.js +44 -20
- package/src/commands/state/approve.js +70 -59
- package/src/commands/state/archive.js +20 -15
- package/src/commands/state/auto-approval.js +25 -23
- package/src/commands/state/create.js +35 -32
- package/src/commands/state/finish.js +179 -58
- package/src/commands/state/gate-check.js +43 -31
- package/src/commands/state/gate-decision.js +18 -14
- package/src/commands/state/list.js +23 -14
- package/src/commands/state/next.js +4 -5
- package/src/commands/state/report-check.js +47 -23
- package/src/commands/validation/plan-check.js +30 -14
- package/src/commands/validation/verify.js +39 -18
- package/src/dashboard/app/components/ActivityFeed.jsx +8 -8
- package/src/dashboard/app/components/CommandPalette.jsx +1 -1
- package/src/dashboard/app/components/GatePauses.jsx +8 -8
- package/src/dashboard/app/components/PhaseRail.jsx +6 -6
- package/src/dashboard/app/components/SessionMap.jsx +7 -7
- package/src/dashboard/app/lib/format.js +6 -2
- package/src/dashboard/app/lib/phases.js +48 -16
- package/src/dashboard/app/pages/FeatureDetail.jsx +87 -59
- package/src/dashboard/app/pages/Features.jsx +18 -18
- package/src/dashboard/app/pages/Guide.jsx +4 -4
- package/src/dashboard/app/pages/PhasePipeline.jsx +7 -7
- package/src/dashboard/app/pages/Portfolio.jsx +3 -3
- package/src/dashboard/scanner/activity-scanner.js +20 -6
- package/src/dashboard/scanner/features-scanner.js +43 -8
- package/src/dashboard/scanner/project-api.js +2 -0
- package/src/dashboard/vite.config.js +2 -0
- package/src/lib/next-step.js +3 -2
- package/src/lib/plan/checks.js +30 -15
- package/src/lib/plan/critique.js +6 -4
- package/src/lib/recap/recap.js +46 -20
- package/src/lib/risk-detector.js +260 -98
- package/src/lib/view/feature-html.js +19 -25
- package/src/lib/view/feature-view.js +6 -6
- package/src/utils/audience.js +27 -0
- package/src/utils/refusal-line.js +2 -2
|
@@ -1,98 +1,13 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import {
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { getFeature, derivePhase, deriveOutputs } from '../../core/state/state-manager.js';
|
|
3
4
|
import { implementProgress } from '../../../framework/hooks/shared/report-progress.js';
|
|
4
|
-
import {
|
|
5
|
+
import { PHASE_NAME, retrato } from '../../../framework/hooks/shared/owner-words.js';
|
|
5
6
|
import { nextStepFor } from '../../lib/next-step.js';
|
|
6
7
|
|
|
7
|
-
const PHASE_SYMBOLS = {
|
|
8
|
-
completed: '✅',
|
|
9
|
-
current: '⏸️',
|
|
10
|
-
pending: '⬜',
|
|
11
|
-
skipped: '⊘'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const PHASE_ORDER = [
|
|
15
|
-
{ key: 'plan', name: 'FASE 1: PLAN', order: 0 },
|
|
16
|
-
{ key: 'uiux', name: 'FASE 2: UI/UX', order: 1, optional: true },
|
|
17
|
-
{ key: 'implement', name: 'FASE 3: IMPLEMENT', order: 2 },
|
|
18
|
-
{ key: 'review', name: 'FASE 4: REVIEW', order: 3 }
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
const PHASE_OUTPUTS = {
|
|
22
|
-
plan: ['plan', 'checks'],
|
|
23
|
-
uiux: ['uiMockups'],
|
|
24
|
-
implement: ['implementReport'],
|
|
25
|
-
review: ['verifierReport', 'reviewerReport']
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
function getPhaseStatus(phaseKey, currentPhase, feature) {
|
|
29
|
-
const phase = PHASE_ORDER.find(p => p.key === phaseKey);
|
|
30
|
-
const current = PHASE_ORDER.find(p => p.key === currentPhase);
|
|
31
|
-
|
|
32
|
-
if (!phase || !current) return 'pending';
|
|
33
|
-
|
|
34
|
-
if (phase.optional && phase.order < current.order) {
|
|
35
|
-
const hasOutputs = checkPhaseOutputs(phaseKey, feature);
|
|
36
|
-
if (!hasOutputs) return 'skipped';
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (phase.order < current.order) return 'completed';
|
|
40
|
-
if (phase.order === current.order) return 'current';
|
|
41
|
-
return 'pending';
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function checkPhaseOutputs(phaseKey, feature) {
|
|
45
|
-
const outputs = PHASE_OUTPUTS[phaseKey] || [];
|
|
46
|
-
return outputs.some(output => feature.outputs[output]?.created);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function formatPhase(phaseKey, currentPhase, feature, options = {}) {
|
|
50
|
-
const phase = PHASE_ORDER.find(p => p.key === phaseKey);
|
|
51
|
-
const status = getPhaseStatus(phaseKey, currentPhase, feature);
|
|
52
|
-
const symbol = PHASE_SYMBOLS[status];
|
|
53
|
-
|
|
54
|
-
let display = `${symbol} ${phase.name}`;
|
|
55
|
-
|
|
56
|
-
if (phase.optional) {
|
|
57
|
-
display += ` ${chalk.gray('(optional)')}`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (status === 'current') {
|
|
61
|
-
display = chalk.cyan(display) + chalk.cyan(' ← CURRENT');
|
|
62
|
-
} else if (status === 'completed') {
|
|
63
|
-
display = chalk.green(display);
|
|
64
|
-
} else if (status === 'skipped') {
|
|
65
|
-
display = chalk.gray(display + ' (skipped)');
|
|
66
|
-
} else {
|
|
67
|
-
display = chalk.gray(display);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (options.verbose && status !== 'pending' && status !== 'skipped') {
|
|
71
|
-
const outputs = PHASE_OUTPUTS[phaseKey] || [];
|
|
72
|
-
const created = outputs.filter(o => feature.outputs[o]?.created);
|
|
73
|
-
if (created.length > 0) {
|
|
74
|
-
display += chalk.gray(`\n Files: ${created.length}/${outputs.length}`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return display;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function calculateCompletionPercentage(feature) {
|
|
82
|
-
const totalPhases = PHASE_ORDER.filter(p => !p.optional).length;
|
|
83
|
-
const completedPhases = PHASE_ORDER.filter(p => {
|
|
84
|
-
if (p.optional) return false;
|
|
85
|
-
const status = getPhaseStatus(p.key, feature.phase, feature);
|
|
86
|
-
return status === 'completed';
|
|
87
|
-
}).length;
|
|
88
|
-
|
|
89
|
-
return Math.round((completedPhases / totalPhases) * 100);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
8
|
export async function statusCommand(featureName, options = {}) {
|
|
93
9
|
if (!featureName) {
|
|
94
|
-
console.error(chalk.red('✗
|
|
95
|
-
console.error(chalk.gray('Usage: morph-spec status <feature-name>'));
|
|
10
|
+
console.error(chalk.red('✗ Diga qual feature: morph-spec status <feature>'));
|
|
96
11
|
process.exit(1);
|
|
97
12
|
}
|
|
98
13
|
|
|
@@ -100,118 +15,47 @@ export async function statusCommand(featureName, options = {}) {
|
|
|
100
15
|
try {
|
|
101
16
|
feature = getFeature(featureName);
|
|
102
17
|
} catch (err) {
|
|
103
|
-
console.error(chalk.red(`✗
|
|
104
|
-
console.error(chalk.gray('
|
|
18
|
+
console.error(chalk.red(`✗ Não consegui ler o estado do projeto: ${err.message}`));
|
|
19
|
+
console.error(chalk.gray('Para diagnosticar: morph-spec doctor'));
|
|
105
20
|
process.exit(1);
|
|
106
21
|
}
|
|
107
22
|
if (!feature) {
|
|
108
|
-
console.error(chalk.red(`✗
|
|
109
|
-
console.error(chalk.gray(`Run 'morph-spec status' to list known features`));
|
|
23
|
+
console.error(chalk.red(`✗ Não achei a feature ${featureName} neste projeto.`));
|
|
110
24
|
process.exit(1);
|
|
111
25
|
}
|
|
112
26
|
|
|
113
|
-
const { join } = await import('path');
|
|
114
27
|
const featurePath = join(process.cwd(), '.morph', 'features', featureName);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
if (!feature.outputs) {
|
|
119
|
-
feature.outputs = deriveOutputs(featureName, process.cwd());
|
|
120
|
-
}
|
|
121
|
-
const scenarios = implementProgress(featurePath);
|
|
28
|
+
const phase = feature.phase || derivePhase(featurePath);
|
|
29
|
+
const next = nextStepFor(featureName, process.cwd());
|
|
122
30
|
|
|
123
31
|
if (options.json) {
|
|
124
|
-
const
|
|
32
|
+
const order = ['plan', 'uiux', 'implement', 'review'];
|
|
33
|
+
const at = order.indexOf(phase);
|
|
34
|
+
const phases = order.map((key, i) => ({
|
|
35
|
+
key, name: PHASE_NAME[key], optional: key === 'uiux',
|
|
36
|
+
status: i < at ? 'completed' : i === at ? 'current' : 'pending',
|
|
37
|
+
}));
|
|
38
|
+
const required = phases.filter((p) => !p.optional);
|
|
39
|
+
console.log(JSON.stringify({
|
|
125
40
|
feature: featureName,
|
|
126
|
-
phase
|
|
41
|
+
phase,
|
|
42
|
+
phaseName: PHASE_NAME[phase] ?? phase,
|
|
127
43
|
status: feature.status,
|
|
128
|
-
completion:
|
|
129
|
-
phases
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
status: getPhaseStatus(p.key, feature.phase, feature),
|
|
133
|
-
optional: p.optional || false
|
|
134
|
-
})),
|
|
135
|
-
outputs: Object.entries(feature.outputs).map(([key, output]) => ({
|
|
136
|
-
type: key,
|
|
137
|
-
created: output.created,
|
|
138
|
-
path: output.path
|
|
139
|
-
})),
|
|
140
|
-
scenarios,
|
|
44
|
+
completion: Math.round((required.filter((p) => p.status === 'completed').length / required.length) * 100),
|
|
45
|
+
phases,
|
|
46
|
+
outputs: Object.entries(feature.outputs || deriveOutputs(featureName, process.cwd())).map(([type, o]) => ({ type, created: o.created, path: o.path })),
|
|
47
|
+
scenarios: implementProgress(featurePath),
|
|
141
48
|
approvals: feature.approvalGates || {},
|
|
142
|
-
next
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
console.log(JSON.stringify(status, null, 2));
|
|
49
|
+
next,
|
|
50
|
+
}, null, 2));
|
|
146
51
|
return;
|
|
147
52
|
}
|
|
148
53
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
console.log(chalk.cyan('└────────────────────────────────────────────────────────────┘\n'));
|
|
152
|
-
|
|
153
|
-
console.log(chalk.white.bold(`Feature: ${featureName}`));
|
|
154
|
-
console.log(chalk.gray(`Status: ${feature.status || 'unknown'}`));
|
|
155
|
-
console.log(chalk.gray(`Completion: ${calculateCompletionPercentage(feature)}%`));
|
|
54
|
+
const lines = next?.retrato
|
|
55
|
+
?? retrato({ slug: featureName, feature, progress: implementProgress(featurePath), phase });
|
|
156
56
|
console.log('');
|
|
157
|
-
|
|
158
|
-
console.log(chalk.white.bold('Phases:'));
|
|
159
|
-
console.log(chalk.cyan('├─────────────────────────────────────────────────────────────┤'));
|
|
160
|
-
PHASE_ORDER.forEach(phase => {
|
|
161
|
-
console.log(`│ ${formatPhase(phase.key, feature.phase, feature, options)}`);
|
|
162
|
-
});
|
|
163
|
-
console.log(chalk.cyan('└─────────────────────────────────────────────────────────────┘'));
|
|
57
|
+
for (const line of lines) console.log(line);
|
|
164
58
|
console.log('');
|
|
165
|
-
|
|
166
|
-
const totalOutputs = Object.keys(feature.outputs).length;
|
|
167
|
-
const createdOutputs = Object.values(feature.outputs).filter(o => o.created).length;
|
|
168
|
-
console.log(chalk.white.bold(`Outputs: ${createdOutputs}/${totalOutputs} complete`));
|
|
169
|
-
|
|
170
|
-
if (options.verbose) {
|
|
171
|
-
console.log(chalk.gray('Output files:'));
|
|
172
|
-
Object.entries(feature.outputs).forEach(([key, output]) => {
|
|
173
|
-
const symbol = output.created ? '✅' : '⬜';
|
|
174
|
-
const display = output.created ? chalk.green(key) : chalk.gray(key);
|
|
175
|
-
console.log(` ${symbol} ${display}`);
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
console.log('');
|
|
179
|
-
|
|
180
|
-
if (scenarios && scenarios.total > 0) {
|
|
181
|
-
console.log(chalk.white.bold('Cenários (3-implement/report.md):'));
|
|
182
|
-
const percentage = Math.round((scenarios.done / scenarios.total) * 100);
|
|
183
|
-
console.log(` Total: ${scenarios.total}`);
|
|
184
|
-
console.log(chalk.green(` ✓ Feitos: ${scenarios.done} (${percentage}%)`));
|
|
185
|
-
if (scenarios.blocked > 0) console.log(chalk.yellow(` ⏸ Bloqueados (esperam decisão): ${scenarios.blocked}`));
|
|
186
|
-
if (scenarios.pending > 0) console.log(chalk.gray(` ⬜ Pendentes: ${scenarios.pending}`));
|
|
187
|
-
console.log('');
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if (feature.approvalGates) {
|
|
191
|
-
const gates = Object.entries(feature.approvalGates);
|
|
192
|
-
const approved = gates.filter(([_, g]) => g.approved).length;
|
|
193
|
-
console.log(chalk.white.bold(`Approval Gates: ${approved}/${gates.length} approved`));
|
|
194
|
-
|
|
195
|
-
if (options.verbose) {
|
|
196
|
-
gates.forEach(([gate, info]) => {
|
|
197
|
-
const symbol = info.approved ? '✅' : '⬜';
|
|
198
|
-
const display = info.approved ? chalk.green(gate) : chalk.gray(gate);
|
|
199
|
-
let extra = '';
|
|
200
|
-
if (info.approved && info.approvedBy) {
|
|
201
|
-
extra = chalk.gray(` (by ${info.approvedBy})`);
|
|
202
|
-
}
|
|
203
|
-
console.log(` ${symbol} ${display}${extra}`);
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
console.log('');
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const next = nextStepFor(featureName, process.cwd());
|
|
210
|
-
if (next) console.log(chalk.yellow(`${formatNext(next)}\n`));
|
|
211
|
-
|
|
212
|
-
console.log(chalk.gray('─'.repeat(60)));
|
|
213
|
-
console.log(chalk.gray('Run with --verbose for detailed output'));
|
|
214
|
-
console.log(chalk.gray('Run with --json for JSON output\n'));
|
|
215
59
|
}
|
|
216
60
|
|
|
217
61
|
export default statusCommand;
|
|
@@ -8,9 +8,27 @@ import { OUTPUT_SCHEMA } from '../../core/paths/output-schema.js';
|
|
|
8
8
|
import { assertOwnerTree, ownerTreeRefusalLines } from '../../lib/worktree/feature-truth.js';
|
|
9
9
|
import { uiuxAutoApprovalBlock } from '../../lib/specs/screen-checklist.js';
|
|
10
10
|
import { seedDesignArtifacts } from '../../lib/specs/design-seed.js';
|
|
11
|
-
import { implementProgress, reportPath, reportSkeleton } from '../../../framework/hooks/shared/report-progress.js';
|
|
11
|
+
import { implementProgress, ownerRef, reportPath, reportSkeleton } from '../../../framework/hooks/shared/report-progress.js';
|
|
12
12
|
import { autoApprovalRefusal, printRefusal } from './auto-approval.js';
|
|
13
13
|
import { seedDotnetBuildIgnores } from '../../lib/stack/dotnet-build-ignores.js';
|
|
14
|
+
import { GATE_NAME, PHASE_NAME, approvedBySay, STATUS_SAY, scenarioLabel } from '../../../framework/hooks/shared/owner-words.js';
|
|
15
|
+
import { SESSION_MARK } from '../../../framework/hooks/shared/next-step.js';
|
|
16
|
+
|
|
17
|
+
const ARTIFACT_SAY = {
|
|
18
|
+
'plan.md': 'o plano',
|
|
19
|
+
'checks.json': 'a lista de cenários do plano (gerada pela validação do plano)',
|
|
20
|
+
'report.md': 'o progresso da construção',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function missingLines(missing, featurePath) {
|
|
24
|
+
const lines = missing.filter((rel) => !rel.startsWith('3-implement/report.md ('))
|
|
25
|
+
.map((rel) => `Falta ${ARTIFACT_SAY[rel.split('/').pop()] ?? rel}.`);
|
|
26
|
+
const progress = missing.some((rel) => rel.startsWith('3-implement/report.md (')) ? implementProgress(featurePath) : null;
|
|
27
|
+
for (const c of progress?.checks ?? []) {
|
|
28
|
+
if (c.status !== 'feito') lines.push(`${scenarioLabel(c)}: ${STATUS_SAY[c.status] ?? c.status}.`);
|
|
29
|
+
}
|
|
30
|
+
return lines;
|
|
31
|
+
}
|
|
14
32
|
|
|
15
33
|
const FRAMEWORK_DIR = fileURLToPath(new URL('../../../framework/', import.meta.url));
|
|
16
34
|
|
|
@@ -99,9 +117,10 @@ export async function advanceCommand(featureName, options = {}) {
|
|
|
99
117
|
try {
|
|
100
118
|
const feature = getFeature(featureName);
|
|
101
119
|
if (!feature) {
|
|
102
|
-
console.error(chalk.red(`\n
|
|
120
|
+
console.error(chalk.red(`\n✗ Funcionalidade não encontrada: ${featureName}.\n`));
|
|
103
121
|
process.exit(1);
|
|
104
122
|
}
|
|
123
|
+
const ref = ownerRef(process.cwd(), featureName, feature);
|
|
105
124
|
|
|
106
125
|
// A live worktree elsewhere owns the state: never stamp a gate onto the root skeleton.
|
|
107
126
|
const owner = assertOwnerTree(featureName, process.cwd());
|
|
@@ -122,16 +141,17 @@ export async function advanceCommand(featureName, options = {}) {
|
|
|
122
141
|
mkdirSync(join(featurePath, '1-design'), { recursive: true });
|
|
123
142
|
reportDesignSeed(seedDesignArtifacts(featureName, process.cwd()));
|
|
124
143
|
reportDotnetIgnores(seedDotnetBuildIgnores(process.cwd(), { featureName }));
|
|
125
|
-
console.log(chalk.green(`\n
|
|
144
|
+
console.log(chalk.green(`\n✓ ${ref}: o plano já estava aprovado. O desenho das telas começa agora.`));
|
|
145
|
+
console.log(chalk.gray(` ${SESSION_MARK} ramo de design aberto em 1-design/\n`));
|
|
126
146
|
return;
|
|
127
147
|
}
|
|
128
148
|
|
|
129
149
|
if (phase === 'review') {
|
|
130
|
-
console.log(chalk.yellow(`\n
|
|
131
|
-
console.log(chalk.gray(`
|
|
132
|
-
console.log(chalk.gray(`Then archive with: morph-spec archive ${featureName}\n`));
|
|
150
|
+
console.log(chalk.yellow(`\n⚠ ${ref} já está na última etapa (${PHASE_NAME.review}).`));
|
|
151
|
+
console.log(chalk.gray(` ${SESSION_MARK} aprove a entrega com \`morph-spec approve ${featureName} review\` e arquive com \`morph-spec archive ${featureName}\`\n`));
|
|
133
152
|
return;
|
|
134
153
|
}
|
|
154
|
+
const stage = PHASE_NAME[phase] ?? phase;
|
|
135
155
|
|
|
136
156
|
// `implement` has no gate, so this is what keeps unfinished scenarios out of review.
|
|
137
157
|
// `--force` bypasses it but still names what was skipped.
|
|
@@ -139,8 +159,8 @@ export async function advanceCommand(featureName, options = {}) {
|
|
|
139
159
|
if (missingArtifacts.length && !options.force) {
|
|
140
160
|
const elsewhere = await artifactsLiveInWorktree(featureName, missingArtifacts);
|
|
141
161
|
if (elsewhere) {
|
|
142
|
-
console.error(chalk.red(`\n
|
|
143
|
-
console.error(chalk.gray('
|
|
162
|
+
console.error(chalk.red(`\n✗ A etapa ${stage} de ${ref} não pode ser encerrada a partir desta pasta.`));
|
|
163
|
+
console.error(chalk.gray(' Nada está faltando: os arquivos vivem no worktree dono desta funcionalidade:'));
|
|
144
164
|
for (const rel of elsewhere.present) console.error(chalk.gray(` • ${rel}`));
|
|
145
165
|
console.error(chalk.gray(`\n Worktree: ${elsewhere.path}${elsewhere.branch ? ` (branch ${elsewhere.branch})` : ''}`));
|
|
146
166
|
console.error(chalk.gray(' Rode o comando LÁ — o gate é gravado no feature.json daquela árvore:'));
|
|
@@ -150,9 +170,10 @@ export async function advanceCommand(featureName, options = {}) {
|
|
|
150
170
|
process.exit(1);
|
|
151
171
|
}
|
|
152
172
|
|
|
153
|
-
console.error(chalk.red(`\n
|
|
154
|
-
for (const
|
|
155
|
-
console.error(chalk.gray(
|
|
173
|
+
console.error(chalk.red(`\n✗ A etapa ${stage} de ${ref} ainda não pode ser encerrada:`));
|
|
174
|
+
for (const line of missingLines(missingArtifacts, featurePath)) console.error(` ${line}`);
|
|
175
|
+
console.error(chalk.gray(` ${SESSION_MARK} ausente(s), PARCIAL ou BLOQUEADO: ${missingArtifacts.join('; ')}.`
|
|
176
|
+
+ ' Produza o artefato e rode de novo, ou passe --force para avançar assim mesmo.\n'));
|
|
156
177
|
process.exit(1);
|
|
157
178
|
}
|
|
158
179
|
|
|
@@ -163,8 +184,8 @@ export async function advanceCommand(featureName, options = {}) {
|
|
|
163
184
|
if (gate) {
|
|
164
185
|
const unmet = unmetPrereqs(gate, feature.approvalGates);
|
|
165
186
|
if (unmet.length && !options.force) {
|
|
166
|
-
console.error(chalk.red(`\n
|
|
167
|
-
console.error(chalk.gray(`
|
|
187
|
+
console.error(chalk.red(`\n✗ A etapa ${stage} de ${ref} ainda não pode ser encerrada: antes vem ${unmet.map((u) => GATE_NAME[u] ?? u).join(', ')}.`));
|
|
188
|
+
console.error(chalk.gray(` ${SESSION_MARK} prerequisite gate(s) não aprovado(s): aprove na ordem (${unmet.join(' → ')} → ${gate}), ou passe --force\n`));
|
|
168
189
|
process.exit(1);
|
|
169
190
|
}
|
|
170
191
|
}
|
|
@@ -201,24 +222,27 @@ export async function advanceCommand(featureName, options = {}) {
|
|
|
201
222
|
if (phase === 'plan') reportDotnetIgnores(seedDotnetBuildIgnores(process.cwd(), { featureName }));
|
|
202
223
|
|
|
203
224
|
|
|
204
|
-
console.log(chalk.green(`\n
|
|
225
|
+
console.log(chalk.green(`\n✓ ${ref}: etapa ${stage} encerrada.`));
|
|
205
226
|
if (missingArtifacts.length) {
|
|
206
|
-
console.log(chalk.yellow(
|
|
227
|
+
console.log(chalk.yellow(' ⚠ Avançou sem terminar tudo:'));
|
|
228
|
+
for (const line of missingLines(missingArtifacts, featurePath)) console.log(chalk.yellow(` ${line}`));
|
|
229
|
+
console.log(chalk.gray(` ${SESSION_MARK} --force: avançou SEM ${missingArtifacts.join(', ')}`));
|
|
207
230
|
}
|
|
208
231
|
if (checklistBlock) {
|
|
209
232
|
const by = options.force ? '--force' : `aprovado por ${approvedBy}`;
|
|
210
|
-
console.log(chalk.yellow(`
|
|
233
|
+
console.log(chalk.yellow(` ⚠ ${by}: avançou com o desenho das telas incompleto.`));
|
|
234
|
+
console.log(chalk.yellow(` ${checklistBlock}`));
|
|
211
235
|
}
|
|
212
236
|
// Never claim "approved (auto)" when nothing was written.
|
|
213
237
|
if (gate && alreadyApproved) {
|
|
214
|
-
console.log(
|
|
238
|
+
console.log(` ${GATE_NAME[gate]} já estava aprovada (por ${priorGate.approvedBy || 'alguém sem nome'}): nada foi regravado.`);
|
|
215
239
|
} else if (gate) {
|
|
216
|
-
console.log(
|
|
240
|
+
console.log(` ${GATE_NAME[gate]}: ${approvedBySay(approvedBy)}.`);
|
|
217
241
|
}
|
|
218
|
-
if (nextDir) console.log(chalk.gray(`
|
|
242
|
+
if (nextDir) console.log(chalk.gray(` ${SESSION_MARK} pasta ${nextDir}/ criada para a próxima etapa\n`));
|
|
219
243
|
else console.log('');
|
|
220
244
|
} catch (error) {
|
|
221
|
-
console.error(chalk.red(`\n
|
|
245
|
+
console.error(chalk.red(`\n✗ Não deu para avançar: ${error.message}\n`));
|
|
222
246
|
process.exit(1);
|
|
223
247
|
}
|
|
224
248
|
}
|