From e3fedd4582b31e76a4c582156bdeaa602528126b Mon Sep 17 00:00:00 2001 From: pulse-agent Date: Tue, 19 May 2026 21:50:45 -0300 Subject: [PATCH] refactor(auto-melhoria): ERR-20260519-002 tsup DTS break + FR-* + PATTERN_COUNTER atualizado --- .learnings/ERRORS.md | 39 ++++++++++++++++++++++++++++++++++ .learnings/FEATURE_REQUESTS.md | 11 ++++++---- .learnings/PATTERN_COUNTER.md | 11 +++++----- 3 files changed, 52 insertions(+), 9 deletions(-) diff --git a/.learnings/ERRORS.md b/.learnings/ERRORS.md index c506480..1207411 100644 --- a/.learnings/ERRORS.md +++ b/.learnings/ERRORS.md @@ -4,4 +4,43 @@ _Registro de erros, exceções e falhas com contexto de reprodução._ --- +## [ERR-20260519-002] tsup-flat-infinity-breaks-dts + +**Logged**: 2026-05-19T21:35:00-03:00 +**Severity**: high +**Area**: config | build + +### What happened +`cn()` usava `flat(Infinity)` no array de classes. O gerador de DTS do tsup v8 quebra com tipos recursivos infinitos, lançando `Type instantiation is excessively deep`. + +### Error message +``` +src/utils/index.ts: error TS2589: Type instantiation is excessively deep and possibly infinite. +DTS Build error +``` + +### Reproduction +```ts +type ClassValue = string | false | null | undefined | ClassValue[]; +// ❌ flat(Infinity) → tipo recursivo infinito → DTS quebra +export function cn(...inputs: ClassValue[]): string { + return inputs.flat(Infinity).... +} +``` + +### Fix +```ts +type ClassValue = string | boolean | null | undefined | Array; +// ✅ flat(2) — máximo de aninhamento é 2 níveis (cls, [cls2]) +export function cn(...inputs: ClassValue[]): string { + return inputs.flat(2).... +} +``` + +### Also fixed in same session +- `process.env.NODE_ENV` no código → quebra SSR / bundler. Solução: guarda `typeof localStorage !== 'undefined'` +- `documentoSchema` usava `.replace()` direto na string Zod → `.transform(v => v.replace(…))` + +--- + diff --git a/.learnings/FEATURE_REQUESTS.md b/.learnings/FEATURE_REQUESTS.md index 4abf288..9eadbca 100644 --- a/.learnings/FEATURE_REQUESTS.md +++ b/.learnings/FEATURE_REQUESTS.md @@ -1,7 +1,10 @@ # Feature Requests — Capacidades requisitadas -_Registro de funcionalidades que foram pedidas ou que faltam._ +| ID | Feature | Justificativa | Prioridade | +|---|---|---|---| +| FR-001 | python-script-generator skill | Fecha lacuna de backend Python/FastAPI | alta | +| FR-002 | Obsidian vault configurado | skill obsidian-vault-linker instalada, precisa de vault real | media | +| FR-003 | GitHub remote configurado | pulse-agent/libs precisa de push automático | alta | +| FR-004 | npmjs.org publish configurado | @pulse-libs/core não está publicado ainda | media | +| FR-005 | CI/CD auto-run em cada commit | Sem CI/CD configurado ainda | alta | ---- - - diff --git a/.learnings/PATTERN_COUNTER.md b/.learnings/PATTERN_COUNTER.md index cecdcfc..57aa48a 100644 --- a/.learnings/PATTERN_COUNTER.md +++ b/.learnings/PATTERN_COUNTER.md @@ -1,14 +1,15 @@ # Pattern Counter — Contador de Sucessos -_Rastreia quantas vezes cada abordagem funcionou para identificar skills candidatas._ - | Pattern-Key | Count | Last-Seen | Status | |---|---|---|---| | clawhub.cli_path | 1 | 2026-05-19 | tracking | | clawhub.search_strategy | 1 | 2026-05-19 | tracking | | libs.shared_knowledge_base | 1 | 2026-05-19 | tracking | -| skill.extra | 3 | 2026-05-19 | tracking | +| tsup.multi-entry-esm-cjs | 1 | 2026-05-19 | tracking | +| zod.safe-parse-generic | 1 | 2026-05-19 | tracking | +| ts.flat2-not-flatinfinity | 1 | 2026-05-19 | tracking | +| docker.multi-stage-node-alpine | 1 | 2026-05-19 | tracking | +| git.conventional-commits | 2 | 2026-05-19 | tracking | -_Quando Count >= 3 e visto em >= 2 tarefas distintas em 30 dias → promover para AGENTS.md_ +_Quando Count >= 3 em >= 2 tarefas distintas em 30 dias → promover para AGENTS.md como skill/recomendacao permanente_ ----