pumuki 6.3.236 → 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.236
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 =
@@ -1989,6 +1989,11 @@ export const buildPreWriteValidationPanel = (params: {
1989
1989
  }): string => {
1990
1990
  const git = params.aiGate.repo_state.git;
1991
1991
  const receipt = params.aiGate.mcp_receipt;
1992
+ const blockingViolations = params.aiGate.violations.filter((violation) => violation.severity === 'ERROR');
1993
+ const nonBlockingViolations = params.aiGate.violations.filter((violation) => violation.severity !== 'ERROR');
1994
+ const rawSkillsContractStatus = params.aiGate.skills_contract?.status ?? 'n/a';
1995
+ const visibleSkillsContractStatus =
1996
+ rawSkillsContractStatus === 'FAIL' && params.aiGate.allowed ? 'ADVISORY' : rawSkillsContractStatus;
1992
1997
  const lines: string[] = [
1993
1998
  'PRE-FLIGHT CHECK',
1994
1999
  `Stage: ${params.sdd.stage} · SDD: ${params.sdd.decision.code} · AI Gate: ${params.aiGate.status}`,
@@ -1997,9 +2002,9 @@ export const buildPreWriteValidationPanel = (params: {
1997
2002
  `Evidence: kind=${params.aiGate.evidence.kind} age=${params.aiGate.evidence.age_seconds ?? 'n/a'}s max=${params.aiGate.evidence.max_age_seconds}s`,
1998
2003
  `Evidence source: source=${params.aiGate.evidence.source.source} path=${params.aiGate.evidence.source.path} digest=${params.aiGate.evidence.source.digest ?? 'null'} generated_at=${params.aiGate.evidence.source.generated_at ?? 'null'}`,
1999
2004
  `MCP receipt: required=${receipt.required ? 'yes' : 'no'} kind=${receipt.kind} age=${receipt.age_seconds ?? 'n/a'}s max=${receipt.max_age_seconds ?? 'n/a'}s`,
2000
- `Skills contract: enforced=${params.aiGate.skills_contract?.enforced ? 'yes' : 'no'} status=${params.aiGate.skills_contract?.status ?? 'n/a'} platforms=${params.aiGate.skills_contract?.detected_platforms.join(',') ?? 'none'}`,
2005
+ `Skills contract: enforced=${params.aiGate.skills_contract?.enforced ? 'yes' : 'no'} status=${visibleSkillsContractStatus} platforms=${params.aiGate.skills_contract?.detected_platforms.join(',') ?? 'none'}`,
2001
2006
  `Auto-heal: attempted=${params.automation.attempted ? 'yes' : 'no'} actions=${params.automation.actions.length}`,
2002
- `Violations: ${params.aiGate.violations.length}`,
2007
+ `Violations: blocking=${blockingViolations.length} advisory=${nonBlockingViolations.length}`,
2003
2008
  ];
2004
2009
 
2005
2010
  if (params.automation.actions.length > 0) {
@@ -2010,15 +2015,15 @@ export const buildPreWriteValidationPanel = (params: {
2010
2015
  }
2011
2016
  }
2012
2017
 
2013
- if (params.aiGate.violations.length > 0) {
2018
+ if (blockingViolations.length > 0) {
2014
2019
  lines.push('');
2015
2020
  lines.push('Blocking causes:');
2016
- for (const violation of params.aiGate.violations) {
2021
+ for (const violation of blockingViolations) {
2017
2022
  lines.push(`- ${violation.code}: ${violation.message}`);
2018
2023
  }
2019
2024
  lines.push('');
2020
2025
  lines.push('Operational hints:');
2021
- for (const violation of params.aiGate.violations) {
2026
+ for (const violation of blockingViolations) {
2022
2027
  const hint = PRE_WRITE_HINTS_BY_CODE[violation.code];
2023
2028
  if (!hint) {
2024
2029
  continue;
@@ -2027,6 +2032,14 @@ export const buildPreWriteValidationPanel = (params: {
2027
2032
  }
2028
2033
  }
2029
2034
 
2035
+ if (nonBlockingViolations.length > 0) {
2036
+ lines.push('');
2037
+ lines.push('Advisory findings:');
2038
+ for (const violation of nonBlockingViolations) {
2039
+ lines.push(`- ${violation.code}: ${violation.message}`);
2040
+ }
2041
+ }
2042
+
2030
2043
  return renderPreWritePanel(lines);
2031
2044
  };
2032
2045
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki",
3
- "version": "6.3.236",
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": {