@spec-wave/cli 1.7.1 → 1.7.2
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/package.json
CHANGED
package/src/commands/update.mjs
CHANGED
|
@@ -159,6 +159,25 @@ export function diffLabels(existing, fileAi, devAgent) {
|
|
|
159
159
|
return { missing, changed, orphan };
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
/**
|
|
163
|
+
* Diff de labels do repositório, por papel (RFC-005 §7.4). Num repo de CÓDIGO
|
|
164
|
+
* as labels são do hub — é lá que as issues vivem —, então o diff é vazio e o
|
|
165
|
+
* tracker nem é consultado. Sem este corte o `update` comparava o repo de
|
|
166
|
+
* código com as labels do fluxo: criava as 40+ num repo que nunca as teve e
|
|
167
|
+
* acusava as de modelo (`spec-wave:model:*`) como órfãs a remover, porque o
|
|
168
|
+
* config de um repo de código não tem bloco `ai`.
|
|
169
|
+
*
|
|
170
|
+
* @param {'hub'|'code'} role
|
|
171
|
+
* @param {() => Promise<Array<{name,color,description}>>} listTags
|
|
172
|
+
* @param {object} [fileAi]
|
|
173
|
+
* @param {object} [devAgent]
|
|
174
|
+
* @returns {Promise<{ missing: object[], changed: object[], orphan: object[] }>}
|
|
175
|
+
*/
|
|
176
|
+
export async function repoLabelDiff(role, listTags, fileAi, devAgent) {
|
|
177
|
+
if (role === 'code') return { missing: [], changed: [], orphan: [] };
|
|
178
|
+
return diffLabels(await listTags(), fileAi, devAgent);
|
|
179
|
+
}
|
|
180
|
+
|
|
162
181
|
/**
|
|
163
182
|
* Decide se uma label órfã pode ser deletada (função PURA — testável sem rede).
|
|
164
183
|
*
|
|
@@ -410,8 +429,12 @@ export async function update(options = {}) {
|
|
|
410
429
|
if (remote === null) repoFiles.push({ ...f, reason: 'ausente', local });
|
|
411
430
|
else if (remote !== local) repoFiles.push({ ...f, reason: 'desatualizado', local });
|
|
412
431
|
}
|
|
413
|
-
|
|
414
|
-
|
|
432
|
+
labelDiff = await repoLabelDiff(
|
|
433
|
+
role,
|
|
434
|
+
async () => (await requireTracker({ token: tk, owner, repo })).listTags(),
|
|
435
|
+
config?.ai,
|
|
436
|
+
config?.devAgent,
|
|
437
|
+
);
|
|
415
438
|
repoChecked = true;
|
|
416
439
|
s.stop('Repositório comparado.');
|
|
417
440
|
} catch (err) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-wave",
|
|
3
3
|
"displayName": "Spec Wave",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.2",
|
|
5
5
|
"description": "Fluxo spec-driven no GitHub (RFC-001): Projects v2, labels de gatilho, spec/plan gerados por Action, decomposição em duas etapas e implementação orientada a Stories/Tasks.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Astratech",
|