pumuki 6.3.357 → 6.3.358

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.357",
3
+ "version": "6.3.358",
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": {
@@ -1,5 +1,6 @@
1
1
  import type { PumukiCriticalNotificationEvent } from './framework-menu-system-notifications-types';
2
2
  import {
3
+ resolveDisplayBlockingCausesForEvent,
3
4
  resolvePrioritizedBlockingCauses,
4
5
  resolveBlockedCauseSummary,
5
6
  resolveBlockedRemediation,
@@ -332,7 +333,10 @@ const formatBlockingCauseForDialog = (
332
333
  ): readonly string[] => {
333
334
  const rule = cause.ruleId ?? cause.code;
334
335
  const visibleRule = formatVisibleRule(cause);
335
- const problem = localizeDeveloperText(stripTechnicalFieldsFromMessage(cause.message) || cause.code);
336
+ const problem = localizeDeveloperText(
337
+ extractFieldFromCauseMessage(cause.message, 'message') ??
338
+ (stripTechnicalFieldsFromMessage(cause.message) || cause.code)
339
+ );
336
340
  const remediation = isGoldenFlowCause(cause)
337
341
  ? GOLDEN_FLOW_REMEDIATION
338
342
  : isWorktreeHygieneCause(cause)
@@ -418,17 +422,18 @@ export const buildBlockedDialogPayload = (params: {
418
422
  env: NodeJS.ProcessEnv;
419
423
  }): BlockedDialogPayload => {
420
424
  const causeCode = params.event.causeCode ?? 'GATE_BLOCKED';
421
- const cause = buildBlockingCausesDetails(params.event.blockingCauses)
425
+ const displayBlockingCauses = resolveDisplayBlockingCausesForEvent(params.event);
426
+ const cause = buildBlockingCausesDetails(displayBlockingCauses)
422
427
  ?? resolveBlockedCauseSummary(params.event, causeCode);
423
- const remediation = hasOnlyWorktreeHygieneCauses(params.event.blockingCauses)
428
+ const remediation = hasOnlyWorktreeHygieneCauses(displayBlockingCauses)
424
429
  ? WORKTREE_HYGIENE_REMEDIATION
425
- : hasOnlyGoldenFlowCauses(params.event.blockingCauses)
426
- ? resolveGoldenFlowDialogRemediation(params.event.blockingCauses)
427
- : hasOnlyBddScenarioMissingCauses(params.event.blockingCauses)
430
+ : hasOnlyGoldenFlowCauses(displayBlockingCauses)
431
+ ? resolveGoldenFlowDialogRemediation(displayBlockingCauses)
432
+ : hasOnlyBddScenarioMissingCauses(displayBlockingCauses)
428
433
  ? 'Crea el fichero .feature esperado para la slice activa o corrige la referencia de tarea. Después vuelve a intentar el commit.'
429
- : hasOnlySkillsContractCauses(params.event.blockingCauses)
434
+ : hasOnlySkillsContractCauses(displayBlockingCauses)
430
435
  ? SKILLS_CONTRACT_DIALOG_REMEDIATION
431
- : params.event.blockingCauses && params.event.blockingCauses.length > 0
436
+ : displayBlockingCauses.length > 0
432
437
  ? 'Corrige las violaciones listadas y vuelve a intentar el commit.'
433
438
  : resolveBlockedRemediation(params.event, causeCode);
434
439
  const projectLabel = resolveProjectLabel({
@@ -275,6 +275,25 @@ const normalizeDisplayCause = (cause: BlockedCause): BlockedCause => {
275
275
  };
276
276
  };
277
277
 
278
+ export const resolveDisplayBlockingCausesForEvent = (
279
+ event: Extract<PumukiCriticalNotificationEvent, { kind: 'gate.blocked' }>
280
+ ): ReadonlyArray<BlockedCause> => {
281
+ if (event.blockingCauses && event.blockingCauses.length > 0) {
282
+ return event.blockingCauses;
283
+ }
284
+ if (!event.causeMessage || !/\bBlocking causes:\s*1\)\s*skills\./iu.test(event.causeMessage)) {
285
+ return [];
286
+ }
287
+ return [
288
+ {
289
+ code: event.causeCode ?? 'EVIDENCE_GATE_BLOCKED',
290
+ ruleId: 'ai_gate.repo_policy',
291
+ message: event.causeMessage,
292
+ remediation: event.remediation,
293
+ },
294
+ ];
295
+ };
296
+
278
297
  export const resolvePrioritizedBlockingCauses = (
279
298
  causes: Extract<PumukiCriticalNotificationEvent, { kind: 'gate.blocked' }>['blockingCauses']
280
299
  ): ReadonlyArray<BlockedCause> => {
@@ -376,12 +395,13 @@ export const buildGateBlockedPayload = (
376
395
  projectPrefix: string
377
396
  ): SystemNotificationPayload => {
378
397
  const causeCode = event.causeCode ?? 'GATE_BLOCKED';
398
+ const displayBlockingCauses = resolveDisplayBlockingCausesForEvent(event);
379
399
  const causeSummary = truncateNotificationText(
380
- buildBlockingCausesSummary(event.blockingCauses) ?? resolveBlockedCauseSummary(event, causeCode),
400
+ buildBlockingCausesSummary(displayBlockingCauses) ?? resolveBlockedCauseSummary(event, causeCode),
381
401
  96
382
402
  );
383
403
  const remediation =
384
- buildBlockingCausesRemediation(event.blockingCauses) ?? resolveBlockedRemediation(event, causeCode);
404
+ buildBlockingCausesRemediation(displayBlockingCauses) ?? resolveBlockedRemediation(event, causeCode);
385
405
  return {
386
406
  title: '🔴 Pumuki bloqueado',
387
407
  subtitle: `${projectPrefix}${event.stage} · ${causeSummary}`,
@@ -27,6 +27,7 @@ export {
27
27
  } from './framework-menu-system-notifications-payloads-audit';
28
28
  export {
29
29
  buildGateBlockedPayload,
30
+ resolveDisplayBlockingCausesForEvent,
30
31
  resolvePrioritizedBlockingCauses,
31
32
  } from './framework-menu-system-notifications-payloads-blocked';
32
33
  export {