pumuki 6.3.232 → 6.3.234

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,22 @@
1
+ const PRE_WRITE_ENTRY = 'integrations/lifecycle/cli.ts';
2
+ const PRE_WRITE_ARGS = ['sdd', 'validate', '--stage=PRE_WRITE'];
3
+
4
+ function shouldRunChainedPreWrite(env = process.env) {
5
+ if (env.PUMUKI_SKIP_CHAINED_PRE_WRITE === '1') {
6
+ return false;
7
+ }
8
+ return env.PUMUKI_CHAINED_PRE_WRITE_DONE !== '1';
9
+ }
10
+
11
+ function runChainedPreWriteIfNeeded(runTsEntry, env = process.env) {
12
+ if (!shouldRunChainedPreWrite(env)) {
13
+ return 0;
14
+ }
15
+ env.PUMUKI_CHAINED_PRE_WRITE_DONE = '1';
16
+ return runTsEntry(PRE_WRITE_ENTRY, PRE_WRITE_ARGS);
17
+ }
18
+
19
+ module.exports = {
20
+ runChainedPreWriteIfNeeded,
21
+ shouldRunChainedPreWrite,
22
+ };
@@ -1,5 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const { runTsEntry } = require('./_run-ts-entry');
4
+ const { runChainedPreWriteIfNeeded } = require('./_chained-pre-write');
4
5
 
6
+ const preWriteStatus = runChainedPreWriteIfNeeded(runTsEntry);
7
+ if (preWriteStatus !== 0) {
8
+ process.exit(preWriteStatus);
9
+ }
5
10
  process.exit(runTsEntry('integrations/git/preCommitBackend.cli.ts', process.argv.slice(2)));
@@ -1,5 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const { runTsEntry } = require('./_run-ts-entry');
4
+ const { runChainedPreWriteIfNeeded } = require('./_chained-pre-write');
4
5
 
6
+ const preWriteStatus = runChainedPreWriteIfNeeded(runTsEntry);
7
+ if (preWriteStatus !== 0) {
8
+ process.exit(preWriteStatus);
9
+ }
5
10
  process.exit(runTsEntry('integrations/git/prePushBackend.cli.ts', process.argv.slice(2)));
@@ -124,26 +124,35 @@ const toGatePolicyRecordFromEnterpriseThresholds = (
124
124
  };
125
125
  };
126
126
 
127
+ const ZERO_VIOLATION_BLOCK_ON_OR_ABOVE: GatePolicy['blockOnOrAbove'] = 'INFO';
128
+ const ZERO_VIOLATION_WARN_ON_OR_ABOVE: GatePolicy['warnOnOrAbove'] = 'INFO';
129
+
130
+ const enforceZeroViolationPolicy = (policy: GatePolicy): GatePolicy => ({
131
+ ...policy,
132
+ blockOnOrAbove: ZERO_VIOLATION_BLOCK_ON_OR_ABOVE,
133
+ warnOnOrAbove: ZERO_VIOLATION_WARN_ON_OR_ABOVE,
134
+ });
135
+
127
136
  const defaultPolicyByStage: Record<SkillsStage, GatePolicy> = {
128
137
  PRE_WRITE: {
129
138
  stage: 'PRE_WRITE',
130
- blockOnOrAbove: 'ERROR',
131
- warnOnOrAbove: 'WARN',
139
+ blockOnOrAbove: ZERO_VIOLATION_BLOCK_ON_OR_ABOVE,
140
+ warnOnOrAbove: ZERO_VIOLATION_WARN_ON_OR_ABOVE,
132
141
  },
133
142
  PRE_COMMIT: {
134
143
  stage: 'PRE_COMMIT',
135
- blockOnOrAbove: 'ERROR',
136
- warnOnOrAbove: 'WARN',
144
+ blockOnOrAbove: ZERO_VIOLATION_BLOCK_ON_OR_ABOVE,
145
+ warnOnOrAbove: ZERO_VIOLATION_WARN_ON_OR_ABOVE,
137
146
  },
138
147
  PRE_PUSH: {
139
148
  stage: 'PRE_PUSH',
140
- blockOnOrAbove: 'ERROR',
141
- warnOnOrAbove: 'WARN',
149
+ blockOnOrAbove: ZERO_VIOLATION_BLOCK_ON_OR_ABOVE,
150
+ warnOnOrAbove: ZERO_VIOLATION_WARN_ON_OR_ABOVE,
142
151
  },
143
152
  CI: {
144
153
  stage: 'CI',
145
- blockOnOrAbove: 'ERROR',
146
- warnOnOrAbove: 'WARN',
154
+ blockOnOrAbove: ZERO_VIOLATION_BLOCK_ON_OR_ABOVE,
155
+ warnOnOrAbove: ZERO_VIOLATION_WARN_ON_OR_ABOVE,
147
156
  },
148
157
  };
149
158
 
