pumuki 6.3.237 → 6.3.238

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/VERSION CHANGED
@@ -1 +1 @@
1
- v6.3.237
1
+ v6.3.238
@@ -100,6 +100,16 @@ const collectStagedMatchingExtensions = (
100
100
  .filter((path) => hasAllowedExtension(path, extensions));
101
101
  };
102
102
 
103
+ const collectStagedFiles = (
104
+ git: Pick<IGitService, 'resolveRepoRoot' | 'runGit'>
105
+ ): string[] => {
106
+ const repoRoot = git.resolveRepoRoot();
107
+ return git.runGit(['diff', '--cached', '--name-only'], repoRoot)
108
+ .split('\n')
109
+ .map((line) => line.trim())
110
+ .filter((line) => line.length > 0);
111
+ };
112
+
103
113
  const runGitOrNull = (
104
114
  git: Pick<IGitService, 'runGit'>,
105
115
  args: ReadonlyArray<string>,
@@ -205,11 +215,12 @@ const resolveLifecycleAuditScope = (params: {
205
215
  git: Pick<IGitService, 'runGit'>;
206
216
  repoRoot: string;
207
217
  extensions: ReadonlyArray<string>;
218
+ stagedFiles: ReadonlyArray<string>;
208
219
  stagedMatchingExtensions: ReadonlyArray<string>;
209
220
  }): LifecycleAuditScope => {
210
221
  if (
211
222
  (params.stage === 'PRE_WRITE' || params.stage === 'PRE_COMMIT') &&
212
- params.stagedMatchingExtensions.length > 0
223
+ params.stagedFiles.length > 0
213
224
  ) {
214
225
  return { kind: 'staged' };
215
226
  }
@@ -407,6 +418,29 @@ const toRangeNoSupportedCodeAuditAdvisoryFinding = (
407
418
  blocking: false,
408
419
  });
409
420
 
421
+ const isStagedWithoutSupportedCode = (params: {
422
+ stage: LifecycleAuditStage;
423
+ scope: LifecycleAuditScope;
424
+ stagedMatchingExtensions: ReadonlyArray<string>;
425
+ findings: ReadonlyArray<LifecycleAuditFinding>;
426
+ }): boolean =>
427
+ (params.stage === 'PRE_WRITE' || params.stage === 'PRE_COMMIT') &&
428
+ params.scope.kind === 'staged' &&
429
+ params.stagedMatchingExtensions.length === 0 &&
430
+ params.findings.length > 0;
431
+
432
+ const toStagedNoSupportedCodeAuditAdvisoryFinding = (
433
+ finding: LifecycleAuditFinding
434
+ ): LifecycleAuditFinding => ({
435
+ ...finding,
436
+ severity: 'INFO',
437
+ code: 'AUDIT_STAGED_NO_SUPPORTED_CODE_ADVISORY',
438
+ message:
439
+ 'Staged audit found no supported code files; baseline repository debt is retained as advisory for this documentation/config-only slice. ' +
440
+ finding.message,
441
+ blocking: false,
442
+ });
443
+
410
444
  export const runLifecycleAudit = async (params: {
411
445
  stage: LifecycleAuditStage;
412
446
  auditMode: 'gate' | 'engine';
@@ -427,12 +461,14 @@ export const runLifecycleAudit = async (params: {
427
461
  );
428
462
  const extensions = DEFAULT_FACT_FILE_EXTENSIONS;
429
463
  const untrackedMatchingExtensionsCount = countUntrackedMatchingExtensions(git, extensions);
464
+ const stagedFiles = collectStagedFiles(git);
430
465
  const stagedMatchingExtensions = collectStagedMatchingExtensions(git, extensions);
431
466
  const scope = resolveLifecycleAuditScope({
432
467
  stage: params.stage,
433
468
  git,
434
469
  repoRoot,
435
470
  extensions,
471
+ stagedFiles,
436
472
  stagedMatchingExtensions,
437
473
  });
438
474
  const gateScope = toGateScope(scope);
@@ -491,16 +527,24 @@ export const runLifecycleAudit = async (params: {
491
527
  scope,
492
528
  findings,
493
529
  });
530
+ const stagedWithoutSupportedCode = isStagedWithoutSupportedCode({
531
+ stage: params.stage,
532
+ scope,
533
+ stagedMatchingExtensions,
534
+ findings,
535
+ });
494
536
  const gateAllowed = originalGateExitCode === 0;
495
537
  const effectiveFindings = scopedGlobalEnforcementOnly
496
538
  ? findings.map(toScopedAuditAdvisoryFinding)
497
539
  : rangePrePushWithoutSupportedCodeSddOnly
498
540
  ? findings.map(toRangeNoSupportedCodeAuditAdvisoryFinding)
541
+ : stagedWithoutSupportedCode
542
+ ? findings.map(toStagedNoSupportedCodeAuditAdvisoryFinding)
499
543
  : gateAllowed
500
544
  ? findings.map(toGateAllowedAuditAdvisoryFinding)
501
545
  : findings;
502
546
  const gateExitCode =
503
- scopedGlobalEnforcementOnly || rangePrePushWithoutSupportedCodeSddOnly
547
+ scopedGlobalEnforcementOnly || rangePrePushWithoutSupportedCodeSddOnly || stagedWithoutSupportedCode
504
548
  ? 0
505
549
  : originalGateExitCode;
506
550
  const effectiveSnapshotOutcome =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.237",
3
+ "version": "6.3.238",
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": {