@mestreyoda/fabrica 0.1.2 → 0.1.4
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.
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0",
|
|
3
|
+
"default_type": "feature",
|
|
4
|
+
"confidence_threshold": 0.6,
|
|
5
|
+
"types": {
|
|
6
|
+
"bugfix": {
|
|
7
|
+
"keywords": ["bug", "fix", "erro", "error", "crash", "broken", "quebrado", "falha", "fail", "exception", "not working", "nao funciona", "não funciona", "regression", "regressão"],
|
|
8
|
+
"patterns": ["(?i)\\b(fix|corrig|resolv|repair|patch)\\b", "(?i)\\b(bug|erro|falha|crash|quebr)\\b"],
|
|
9
|
+
"weight": 1.2
|
|
10
|
+
},
|
|
11
|
+
"feature": {
|
|
12
|
+
"keywords": ["add", "create", "new", "implement", "build", "fazer", "criar", "adicionar", "novo", "nova", "implementar", "construir", "develop", "desenvolver", "want", "quero", "need", "preciso"],
|
|
13
|
+
"patterns": ["(?i)\\b(add|creat|implement|build|desenvolv|faz)\\b", "(?i)\\b(nov[oa]|new)\\b"],
|
|
14
|
+
"weight": 1.0
|
|
15
|
+
},
|
|
16
|
+
"refactor": {
|
|
17
|
+
"keywords": ["refactor", "refatorar", "cleanup", "clean up", "reorganize", "reorganizar", "simplify", "simplificar", "extract", "extrair", "rename", "renomear", "move", "mover", "split", "dividir", "merge", "consolidar"],
|
|
18
|
+
"patterns": ["(?i)\\b(refactor|refator|cleanup|reorganiz|simplif)\\b", "(?i)\\b(extract|split|merg|consolid)\\b"],
|
|
19
|
+
"weight": 0.9
|
|
20
|
+
},
|
|
21
|
+
"research": {
|
|
22
|
+
"keywords": ["research", "pesquisar", "investigate", "investigar", "explore", "explorar", "evaluate", "avaliar", "compare", "comparar", "spike", "poc", "proof of concept", "prova de conceito", "prototype", "protótipo", "study", "estudar"],
|
|
23
|
+
"patterns": ["(?i)\\b(research|pesquis|investigat|explor|avaliar|compar)\\b", "(?i)\\b(spike|poc|proof.of.concept|prova.de.conceito|protot)\\b"],
|
|
24
|
+
"weight": 0.8
|
|
25
|
+
},
|
|
26
|
+
"infra": {
|
|
27
|
+
"keywords": ["deploy", "ci", "cd", "pipeline", "docker", "kubernetes", "k8s", "terraform", "ansible", "monitoring", "monitoramento", "logging", "infrastructure", "infraestrutura", "devops", "server", "servidor", "database", "banco de dados", "migration", "migração", "config", "configuração", "env", "environment", "ambiente"],
|
|
28
|
+
"patterns": ["(?i)\\b(deploy|docker|k8s|kubernetes|terraform|ansible|ci.?cd)\\b", "(?i)\\b(infra|devops|pipeline|migration|migra[çc])\\b"],
|
|
29
|
+
"weight": 0.9
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0",
|
|
3
|
+
"max_rounds": 2,
|
|
4
|
+
"types": {
|
|
5
|
+
"feature": {
|
|
6
|
+
"round1": [
|
|
7
|
+
{ "id": "f1", "question": "Qual problema específico essa feature resolve para o usuário?", "required": true, "follow_up_if_vague": "Pode dar um exemplo concreto de quando o usuário sentiria falta dessa funcionalidade?" },
|
|
8
|
+
{ "id": "f2", "question": "Quem vai usar isso? Descreva o perfil do usuário principal.", "required": true, "follow_up_if_vague": "É um usuário final, admin, desenvolvedor, ou outro perfil?" },
|
|
9
|
+
{ "id": "f3", "question": "Qual é o fluxo principal? O que o usuário faz passo a passo?", "required": true, "follow_up_if_vague": "Tente descrever: 'O usuário clica em X, preenche Y, vê Z'." },
|
|
10
|
+
{ "id": "f4", "question": "Existe alguma restrição de tecnologia, prazo ou compatibilidade?", "required": false, "follow_up_if_vague": null },
|
|
11
|
+
{ "id": "f5", "question": "Esse fluxo exige login? Se sim, quais perfis existem e quais permissões cada perfil deve ter?", "required": false, "follow_up_if_vague": "Descreva pelo menos um exemplo de ação permitida e uma ação bloqueada por perfil." }
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"bugfix": {
|
|
15
|
+
"round1": [
|
|
16
|
+
{ "id": "b1", "question": "O que está acontecendo de errado? Descreva o comportamento atual.", "required": true, "follow_up_if_vague": "Você vê alguma mensagem de erro? O que aparece na tela?" },
|
|
17
|
+
{ "id": "b2", "question": "O que deveria acontecer? Qual o comportamento esperado?", "required": true, "follow_up_if_vague": "Antes funcionava corretamente? Quando parou?" },
|
|
18
|
+
{ "id": "b3", "question": "Como reproduzir o bug? Passos exatos.", "required": true, "follow_up_if_vague": "Em qual página/tela? Com qual tipo de dado?" },
|
|
19
|
+
{ "id": "b4", "question": "Com que frequência acontece? Sempre, às vezes, em condições específicas?", "required": false, "follow_up_if_vague": null }
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"refactor": {
|
|
23
|
+
"round1": [
|
|
24
|
+
{ "id": "r1", "question": "Qual parte do código precisa ser refatorada? Qual módulo/arquivo?", "required": true, "follow_up_if_vague": "Qual funcionalidade está nesse código?" },
|
|
25
|
+
{ "id": "r2", "question": "Qual o problema atual? (duplicação, complexidade, acoplamento, performance)", "required": true, "follow_up_if_vague": "O que dificulta trabalhar nesse código hoje?" },
|
|
26
|
+
{ "id": "r3", "question": "Qual o resultado esperado da refatoração?", "required": true, "follow_up_if_vague": "Quer que fique mais legível, mais rápido, ou mais testável?" }
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"research": {
|
|
30
|
+
"round1": [
|
|
31
|
+
{ "id": "s1", "question": "O que precisa ser investigado ou avaliado?", "required": true, "follow_up_if_vague": "É uma tecnologia, abordagem, ou viabilidade de algo?" },
|
|
32
|
+
{ "id": "s2", "question": "Qual decisão essa pesquisa vai informar?", "required": true, "follow_up_if_vague": "O que muda se a conclusão for positiva vs negativa?" },
|
|
33
|
+
{ "id": "s3", "question": "Quais critérios definem sucesso da pesquisa?", "required": true, "follow_up_if_vague": "Qual entregável esperado? Documento, PoC, comparativo?" }
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"infra": {
|
|
37
|
+
"round1": [
|
|
38
|
+
{ "id": "i1", "question": "O que precisa ser configurado/implantado/migrado?", "required": true, "follow_up_if_vague": "É CI/CD, deploy, banco de dados, monitoramento?" },
|
|
39
|
+
{ "id": "i2", "question": "Qual o ambiente alvo? (produção, staging, dev, local)", "required": true, "follow_up_if_vague": null },
|
|
40
|
+
{ "id": "i3", "question": "Há requisitos de downtime, rollback ou compatibilidade?", "required": false, "follow_up_if_vague": null }
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0",
|
|
3
|
+
"priority_rules": [
|
|
4
|
+
{ "condition": "type == 'bugfix' && risk_count > 2", "priority": "P0", "label": "priority:critical" },
|
|
5
|
+
{ "condition": "type == 'bugfix'", "priority": "P1", "label": "priority:high" },
|
|
6
|
+
{ "condition": "type == 'feature' && effort == 'small'", "priority": "P2", "label": "priority:medium" },
|
|
7
|
+
{ "condition": "type == 'feature'", "priority": "P3", "label": "priority:normal" },
|
|
8
|
+
{ "condition": "type == 'refactor'", "priority": "P3", "label": "priority:normal" },
|
|
9
|
+
{ "condition": "type == 'infra'", "priority": "P2", "label": "priority:medium" },
|
|
10
|
+
{ "condition": "type == 'research'", "priority": "P3", "label": "priority:normal" }
|
|
11
|
+
],
|
|
12
|
+
"priority_rules_v2": [
|
|
13
|
+
{ "when": { "type": "bugfix", "min_risk_count": 3 }, "priority": "P0", "label": "priority:critical" },
|
|
14
|
+
{ "when": { "type": "bugfix" }, "priority": "P1", "label": "priority:high" },
|
|
15
|
+
{ "when": { "type": "feature", "effort": "small" }, "priority": "P2", "label": "priority:medium" },
|
|
16
|
+
{ "when": { "type": "feature" }, "priority": "P3", "label": "priority:normal" },
|
|
17
|
+
{ "when": { "type": "refactor" }, "priority": "P3", "label": "priority:normal" },
|
|
18
|
+
{ "when": { "type": "infra" }, "priority": "P2", "label": "priority:medium" },
|
|
19
|
+
{ "when": { "type": "research" }, "priority": "P3", "label": "priority:normal" }
|
|
20
|
+
],
|
|
21
|
+
"effort_rules": {
|
|
22
|
+
"small": { "max_files": 3, "max_acs": 3, "label": "effort:small" },
|
|
23
|
+
"medium": { "max_files": 10, "max_acs": 7, "label": "effort:medium" },
|
|
24
|
+
"large": { "max_files": 25, "max_acs": 15, "label": "effort:large" },
|
|
25
|
+
"xlarge": { "max_files": 999, "max_acs": 999, "label": "effort:xlarge" }
|
|
26
|
+
},
|
|
27
|
+
"auto_labels": {
|
|
28
|
+
"feature": "type:feature",
|
|
29
|
+
"bugfix": "type:bugfix",
|
|
30
|
+
"refactor": "type:refactor",
|
|
31
|
+
"research": "type:research",
|
|
32
|
+
"infra": "type:infra"
|
|
33
|
+
},
|
|
34
|
+
"target_state_by_type": {
|
|
35
|
+
"default": "To Do",
|
|
36
|
+
"research": "To Research"
|
|
37
|
+
},
|
|
38
|
+
"dispatch_label": ""
|
|
39
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -111329,8 +111329,8 @@ import fsSync from "node:fs";
|
|
|
111329
111329
|
import path5 from "node:path";
|
|
111330
111330
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
111331
111331
|
function getCurrentVersion() {
|
|
111332
|
-
if ("0.1.
|
|
111333
|
-
return "0.1.
|
|
111332
|
+
if ("0.1.4") {
|
|
111333
|
+
return "0.1.4";
|
|
111334
111334
|
}
|
|
111335
111335
|
try {
|
|
111336
111336
|
const pkgPath = path5.join(THIS_DIR, "..", "..", "package.json");
|
|
@@ -142540,9 +142540,11 @@ function registerTelegramBootstrapHook(api, ctx) {
|
|
|
142540
142540
|
repoPath: existingSession.repoPath ?? null
|
|
142541
142541
|
};
|
|
142542
142542
|
ctx.logger.info(`[telegram-bootstrap] clarification resolved: stack=${mergedRequest.stackHint}, idea="${mergedRequest.rawIdea}" (conversation: ${conversationId})`);
|
|
142543
|
-
|
|
142543
|
+
continueBootstrap(ctx, conversationId, workspaceDir, mergedRequest, existingSession.sourceRoute ?? {
|
|
142544
142544
|
channel: "telegram",
|
|
142545
142545
|
channelId: conversationId
|
|
142546
|
+
}).catch((err) => {
|
|
142547
|
+
logBootstrapWarning(ctx, `[telegram-bootstrap] unhandled pipeline error: ${err instanceof Error ? err.message : String(err)}`);
|
|
142546
142548
|
});
|
|
142547
142549
|
return;
|
|
142548
142550
|
}
|
|
@@ -142562,10 +142564,14 @@ function registerTelegramBootstrapHook(api, ctx) {
|
|
|
142562
142564
|
ctx.logger.info(`[telegram-bootstrap] duplicate completed DM ignored for conversation ${conversationId}`);
|
|
142563
142565
|
return;
|
|
142564
142566
|
}
|
|
142565
|
-
|
|
142567
|
+
const isExpiredReceived = sessionForHash.status === "received" && Date.parse(sessionForHash.suppressUntil) < Date.now();
|
|
142568
|
+
if (sessionForHash.status !== "failed" && !isExpiredReceived) {
|
|
142566
142569
|
ctx.logger.info(`[telegram-bootstrap] duplicate in-flight DM ignored for conversation ${conversationId}`);
|
|
142567
142570
|
return;
|
|
142568
142571
|
}
|
|
142572
|
+
if (isExpiredReceived) {
|
|
142573
|
+
ctx.logger.info(`[telegram-bootstrap] stale received session (expired) \u2014 restarting pipeline for conversation ${conversationId}`);
|
|
142574
|
+
}
|
|
142569
142575
|
}
|
|
142570
142576
|
const session = await upsertTelegramBootstrapSession(workspaceDir, {
|
|
142571
142577
|
conversationId,
|
|
@@ -142589,9 +142595,11 @@ function registerTelegramBootstrapHook(api, ctx) {
|
|
|
142589
142595
|
await sendTelegramText(ctx, conversationId, buildClarificationMessage(parsed, pendingClarification));
|
|
142590
142596
|
return;
|
|
142591
142597
|
}
|
|
142592
|
-
|
|
142598
|
+
continueBootstrap(ctx, conversationId, workspaceDir, incomingRequest, {
|
|
142593
142599
|
channel: "telegram",
|
|
142594
142600
|
channelId: conversationId
|
|
142601
|
+
}).catch((err) => {
|
|
142602
|
+
logBootstrapWarning(ctx, `[telegram-bootstrap] unhandled pipeline error: ${err instanceof Error ? err.message : String(err)}`);
|
|
142595
142603
|
});
|
|
142596
142604
|
});
|
|
142597
142605
|
}
|