@@ -624,7 +633,7 @@ export const resolvePolicyForStage = (
624
633
  const profilePolicy = profileName
625
634
  ? hardModePolicyProfileByStage[profileName][stage]
626
635
  : null;
627
- const hardModePolicy = profilePolicy ?? hardModePolicyByStage[stage];
636
+ const hardModePolicy = enforceZeroViolationPolicy(profilePolicy ?? hardModePolicyByStage[stage]);
628
637
  const bundle = profileName
629
638
  ? `gate-policy.hard-mode.${profileName}.${stage}`
630
639
  : `gate-policy.hard-mode.${stage}`;
@@ -693,8 +702,8 @@ export const resolvePolicyForStage = (
693
702
 
694
703
  const resolvedPolicy: GatePolicy = {
695
704
  stage: defaults.stage,
696
- blockOnOrAbove: stageOverride.blockOnOrAbove,
697
- warnOnOrAbove: stageOverride.warnOnOrAbove,
705
+ blockOnOrAbove: ZERO_VIOLATION_BLOCK_ON_OR_ABOVE,
706
+ warnOnOrAbove: ZERO_VIOLATION_WARN_ON_OR_ABOVE,
698
707
  };
699
708
 
700
709
  const bundle = `gate-policy.skills.policy.${stage}`;
@@ -207,7 +207,10 @@ const resolveLifecycleAuditScope = (params: {
207
207
  extensions: ReadonlyArray<string>;
208
208
  stagedMatchingExtensions: ReadonlyArray<string>;
209
209
  }): LifecycleAuditScope => {
210
- if (params.stage === 'PRE_WRITE' && params.stagedMatchingExtensions.length > 0) {
210
+ if (
211
+ (params.stage === 'PRE_WRITE' || params.stage === 'PRE_COMMIT') &&
212
+ params.stagedMatchingExtensions.length > 0
213
+ ) {
211
214
  return { kind: 'staged' };
212
215
  }
213
216
  if (params.stage === 'PRE_PUSH') {
@@ -256,10 +259,7 @@ const toResultScope = (params: {
256
259
  };
257
260
 
258
261
  const isFindingBlocking = (finding: SnapshotFinding): boolean => {
259
- if (typeof finding.blocking === 'boolean') {
260
- return finding.blocking;
261
- }
262
- return finding.severity === 'CRITICAL' || finding.severity === 'ERROR';
262
+ return Boolean(finding.ruleId);
263
263
  };
264
264
 
265
265
  const toLifecycleAuditFinding = (finding: SnapshotFinding): LifecycleAuditFinding => ({
@@ -33,8 +33,11 @@ const runnerLine = (
33
33
  phase: ResolverPhase,
34
34
  runner: string
35
35
  ): string => {
36
- if (parentHook === 'pre-push' && phase === 'main') {
37
- return ` PUMUKI_PRE_PUSH_STDIN="$PUMUKI_PRE_PUSH_STDIN" ${runner} "$@"`;
36
+ if (phase === 'main') {
37
+ if (parentHook === 'pre-push') {
38
+ return ` PUMUKI_CHAINED_PRE_WRITE_DONE=1 PUMUKI_PRE_PUSH_STDIN="$PUMUKI_PRE_PUSH_STDIN" ${runner} "$@"`;
39
+ }
40
+ return ` PUMUKI_CHAINED_PRE_WRITE_DONE=1 ${runner}`;
38
41
  }
39
42
  return ` ${runner}`;
40
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.232",
3
+ "version": "6.3.234",
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": {
@@ -30,6 +30,10 @@ const BLOCKED_CAUSE_SUMMARY_BY_CODE: Readonly<Record<string, string>> = {
30
30
  'Hay conflicto entre fuentes de tracking canónico.',
31
31
  ACTIVE_RULE_IDS_EMPTY_FOR_CODE_CHANGES_HIGH:
32
32
  'No hay reglas activas para cambios de código.',
33
+ EVIDENCE_PLATFORM_CRITICAL_SKILLS_RULES_MISSING:
34
+ 'Falta enforcement crítico de skills para la plataforma detectada.',
35
+ EVIDENCE_SKILLS_CONTRACT_INCOMPLETE:
36
+ 'El contrato de skills está incompleto para este stage.',
33
37
  };
34
38
 
35
39
  const ENGLISH_CAUSE_HINTS = [
@@ -53,6 +57,19 @@ const ENGLISH_CAUSE_HINTS = [
53
57
  'usage.',
54
58
  ];
55
59
 
60
+ const PRIORITY_CODES_FROM_MESSAGE = [
61
+ 'EVIDENCE_PLATFORM_CRITICAL_SKILLS_RULES_MISSING',
62
+ 'EVIDENCE_SKILLS_CONTRACT_INCOMPLETE',
63
+ 'ACTIVE_RULE_IDS_EMPTY_FOR_CODE_CHANGES_HIGH',
64
+ ];
65
+
66
+ const resolvePriorityCauseFromMessage = (message?: string): string | null => {
67
+ if (!message) {
68
+ return null;
69
+ }
70
+ return PRIORITY_CODES_FROM_MESSAGE.find((code) => message.includes(code)) ?? null;
71
+ };
72
+
56
73
  const buildGenericSpanishBlockedCauseSummary = (
57
74
  event: Extract<PumukiCriticalNotificationEvent, { kind: 'gate.blocked' }>,
58
75
  causeCode: string
@@ -97,6 +114,10 @@ export const resolveBlockedCauseSummary = (
97
114
  causeCode: string
98
115
  ): string => {
99
116
  const trackingContext = extractNotificationTrackingContext(event.causeMessage);
117
+ const priorityCode = resolvePriorityCauseFromMessage(event.causeMessage);
118
+ if (priorityCode) {
119
+ return BLOCKED_CAUSE_SUMMARY_BY_CODE[priorityCode];
120
+ }
100
121
  if (trackingContext) {
101
122
  return buildNotificationTrackingCauseSummary(trackingContext);
102
123
  }