pumuki 6.3.234 → 6.3.235

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.
@@ -80,6 +80,61 @@ const defaultServices: GateServices = {
80
80
  evidence: new EvidenceService(),
81
81
  };
82
82
 
83
+ const hasPositiveFindingLine = (lines: Finding['lines']): boolean => {
84
+ if (typeof lines === 'number') {
85
+ return Number.isFinite(lines) && lines > 0;
86
+ }
87
+ if (typeof lines === 'string') {
88
+ return lines.trim().length > 0;
89
+ }
90
+ if (Array.isArray(lines)) {
91
+ return lines.some((line) => Number.isFinite(line) && line > 0);
92
+ }
93
+ return false;
94
+ };
95
+
96
+ const hasActionableFindingLocation = (finding: Finding): boolean => {
97
+ return (
98
+ hasPositiveFindingLine(finding.lines) ||
99
+ finding.primary_node !== undefined ||
100
+ (finding.related_nodes?.length ?? 0) > 0
101
+ );
102
+ };
103
+
104
+ const toNonActionableScopedAdvisoryFinding = (finding: Finding): Finding => ({
105
+ ...finding,
106
+ blocking: false,
107
+ message:
108
+ `${finding.message} ` +
109
+ '(Advisory: Pumuki no pudo atribuir este hallazgo a una linea, rango o nodo accionable en el scope actual.)',
110
+ why:
111
+ finding.why ??
112
+ 'El gate esta limitado a un scope acotado y este finding solo pudo atribuirse al archivo completo.',
113
+ expected_fix:
114
+ finding.expected_fix ??
115
+ 'Reintentar cuando el detector aporte lineas, rango, simbolo o nodo; mientras tanto no bloquea el slice acotado.',
116
+ });
117
+
118
+ const normalizeScopedRuleEngineFindings = (params: {
119
+ findings: ReadonlyArray<Finding>;
120
+ scope: GateScope;
121
+ }): ReadonlyArray<Finding> => {
122
+ if (params.scope.kind !== 'staged' && params.scope.kind !== 'range') {
123
+ return params.findings;
124
+ }
125
+
126
+ return params.findings.map((finding) => {
127
+ if (
128
+ !finding.filePath ||
129
+ hasActionableFindingLocation(finding) ||
130
+ (!finding.ruleId.startsWith('skills.') && !finding.ruleId.startsWith('heuristics.'))
131
+ ) {
132
+ return finding;
133
+ }
134
+ return toNonActionableScopedAdvisoryFinding(finding);
135
+ });
136
+ };
137
+
83
138
  const buildDefaultMemoryShadowRecommendation = (params: {
84
139
  findings: ReadonlyArray<Finding>;
85
140
  tddBddSnapshot?: TddBddSnapshot;
@@ -960,7 +1015,11 @@ export async function runPlatformGate(params: {
960
1015
  evaluationFacts = factsForPlatformEvaluation,
961
1016
  findings: ruleEngineFindings,
962
1017
  } = platformEvaluation;
963
- const findings = [...aiGateRepoPolicyFindings, ...ruleEngineFindings];
1018
+ const scopedRuleEngineFindings = normalizeScopedRuleEngineFindings({
1019
+ findings: ruleEngineFindings,
1020
+ scope: params.scope,
1021
+ });
1022
+ const findings = [...aiGateRepoPolicyFindings, ...scopedRuleEngineFindings];
964
1023
  const evaluationMetrics: SnapshotEvaluationMetrics = coverage
965
1024
  ? {
966
1025
  facts_total: coverage.factsTotal,
@@ -1270,7 +1329,15 @@ export async function runPlatformGate(params: {
1270
1329
  ? [...brownfieldHotspotFindings, ...findings]
1271
1330
  : findings;
1272
1331
  const hasAstIntelligenceBlockingFinding = shouldBlockFromFinding(astIntelligenceDualFinding);
1273
- const decision = dependencies.evaluateGate([...effectiveFindings], params.policy);
1332
+ const gateDecisionFindings = effectiveFindings.filter((finding) => finding.blocking !== false);
1333
+ const decision = dependencies.evaluateGate([...gateDecisionFindings], params.policy);
1334
+ const hasNonBlockingAdvisoryFinding = effectiveFindings.some(
1335
+ (finding) =>
1336
+ finding.blocking === false &&
1337
+ (finding.severity === 'WARN' ||
1338
+ finding.severity === 'ERROR' ||
1339
+ finding.severity === 'CRITICAL')
1340
+ );
1274
1341
  const baseGateOutcome =
1275
1342
  sddBlockingFinding ||
1276
1343
  degradedModeBlocks ||
@@ -1286,7 +1353,8 @@ export async function runPlatformGate(params: {
1286
1353
  brownfieldHotspotFindings.some((finding) => shouldBlockFromFinding(finding)) ||
1287
1354
  hasTddBddBlockingFinding
1288
1355
  ? 'BLOCK'
1289
- : (decision.outcome === 'PASS' && tddBddSnapshot?.status === 'advisory'
1356
+ : (decision.outcome === 'PASS' &&
1357
+ (tddBddSnapshot?.status === 'advisory' || hasNonBlockingAdvisoryFinding)
1290
1358
  ? 'WARN'
1291
1359
  : decision.outcome);
1292
1360
  const gateWaiverStage =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.234",
3
+ "version": "6.3.235",
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": {