pumuki 6.3.336 → 6.3.337

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.336",
3
+ "version": "6.3.337",
4
4
  "description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -199,13 +199,48 @@ const formatCauseFix = (cause: BlockedCause): string =>
199
199
  'Corrige la violación indicada con regla, fichero y línea, y vuelve a intentar el commit.'
200
200
  );
201
201
 
202
+ const normalizeRuleCode = (ruleId: string): string =>
203
+ ruleId
204
+ .replace(/^skills\./u, 'SKILLS_')
205
+ .replace(/[.-]/gu, '_')
206
+ .toUpperCase();
207
+
208
+ const isGenericCauseFix = (value?: string): boolean =>
209
+ !value ||
210
+ /corrige la violaci[oó]n indicada/i.test(value) ||
211
+ /corrige las violaciones listadas/i.test(value);
212
+
213
+ const extractNestedSkillRuleId = (message: string): string | null =>
214
+ message.match(/\b(skills\.[a-z0-9_.-]+)\b/iu)?.[1] ?? null;
215
+
216
+ const normalizeDisplayCause = (cause: BlockedCause): BlockedCause => {
217
+ if (isSkillCause(cause) || isSkillsContractCause(cause)) {
218
+ return cause;
219
+ }
220
+ const nestedSkillRuleId = extractNestedSkillRuleId(cause.message);
221
+ if (!nestedSkillRuleId) {
222
+ return cause;
223
+ }
224
+ const nestedFile = extractMessageField(cause.message, 'file');
225
+ const nestedRemediation = extractMessageField(cause.message, 'remediation');
226
+ return {
227
+ ...cause,
228
+ code: normalizeRuleCode(nestedSkillRuleId),
229
+ ruleId: nestedSkillRuleId,
230
+ file: nestedFile ?? cause.file,
231
+ remediation: isGenericCauseFix(cause.remediation)
232
+ ? nestedRemediation ?? cause.remediation
233
+ : cause.remediation,
234
+ };
235
+ };
236
+
202
237
  export const resolvePrioritizedBlockingCauses = (
203
238
  causes: Extract<PumukiCriticalNotificationEvent, { kind: 'gate.blocked' }>['blockingCauses']
204
239
  ): ReadonlyArray<BlockedCause> => {
205
240
  if (!causes || causes.length === 0) {
206
241
  return [];
207
242
  }
208
- return [...causes].sort((left, right) => {
243
+ return causes.map(normalizeDisplayCause).sort((left, right) => {
209
244
  const leftSkill = isSkillCause(left);
210
245
  const rightSkill = isSkillCause(right);
211
246
  if (leftSkill !== rightSkill) {