@aisdlc/core 1.1.1 → 1.2.0
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/dist/index.cjs +98 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +98 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -6,6 +6,9 @@ interface QualityPolicy {
|
|
|
6
6
|
max_cognitive: number;
|
|
7
7
|
min_maintainability: number;
|
|
8
8
|
max_function_lines: number;
|
|
9
|
+
min_line_coverage: number;
|
|
10
|
+
min_branch_coverage: number;
|
|
11
|
+
min_function_coverage: number;
|
|
9
12
|
enforce_mode: 'STRICT' | 'PERMISSIVE' | string;
|
|
10
13
|
target_directories: string[];
|
|
11
14
|
supported_extensions: string[];
|
|
@@ -478,6 +481,13 @@ interface PreflightCheckResult {
|
|
|
478
481
|
digestsSynced: number;
|
|
479
482
|
gates: PreflightGateSummary[];
|
|
480
483
|
}
|
|
484
|
+
interface CodeCoverageSummary {
|
|
485
|
+
linesPct: number;
|
|
486
|
+
branchesPct: number;
|
|
487
|
+
functionsPct: number;
|
|
488
|
+
statementsPct?: number;
|
|
489
|
+
source: string;
|
|
490
|
+
}
|
|
481
491
|
interface QualityReportOptions {
|
|
482
492
|
rootDir?: string;
|
|
483
493
|
policyPath?: string;
|
|
@@ -490,6 +500,7 @@ interface QualityReportResult {
|
|
|
490
500
|
avgMaintainability: number;
|
|
491
501
|
avgCyclomatic: number;
|
|
492
502
|
verdict: 'PASS' | 'FAIL';
|
|
503
|
+
coverage?: CodeCoverageSummary | null;
|
|
493
504
|
}
|
|
494
505
|
interface BranchValidationSuccess {
|
|
495
506
|
valid: true;
|
|
@@ -1117,6 +1128,7 @@ declare function detectPromptInjection(content: string): PromptInjectionFinding[
|
|
|
1117
1128
|
|
|
1118
1129
|
declare function calculateRating(mi: number, cc: number): 'A' | 'B' | 'C' | 'D' | 'F';
|
|
1119
1130
|
declare function detectLanguage(filePath: string): string;
|
|
1131
|
+
declare function readCodeCoverageSummary(rootDir?: string): CodeCoverageSummary | null;
|
|
1120
1132
|
declare function generateQualityReport(options?: QualityReportOptions): QualityReportResult;
|
|
1121
1133
|
|
|
1122
1134
|
/**
|
|
@@ -1396,6 +1408,7 @@ declare function collectDashboardMetrics(rootDir: string): {
|
|
|
1396
1408
|
gate: QualityGateResult;
|
|
1397
1409
|
gov: GovernanceResult;
|
|
1398
1410
|
cov: TestingCoverageResult;
|
|
1411
|
+
codeCoverage: CodeCoverageSummary | null;
|
|
1399
1412
|
trace: TraceabilityResult;
|
|
1400
1413
|
history: DashboardHistoricalKpi[];
|
|
1401
1414
|
activePrKpi: PrKpiAggregation | null;
|
|
@@ -1665,4 +1678,4 @@ declare function initProject(options?: InitProjectOptions): InitProjectResult;
|
|
|
1665
1678
|
|
|
1666
1679
|
declare function walkMdFiles(dir: string, fileList?: string[], excludeDirs?: string[]): string[];
|
|
1667
1680
|
|
|
1668
|
-
export { ALL_ARCHITECTURE_TEMPLATES, type ActiveTaskMatch, type AgentTarget, type AnalysisResult, type ArchTemplateDef, type ArchitectureGranularity, type ArtifactFrontmatter, type ArtifactSchemaOptions, type ArtifactSchemaResult, type ArtifactSchemaViolation, type ArtifactValidationResult, type AuthorIdentity, type AuthorKpiSummary, type AutonomyMode, BRANCH_PATTERNS, type BranchClassificationResult, type BranchHierarchyPlan, type BranchValidationError, type BranchValidationSuccess, type BugRecordSummary, type ChangeDetectionOptions, type ChangeDetectionResult, type ChangeProfile, type CiProvider, type CommitKpiRecord, type CommitTrailers, type CycloneDxBom, type CycloneDxComponent, type CycloneDxLicense, type CytoscapeEdgeData, type CytoscapeElement, type CytoscapeNodeData, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_SAST_EXCLUDES, type DashboardHistoricalKpi, type DashboardOptions, type DashboardResult, type DiffLineItem, type DuplicateIssue, type DuplicateIssueType, type DuplicateSeverity, type DuplicateVerifierOptions, type DuplicateVerifierResult, type ExtractedFeature, type FunctionMetrics, GENERAL_SOURCE_EXTENSIONS, type GherkinExtractionOptions, type GherkinExtractionResult, type GherkinSyncCheckResult, type GitCheckoutTaskOptions, type GitCheckoutTaskResult, type GovernanceOptions, type GovernanceResult, type GraphElementsResult, type GraphNodeLayer, type GraphNodeStatus, type GraphNodeType, type HookInstallResult, type InitProjectOptions, type InitProjectResult, type JsonSchemaRule, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, type LicensePolicy, type LicenseVerificationOptions, type LicenseVerificationResult, type LicenseViolation, type ModelDefectStats, OpenSpecAdapter, PREPARE_COMMIT_MSG_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, type PdacDrift, type PdacGraphOptions, type PdacGraphResult, type PdacNode, type PdacSyncDetail, type PdacSyncOptions, type PdacSyncResult, type PrKpiAggregation, type PreflightCheckOptions, type PreflightCheckResult, type PreflightGateSummary, type ProductHandoff, type ProductHandoffSubgraph, type ProgressiveFrictionOptions, type ProgressiveFrictionResult, type PromptInjectionFinding, type QualityGateOptions, type QualityGateResult, type QualityPolicy, type QualityReportOptions, type QualityReportResult, type QualityThresholds, type ReleaseKpiReport, type RequirementAuditItem, type ResolvedCiEnv, SAST_RULES, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_LICENSE_POLICY, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_TASK_TEMPLATE, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, type SastFindingType, type SastRule, type SastSeverity, type SastVerifierOptions, type SastVerifierResult, type SastViolation, type SbomGenerateOptions, type ScaTool, type ScanOptions, type ScannedDependency, type ScannedRequirement, type SddAdapter, type SddChangeScaffoldOptions, type SddChangeScaffoldResult, type SddDepositOptions, type SddFramework, type SddIntegrationAudit, type SddIntegrationOptions, type SddIntegrationResult, type SddValidationResult, type SddWorkspaceInfo, type SecretFindingType, type SecretRule, type SecretVerifierOptions, type SecretVerifierResult, type SecretViolation, type SpecCatalogScope, SpecKitAdapter, type SpecializedAgentTemplate, type SupportedCiProvider, TYPE_TO_SCHEMA_MAP, type TaskAuditItem, type TaskItem, type TaskLocateResult, type TaskSummary, type TaskVerification, type TestingCoverageOptions, type TestingCoverageResult, type TraceabilityOptions, type TraceabilityResult, type TraceabilityRow, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, aggregatePrKpis, aggregateReleaseKpis, appendRevisionHistoryRow, buildCycloneDxComponent, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, checkGherkinInSync, checkoutTaskBranch, classifyBranch, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeSha256, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generateQualityReport, generateSastReportMarkdown, generateSecretsReportMarkdown, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, installGitHooks, integrateSddChange, isGitleaksInstalled, isPathProtectedFromPatch, isPlaceholderOrIgnored, isRequirementArtifact, isSemgrepInstalled, isToolAvailable, loadProductHandoffSidecar, locateTaskInActiveChanges, maskSecret, normalizeSpdxLicense, parseCommitTrailers, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, processPackageDir, readPackageJson, renderAntigravityAgentFile, renderClaudeAgentFile, renderCopilotAgentFile, renderCursorAgentFile, renderDashboardHtml, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCytoscapePath, resolveFeatureFilePath, resolveLicenseFromFile, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForSast, scanInstalledLicenses, scanPnpmStore, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, slugify, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyPdacGraph, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCycloneDxSbom, writeReleaseKpiReport, writeThirdPartyNotices };
|
|
1681
|
+
export { ALL_ARCHITECTURE_TEMPLATES, type ActiveTaskMatch, type AgentTarget, type AnalysisResult, type ArchTemplateDef, type ArchitectureGranularity, type ArtifactFrontmatter, type ArtifactSchemaOptions, type ArtifactSchemaResult, type ArtifactSchemaViolation, type ArtifactValidationResult, type AuthorIdentity, type AuthorKpiSummary, type AutonomyMode, BRANCH_PATTERNS, type BranchClassificationResult, type BranchHierarchyPlan, type BranchValidationError, type BranchValidationSuccess, type BugRecordSummary, type ChangeDetectionOptions, type ChangeDetectionResult, type ChangeProfile, type CiProvider, type CodeCoverageSummary, type CommitKpiRecord, type CommitTrailers, type CycloneDxBom, type CycloneDxComponent, type CycloneDxLicense, type CytoscapeEdgeData, type CytoscapeElement, type CytoscapeNodeData, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_SAST_EXCLUDES, type DashboardHistoricalKpi, type DashboardOptions, type DashboardResult, type DiffLineItem, type DuplicateIssue, type DuplicateIssueType, type DuplicateSeverity, type DuplicateVerifierOptions, type DuplicateVerifierResult, type ExtractedFeature, type FunctionMetrics, GENERAL_SOURCE_EXTENSIONS, type GherkinExtractionOptions, type GherkinExtractionResult, type GherkinSyncCheckResult, type GitCheckoutTaskOptions, type GitCheckoutTaskResult, type GovernanceOptions, type GovernanceResult, type GraphElementsResult, type GraphNodeLayer, type GraphNodeStatus, type GraphNodeType, type HookInstallResult, type InitProjectOptions, type InitProjectResult, type JsonSchemaRule, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, type LicensePolicy, type LicenseVerificationOptions, type LicenseVerificationResult, type LicenseViolation, type ModelDefectStats, OpenSpecAdapter, PREPARE_COMMIT_MSG_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, type PdacDrift, type PdacGraphOptions, type PdacGraphResult, type PdacNode, type PdacSyncDetail, type PdacSyncOptions, type PdacSyncResult, type PrKpiAggregation, type PreflightCheckOptions, type PreflightCheckResult, type PreflightGateSummary, type ProductHandoff, type ProductHandoffSubgraph, type ProgressiveFrictionOptions, type ProgressiveFrictionResult, type PromptInjectionFinding, type QualityGateOptions, type QualityGateResult, type QualityPolicy, type QualityReportOptions, type QualityReportResult, type QualityThresholds, type ReleaseKpiReport, type RequirementAuditItem, type ResolvedCiEnv, SAST_RULES, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_LICENSE_POLICY, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_TASK_TEMPLATE, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, type SastFindingType, type SastRule, type SastSeverity, type SastVerifierOptions, type SastVerifierResult, type SastViolation, type SbomGenerateOptions, type ScaTool, type ScanOptions, type ScannedDependency, type ScannedRequirement, type SddAdapter, type SddChangeScaffoldOptions, type SddChangeScaffoldResult, type SddDepositOptions, type SddFramework, type SddIntegrationAudit, type SddIntegrationOptions, type SddIntegrationResult, type SddValidationResult, type SddWorkspaceInfo, type SecretFindingType, type SecretRule, type SecretVerifierOptions, type SecretVerifierResult, type SecretViolation, type SpecCatalogScope, SpecKitAdapter, type SpecializedAgentTemplate, type SupportedCiProvider, TYPE_TO_SCHEMA_MAP, type TaskAuditItem, type TaskItem, type TaskLocateResult, type TaskSummary, type TaskVerification, type TestingCoverageOptions, type TestingCoverageResult, type TraceabilityOptions, type TraceabilityResult, type TraceabilityRow, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, aggregatePrKpis, aggregateReleaseKpis, appendRevisionHistoryRow, buildCycloneDxComponent, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, checkGherkinInSync, checkoutTaskBranch, classifyBranch, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeSha256, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generateQualityReport, generateSastReportMarkdown, generateSecretsReportMarkdown, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, installGitHooks, integrateSddChange, isGitleaksInstalled, isPathProtectedFromPatch, isPlaceholderOrIgnored, isRequirementArtifact, isSemgrepInstalled, isToolAvailable, loadProductHandoffSidecar, locateTaskInActiveChanges, maskSecret, normalizeSpdxLicense, parseCommitTrailers, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, processPackageDir, readCodeCoverageSummary, readPackageJson, renderAntigravityAgentFile, renderClaudeAgentFile, renderCopilotAgentFile, renderCursorAgentFile, renderDashboardHtml, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCytoscapePath, resolveFeatureFilePath, resolveLicenseFromFile, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForSast, scanInstalledLicenses, scanPnpmStore, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, slugify, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyPdacGraph, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCycloneDxSbom, writeReleaseKpiReport, writeThirdPartyNotices };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ interface QualityPolicy {
|
|
|
6
6
|
max_cognitive: number;
|
|
7
7
|
min_maintainability: number;
|
|
8
8
|
max_function_lines: number;
|
|
9
|
+
min_line_coverage: number;
|
|
10
|
+
min_branch_coverage: number;
|
|
11
|
+
min_function_coverage: number;
|
|
9
12
|
enforce_mode: 'STRICT' | 'PERMISSIVE' | string;
|
|
10
13
|
target_directories: string[];
|
|
11
14
|
supported_extensions: string[];
|
|
@@ -478,6 +481,13 @@ interface PreflightCheckResult {
|
|
|
478
481
|
digestsSynced: number;
|
|
479
482
|
gates: PreflightGateSummary[];
|
|
480
483
|
}
|
|
484
|
+
interface CodeCoverageSummary {
|
|
485
|
+
linesPct: number;
|
|
486
|
+
branchesPct: number;
|
|
487
|
+
functionsPct: number;
|
|
488
|
+
statementsPct?: number;
|
|
489
|
+
source: string;
|
|
490
|
+
}
|
|
481
491
|
interface QualityReportOptions {
|
|
482
492
|
rootDir?: string;
|
|
483
493
|
policyPath?: string;
|
|
@@ -490,6 +500,7 @@ interface QualityReportResult {
|
|
|
490
500
|
avgMaintainability: number;
|
|
491
501
|
avgCyclomatic: number;
|
|
492
502
|
verdict: 'PASS' | 'FAIL';
|
|
503
|
+
coverage?: CodeCoverageSummary | null;
|
|
493
504
|
}
|
|
494
505
|
interface BranchValidationSuccess {
|
|
495
506
|
valid: true;
|
|
@@ -1117,6 +1128,7 @@ declare function detectPromptInjection(content: string): PromptInjectionFinding[
|
|
|
1117
1128
|
|
|
1118
1129
|
declare function calculateRating(mi: number, cc: number): 'A' | 'B' | 'C' | 'D' | 'F';
|
|
1119
1130
|
declare function detectLanguage(filePath: string): string;
|
|
1131
|
+
declare function readCodeCoverageSummary(rootDir?: string): CodeCoverageSummary | null;
|
|
1120
1132
|
declare function generateQualityReport(options?: QualityReportOptions): QualityReportResult;
|
|
1121
1133
|
|
|
1122
1134
|
/**
|
|
@@ -1396,6 +1408,7 @@ declare function collectDashboardMetrics(rootDir: string): {
|
|
|
1396
1408
|
gate: QualityGateResult;
|
|
1397
1409
|
gov: GovernanceResult;
|
|
1398
1410
|
cov: TestingCoverageResult;
|
|
1411
|
+
codeCoverage: CodeCoverageSummary | null;
|
|
1399
1412
|
trace: TraceabilityResult;
|
|
1400
1413
|
history: DashboardHistoricalKpi[];
|
|
1401
1414
|
activePrKpi: PrKpiAggregation | null;
|
|
@@ -1665,4 +1678,4 @@ declare function initProject(options?: InitProjectOptions): InitProjectResult;
|
|
|
1665
1678
|
|
|
1666
1679
|
declare function walkMdFiles(dir: string, fileList?: string[], excludeDirs?: string[]): string[];
|
|
1667
1680
|
|
|
1668
|
-
export { ALL_ARCHITECTURE_TEMPLATES, type ActiveTaskMatch, type AgentTarget, type AnalysisResult, type ArchTemplateDef, type ArchitectureGranularity, type ArtifactFrontmatter, type ArtifactSchemaOptions, type ArtifactSchemaResult, type ArtifactSchemaViolation, type ArtifactValidationResult, type AuthorIdentity, type AuthorKpiSummary, type AutonomyMode, BRANCH_PATTERNS, type BranchClassificationResult, type BranchHierarchyPlan, type BranchValidationError, type BranchValidationSuccess, type BugRecordSummary, type ChangeDetectionOptions, type ChangeDetectionResult, type ChangeProfile, type CiProvider, type CommitKpiRecord, type CommitTrailers, type CycloneDxBom, type CycloneDxComponent, type CycloneDxLicense, type CytoscapeEdgeData, type CytoscapeElement, type CytoscapeNodeData, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_SAST_EXCLUDES, type DashboardHistoricalKpi, type DashboardOptions, type DashboardResult, type DiffLineItem, type DuplicateIssue, type DuplicateIssueType, type DuplicateSeverity, type DuplicateVerifierOptions, type DuplicateVerifierResult, type ExtractedFeature, type FunctionMetrics, GENERAL_SOURCE_EXTENSIONS, type GherkinExtractionOptions, type GherkinExtractionResult, type GherkinSyncCheckResult, type GitCheckoutTaskOptions, type GitCheckoutTaskResult, type GovernanceOptions, type GovernanceResult, type GraphElementsResult, type GraphNodeLayer, type GraphNodeStatus, type GraphNodeType, type HookInstallResult, type InitProjectOptions, type InitProjectResult, type JsonSchemaRule, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, type LicensePolicy, type LicenseVerificationOptions, type LicenseVerificationResult, type LicenseViolation, type ModelDefectStats, OpenSpecAdapter, PREPARE_COMMIT_MSG_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, type PdacDrift, type PdacGraphOptions, type PdacGraphResult, type PdacNode, type PdacSyncDetail, type PdacSyncOptions, type PdacSyncResult, type PrKpiAggregation, type PreflightCheckOptions, type PreflightCheckResult, type PreflightGateSummary, type ProductHandoff, type ProductHandoffSubgraph, type ProgressiveFrictionOptions, type ProgressiveFrictionResult, type PromptInjectionFinding, type QualityGateOptions, type QualityGateResult, type QualityPolicy, type QualityReportOptions, type QualityReportResult, type QualityThresholds, type ReleaseKpiReport, type RequirementAuditItem, type ResolvedCiEnv, SAST_RULES, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_LICENSE_POLICY, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_TASK_TEMPLATE, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, type SastFindingType, type SastRule, type SastSeverity, type SastVerifierOptions, type SastVerifierResult, type SastViolation, type SbomGenerateOptions, type ScaTool, type ScanOptions, type ScannedDependency, type ScannedRequirement, type SddAdapter, type SddChangeScaffoldOptions, type SddChangeScaffoldResult, type SddDepositOptions, type SddFramework, type SddIntegrationAudit, type SddIntegrationOptions, type SddIntegrationResult, type SddValidationResult, type SddWorkspaceInfo, type SecretFindingType, type SecretRule, type SecretVerifierOptions, type SecretVerifierResult, type SecretViolation, type SpecCatalogScope, SpecKitAdapter, type SpecializedAgentTemplate, type SupportedCiProvider, TYPE_TO_SCHEMA_MAP, type TaskAuditItem, type TaskItem, type TaskLocateResult, type TaskSummary, type TaskVerification, type TestingCoverageOptions, type TestingCoverageResult, type TraceabilityOptions, type TraceabilityResult, type TraceabilityRow, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, aggregatePrKpis, aggregateReleaseKpis, appendRevisionHistoryRow, buildCycloneDxComponent, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, checkGherkinInSync, checkoutTaskBranch, classifyBranch, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeSha256, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generateQualityReport, generateSastReportMarkdown, generateSecretsReportMarkdown, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, installGitHooks, integrateSddChange, isGitleaksInstalled, isPathProtectedFromPatch, isPlaceholderOrIgnored, isRequirementArtifact, isSemgrepInstalled, isToolAvailable, loadProductHandoffSidecar, locateTaskInActiveChanges, maskSecret, normalizeSpdxLicense, parseCommitTrailers, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, processPackageDir, readPackageJson, renderAntigravityAgentFile, renderClaudeAgentFile, renderCopilotAgentFile, renderCursorAgentFile, renderDashboardHtml, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCytoscapePath, resolveFeatureFilePath, resolveLicenseFromFile, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForSast, scanInstalledLicenses, scanPnpmStore, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, slugify, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyPdacGraph, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCycloneDxSbom, writeReleaseKpiReport, writeThirdPartyNotices };
|
|
1681
|
+
export { ALL_ARCHITECTURE_TEMPLATES, type ActiveTaskMatch, type AgentTarget, type AnalysisResult, type ArchTemplateDef, type ArchitectureGranularity, type ArtifactFrontmatter, type ArtifactSchemaOptions, type ArtifactSchemaResult, type ArtifactSchemaViolation, type ArtifactValidationResult, type AuthorIdentity, type AuthorKpiSummary, type AutonomyMode, BRANCH_PATTERNS, type BranchClassificationResult, type BranchHierarchyPlan, type BranchValidationError, type BranchValidationSuccess, type BugRecordSummary, type ChangeDetectionOptions, type ChangeDetectionResult, type ChangeProfile, type CiProvider, type CodeCoverageSummary, type CommitKpiRecord, type CommitTrailers, type CycloneDxBom, type CycloneDxComponent, type CycloneDxLicense, type CytoscapeEdgeData, type CytoscapeElement, type CytoscapeNodeData, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_SAST_EXCLUDES, type DashboardHistoricalKpi, type DashboardOptions, type DashboardResult, type DiffLineItem, type DuplicateIssue, type DuplicateIssueType, type DuplicateSeverity, type DuplicateVerifierOptions, type DuplicateVerifierResult, type ExtractedFeature, type FunctionMetrics, GENERAL_SOURCE_EXTENSIONS, type GherkinExtractionOptions, type GherkinExtractionResult, type GherkinSyncCheckResult, type GitCheckoutTaskOptions, type GitCheckoutTaskResult, type GovernanceOptions, type GovernanceResult, type GraphElementsResult, type GraphNodeLayer, type GraphNodeStatus, type GraphNodeType, type HookInstallResult, type InitProjectOptions, type InitProjectResult, type JsonSchemaRule, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, type LicensePolicy, type LicenseVerificationOptions, type LicenseVerificationResult, type LicenseViolation, type ModelDefectStats, OpenSpecAdapter, PREPARE_COMMIT_MSG_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, type PdacDrift, type PdacGraphOptions, type PdacGraphResult, type PdacNode, type PdacSyncDetail, type PdacSyncOptions, type PdacSyncResult, type PrKpiAggregation, type PreflightCheckOptions, type PreflightCheckResult, type PreflightGateSummary, type ProductHandoff, type ProductHandoffSubgraph, type ProgressiveFrictionOptions, type ProgressiveFrictionResult, type PromptInjectionFinding, type QualityGateOptions, type QualityGateResult, type QualityPolicy, type QualityReportOptions, type QualityReportResult, type QualityThresholds, type ReleaseKpiReport, type RequirementAuditItem, type ResolvedCiEnv, SAST_RULES, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_LICENSE_POLICY, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_TASK_TEMPLATE, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, type SastFindingType, type SastRule, type SastSeverity, type SastVerifierOptions, type SastVerifierResult, type SastViolation, type SbomGenerateOptions, type ScaTool, type ScanOptions, type ScannedDependency, type ScannedRequirement, type SddAdapter, type SddChangeScaffoldOptions, type SddChangeScaffoldResult, type SddDepositOptions, type SddFramework, type SddIntegrationAudit, type SddIntegrationOptions, type SddIntegrationResult, type SddValidationResult, type SddWorkspaceInfo, type SecretFindingType, type SecretRule, type SecretVerifierOptions, type SecretVerifierResult, type SecretViolation, type SpecCatalogScope, SpecKitAdapter, type SpecializedAgentTemplate, type SupportedCiProvider, TYPE_TO_SCHEMA_MAP, type TaskAuditItem, type TaskItem, type TaskLocateResult, type TaskSummary, type TaskVerification, type TestingCoverageOptions, type TestingCoverageResult, type TraceabilityOptions, type TraceabilityResult, type TraceabilityRow, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, aggregatePrKpis, aggregateReleaseKpis, appendRevisionHistoryRow, buildCycloneDxComponent, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, checkGherkinInSync, checkoutTaskBranch, classifyBranch, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeSha256, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generateQualityReport, generateSastReportMarkdown, generateSecretsReportMarkdown, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, installGitHooks, integrateSddChange, isGitleaksInstalled, isPathProtectedFromPatch, isPlaceholderOrIgnored, isRequirementArtifact, isSemgrepInstalled, isToolAvailable, loadProductHandoffSidecar, locateTaskInActiveChanges, maskSecret, normalizeSpdxLicense, parseCommitTrailers, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, processPackageDir, readCodeCoverageSummary, readPackageJson, renderAntigravityAgentFile, renderClaudeAgentFile, renderCopilotAgentFile, renderCursorAgentFile, renderDashboardHtml, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCytoscapePath, resolveFeatureFilePath, resolveLicenseFromFile, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForSast, scanInstalledLicenses, scanPnpmStore, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, slugify, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyPdacGraph, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCycloneDxSbom, writeReleaseKpiReport, writeThirdPartyNotices };
|
package/dist/index.js
CHANGED
|
@@ -485,6 +485,9 @@ function createDefaultQualityPolicy() {
|
|
|
485
485
|
max_cognitive: 15,
|
|
486
486
|
min_maintainability: 50,
|
|
487
487
|
max_function_lines: 40,
|
|
488
|
+
min_line_coverage: 85,
|
|
489
|
+
min_branch_coverage: 80,
|
|
490
|
+
min_function_coverage: 90,
|
|
488
491
|
enforce_mode: "STRICT",
|
|
489
492
|
target_directories: ["src", "lib", "examples", "tests"],
|
|
490
493
|
supported_extensions: [...DEFAULT_EXTENSIONS],
|
|
@@ -508,6 +511,15 @@ function applyDocScope(policy, doc) {
|
|
|
508
511
|
}
|
|
509
512
|
}
|
|
510
513
|
}
|
|
514
|
+
function applyCoverageThresholds(policy, covRaw) {
|
|
515
|
+
if (!covRaw || typeof covRaw !== "object") return;
|
|
516
|
+
const cov = covRaw;
|
|
517
|
+
if (cov.min_line_coverage_percent !== void 0) policy.min_line_coverage = Number(cov.min_line_coverage_percent);
|
|
518
|
+
if (cov.min_branch_coverage_percent !== void 0) policy.min_branch_coverage = Number(cov.min_branch_coverage_percent);
|
|
519
|
+
if (cov.min_function_coverage_percent !== void 0) {
|
|
520
|
+
policy.min_function_coverage = Number(cov.min_function_coverage_percent);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
511
523
|
function applyDocThresholds(policy, doc) {
|
|
512
524
|
const sections = [doc.release_thresholds, doc.thresholds].filter(
|
|
513
525
|
(s) => Boolean(s && typeof s === "object")
|
|
@@ -521,6 +533,7 @@ function applyDocThresholds(policy, doc) {
|
|
|
521
533
|
if (cog !== void 0) policy.max_cognitive = Number(cog);
|
|
522
534
|
if (mi !== void 0) policy.min_maintainability = Number(mi);
|
|
523
535
|
if (loc !== void 0) policy.max_function_lines = Number(loc);
|
|
536
|
+
applyCoverageThresholds(policy, s.test_coverage);
|
|
524
537
|
}
|
|
525
538
|
const codingRules = doc.coding_rules;
|
|
526
539
|
const rules = codingRules?.rules;
|
|
@@ -5787,6 +5800,78 @@ function detectLanguage(filePath) {
|
|
|
5787
5800
|
return "Unknown";
|
|
5788
5801
|
}
|
|
5789
5802
|
}
|
|
5803
|
+
function parseJsonSummaryFile(filePath, relSource) {
|
|
5804
|
+
try {
|
|
5805
|
+
const raw = JSON.parse(fs6.readFileSync(filePath, "utf-8"));
|
|
5806
|
+
const total = raw.total;
|
|
5807
|
+
if (!total || typeof total !== "object") return null;
|
|
5808
|
+
const linesPct = Number(total.lines?.pct);
|
|
5809
|
+
const branchesPct = Number(total.branches?.pct);
|
|
5810
|
+
const functionsPct = Number(total.functions?.pct);
|
|
5811
|
+
if (Number.isNaN(linesPct) || Number.isNaN(branchesPct) || Number.isNaN(functionsPct)) return null;
|
|
5812
|
+
const statementsPct = total.statements?.pct !== void 0 ? Number(total.statements.pct) : void 0;
|
|
5813
|
+
return { linesPct, branchesPct, functionsPct, statementsPct, source: relSource };
|
|
5814
|
+
} catch {
|
|
5815
|
+
return null;
|
|
5816
|
+
}
|
|
5817
|
+
}
|
|
5818
|
+
function parseLcovFile(filePath, relSource) {
|
|
5819
|
+
try {
|
|
5820
|
+
const lines = fs6.readFileSync(filePath, "utf-8").split(/\r?\n/);
|
|
5821
|
+
let lf = 0, lh = 0, brf = 0, brh = 0, fnf = 0, fnh = 0;
|
|
5822
|
+
for (const line of lines) {
|
|
5823
|
+
if (line.startsWith("LF:")) lf += parseInt(line.slice(3), 10) || 0;
|
|
5824
|
+
else if (line.startsWith("LH:")) lh += parseInt(line.slice(3), 10) || 0;
|
|
5825
|
+
else if (line.startsWith("BRF:")) brf += parseInt(line.slice(4), 10) || 0;
|
|
5826
|
+
else if (line.startsWith("BRH:")) brh += parseInt(line.slice(4), 10) || 0;
|
|
5827
|
+
else if (line.startsWith("FNF:")) fnf += parseInt(line.slice(4), 10) || 0;
|
|
5828
|
+
else if (line.startsWith("FNH:")) fnh += parseInt(line.slice(4), 10) || 0;
|
|
5829
|
+
}
|
|
5830
|
+
if (lf === 0 && fnf === 0 && brf === 0) return null;
|
|
5831
|
+
const pct = (hit, found) => found > 0 ? Math.round(hit / found * 1e3) / 10 : 100;
|
|
5832
|
+
return {
|
|
5833
|
+
linesPct: pct(lh, lf),
|
|
5834
|
+
branchesPct: pct(brh, brf),
|
|
5835
|
+
functionsPct: pct(fnh, fnf),
|
|
5836
|
+
source: relSource
|
|
5837
|
+
};
|
|
5838
|
+
} catch {
|
|
5839
|
+
return null;
|
|
5840
|
+
}
|
|
5841
|
+
}
|
|
5842
|
+
function readCodeCoverageSummary(rootDir = process.cwd()) {
|
|
5843
|
+
const jsonCandidates = ["coverage/coverage-summary.json", "reports/coverage-summary.json"];
|
|
5844
|
+
for (const rel of jsonCandidates) {
|
|
5845
|
+
const full = path8.join(rootDir, rel);
|
|
5846
|
+
if (fs6.existsSync(full)) {
|
|
5847
|
+
const parsed = parseJsonSummaryFile(full, rel);
|
|
5848
|
+
if (parsed) return parsed;
|
|
5849
|
+
}
|
|
5850
|
+
}
|
|
5851
|
+
const lcovCandidates = ["coverage/lcov.info", "lcov.info", "reports/lcov.info"];
|
|
5852
|
+
for (const rel of lcovCandidates) {
|
|
5853
|
+
const full = path8.join(rootDir, rel);
|
|
5854
|
+
if (fs6.existsSync(full)) {
|
|
5855
|
+
const parsed = parseLcovFile(full, rel);
|
|
5856
|
+
if (parsed) return parsed;
|
|
5857
|
+
}
|
|
5858
|
+
}
|
|
5859
|
+
return null;
|
|
5860
|
+
}
|
|
5861
|
+
function formatCoverageRow(label, measured, minThreshold) {
|
|
5862
|
+
if (measured === void 0) {
|
|
5863
|
+
return `| **${label}** | \`N/A (Run test:coverage)\` | $\\ge ${minThreshold}\\%$ | \u2139\uFE0F NOT MEASURED |`;
|
|
5864
|
+
}
|
|
5865
|
+
const status = measured >= minThreshold ? "\u2705 COMPLIANT" : "\u26A0\uFE0F BELOW THRESHOLD";
|
|
5866
|
+
return `| **${label}** | \`${measured}%\` | $\\ge ${minThreshold}\\%$ | ${status} |`;
|
|
5867
|
+
}
|
|
5868
|
+
function buildCoverageRows(coverage, policy) {
|
|
5869
|
+
return [
|
|
5870
|
+
formatCoverageRow("Line Coverage", coverage?.linesPct, policy.min_line_coverage),
|
|
5871
|
+
formatCoverageRow("Branch Coverage", coverage?.branchesPct, policy.min_branch_coverage),
|
|
5872
|
+
formatCoverageRow("Function Coverage", coverage?.functionsPct, policy.min_function_coverage)
|
|
5873
|
+
];
|
|
5874
|
+
}
|
|
5790
5875
|
function generateQualityReport(options = {}) {
|
|
5791
5876
|
const rootDir = options.rootDir || process.cwd();
|
|
5792
5877
|
const gateResult = verifyQualityGate({
|
|
@@ -5794,6 +5879,7 @@ function generateQualityReport(options = {}) {
|
|
|
5794
5879
|
policyPath: options.policyPath,
|
|
5795
5880
|
thresholds: options.thresholds
|
|
5796
5881
|
});
|
|
5882
|
+
const coverage = readCodeCoverageSummary(rootDir);
|
|
5797
5883
|
const totalFiles = gateResult.totalFiles;
|
|
5798
5884
|
const totalFunctions = gateResult.totalFunctions;
|
|
5799
5885
|
let totalMi = 0;
|
|
@@ -5842,6 +5928,7 @@ function generateQualityReport(options = {}) {
|
|
|
5842
5928
|
`| **Cyclomatic Complexity (Average)** | \`${avgCyclomatic}\` | $\\le ${gateResult.policy.max_cyclomatic}$ | ${avgCyclomatic <= gateResult.policy.max_cyclomatic ? "\u2705 COMPLIANT" : "\u274C EXCEEDED"} |`,
|
|
5843
5929
|
`| **Cognitive Complexity (Average)** | \`${avgCognitive}\` | $\\le ${gateResult.policy.max_cognitive}$ | ${avgCognitive <= gateResult.policy.max_cognitive ? "\u2705 COMPLIANT" : "\u274C EXCEEDED"} |`,
|
|
5844
5930
|
`| **Maintainability Index (SEI MI)** | \`${avgMaintainability} / 100\` | $\\ge ${gateResult.policy.min_maintainability}$ | ${avgMaintainability >= gateResult.policy.min_maintainability ? "\u2705 COMPLIANT" : "\u274C INSUFFICIENT"} |`,
|
|
5931
|
+
...buildCoverageRows(coverage, gateResult.policy),
|
|
5845
5932
|
`| **Functions in Violation** | \`${gateResult.failCount}\` | $0$ (Mode ${gateResult.policy.enforce_mode}) | ${gateResult.failCount === 0 ? "\u2705 0 VIOLATIONS" : "\u274C BLOCKED"} |`,
|
|
5846
5933
|
``,
|
|
5847
5934
|
`---`,
|
|
@@ -5873,6 +5960,7 @@ function generateQualityReport(options = {}) {
|
|
|
5873
5960
|
lines.push("## 4. Evaluation Criteria and Standards");
|
|
5874
5961
|
lines.push("- **McCabe Cyclomatic Complexity (CC)**: Number of linearly independent paths.");
|
|
5875
5962
|
lines.push("- **Maintainability Index (SEI MI)**: Normalized formula [0 - 100] combining Halstead Volume, CC, and LOC.");
|
|
5963
|
+
lines.push("- **Automated Test Coverage**: Passively ingested from `coverage/coverage-summary.json` or `lcov.info` when present.");
|
|
5876
5964
|
lines.push("- **Clean Code Guardrails**: Prohibition of implicit `any` typing, function length limits ($le 40$ lines), and zero unjustified suppressions.");
|
|
5877
5965
|
const markdown = lines.join("\n");
|
|
5878
5966
|
const reportsDir = path8.join(rootDir, "reports");
|
|
@@ -5884,7 +5972,8 @@ function generateQualityReport(options = {}) {
|
|
|
5884
5972
|
totalFunctions,
|
|
5885
5973
|
avgMaintainability,
|
|
5886
5974
|
avgCyclomatic,
|
|
5887
|
-
verdict
|
|
5975
|
+
verdict,
|
|
5976
|
+
coverage
|
|
5888
5977
|
};
|
|
5889
5978
|
}
|
|
5890
5979
|
|
|
@@ -7573,10 +7662,12 @@ function collectDashboardMetrics(rootDir) {
|
|
|
7573
7662
|
}
|
|
7574
7663
|
} catch {
|
|
7575
7664
|
}
|
|
7665
|
+
const codeCoverage = readCodeCoverageSummary(rootDir);
|
|
7576
7666
|
return {
|
|
7577
7667
|
gate,
|
|
7578
7668
|
gov,
|
|
7579
7669
|
cov,
|
|
7670
|
+
codeCoverage,
|
|
7580
7671
|
trace,
|
|
7581
7672
|
history,
|
|
7582
7673
|
activePrKpi,
|
|
@@ -8118,6 +8209,11 @@ function renderDashboardHtml(graphData, metricsData, title = "AI-SDLC: Dashboard
|
|
|
8118
8209
|
<span class="value">${metricsData.cov.totalRequirements > 0 ? Math.round(metricsData.cov.passedRequirements / metricsData.cov.totalRequirements * 100) : 100}%</span>
|
|
8119
8210
|
<span class="subtitle">${metricsData.cov.passedRequirements} / ${metricsData.cov.totalRequirements} verified</span>
|
|
8120
8211
|
</div>
|
|
8212
|
+
<div class="metric-card">
|
|
8213
|
+
<span class="title">Code Coverage (Lines)</span>
|
|
8214
|
+
<span class="value">${metricsData.codeCoverage ? metricsData.codeCoverage.linesPct + "%" : "N/A"}</span>
|
|
8215
|
+
<span class="subtitle">${metricsData.codeCoverage ? `Branches: ${metricsData.codeCoverage.branchesPct}% | Funcs: ${metricsData.codeCoverage.functionsPct}%` : `Min target: ${metricsData.gate.policy.min_line_coverage}% (Run test:coverage)`}</span>
|
|
8216
|
+
</div>
|
|
8121
8217
|
</div>
|
|
8122
8218
|
|
|
8123
8219
|
<div class="chart-container">
|
|
@@ -11383,6 +11479,6 @@ function initProject(options = {}) {
|
|
|
11383
11479
|
};
|
|
11384
11480
|
}
|
|
11385
11481
|
|
|
11386
|
-
export { ALL_ARCHITECTURE_TEMPLATES, BRANCH_PATTERNS, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_SAST_EXCLUDES, GENERAL_SOURCE_EXTENSIONS, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, OpenSpecAdapter, PREPARE_COMMIT_MSG_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, SAST_RULES, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_LICENSE_POLICY, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_TASK_TEMPLATE, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, SpecKitAdapter, TYPE_TO_SCHEMA_MAP, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, aggregatePrKpis, aggregateReleaseKpis, appendRevisionHistoryRow, buildCycloneDxComponent, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, checkGherkinInSync, checkoutTaskBranch, classifyBranch, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeSha256, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generateQualityReport, generateSastReportMarkdown, generateSecretsReportMarkdown, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, installGitHooks, integrateSddChange, isGitleaksInstalled, isPathProtectedFromPatch, isPlaceholderOrIgnored, isRequirementArtifact, isSemgrepInstalled, isToolAvailable, loadProductHandoffSidecar, locateTaskInActiveChanges, maskSecret, normalizeSpdxLicense, parseCommitTrailers, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, processPackageDir, readPackageJson, renderAntigravityAgentFile, renderClaudeAgentFile, renderCopilotAgentFile, renderCursorAgentFile, renderDashboardHtml, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCytoscapePath, resolveFeatureFilePath, resolveLicenseFromFile, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForSast, scanInstalledLicenses, scanPnpmStore, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, slugify, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyPdacGraph, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCycloneDxSbom, writeReleaseKpiReport, writeThirdPartyNotices };
|
|
11482
|
+
export { ALL_ARCHITECTURE_TEMPLATES, BRANCH_PATTERNS, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_EXCLUDES, DEFAULT_EXTENSIONS, DEFAULT_SAST_EXCLUDES, GENERAL_SOURCE_EXTENSIONS, KPI_SUMMARY_END_TAG, KPI_SUMMARY_START_TAG, OpenSpecAdapter, PREPARE_COMMIT_MSG_SCRIPT, PROMPT_INJECTION_SIGNATURES, PROTECTED_BYPASS_PATTERNS, SAST_RULES, SECRET_RULES, SPECIALIZED_AGENT_TEMPLATES, STARTER_ANTIGRAVITY_MCP, STARTER_ANTIGRAVITY_RULES, STARTER_ARCH_ADR, STARTER_ARCH_ARCHITECTURE_CONSTRAINTS, STARTER_ARCH_COMPONENT, STARTER_ARCH_CONTEXT_AND_SCOPE, STARTER_ARCH_CROSS_CUTTING_CONCEPTS, STARTER_ARCH_DEPLOYMENT_VIEW, STARTER_ARCH_GLOSSARY, STARTER_ARCH_INTRODUCTION_AND_GOALS, STARTER_ARCH_LEVEL_1_WHITEBOX, STARTER_ARCH_QUALITY_REQUIREMENTS, STARTER_ARCH_RISKS_AND_TECHNICAL_DEBT, STARTER_ARCH_RUNTIME_VIEW, STARTER_ARCH_SOLUTION_STRATEGY, STARTER_AZURE_PIPELINES, STARTER_BITBUCKET_PIPELINES, STARTER_CLAUDE_RULES, STARTER_COPILOT_RULES, STARTER_CURSOR_CORE_RULES, STARTER_CURSOR_MCP, STARTER_CURSOR_PRODUCT_RULES, STARTER_CURSOR_QUALITY_RULES, STARTER_GITHUB_CI, STARTER_GITHUB_SDD_INTEGRATE, STARTER_GITLAB_CI, STARTER_LICENSE_POLICY, STARTER_QUALITY_POLICY, STARTER_REQUIREMENT_TEMPLATE, STARTER_TASK_TEMPLATE, STARTER_VSCODE_MCP, STARTER_WORKFLOW_HANDOFF_TEMPLATE, SpecKitAdapter, TYPE_TO_SCHEMA_MAP, VALID_AGENT_TARGETS, VALID_ARCHITECTURE_GRANULARITIES, VALID_AUTONOMY_MODES, VALID_CHANGE_PROFILES, VALID_CI_PROVIDERS, aggregatePrKpis, aggregateReleaseKpis, appendRevisionHistoryRow, buildCycloneDxComponent, buildFeatureFileContent, buildGraphElements, calculateJaccardSimilarity, calculateMetrics, calculateRating, calculateShannonEntropy, checkGherkinInSync, checkoutTaskBranch, classifyBranch, collectAgentFiles, collectDashboardMetrics, collectHistoricalKpis, computeCanonicalSha256, computeSha256, createDefaultQualityPolicy, depositProductHandoffSidecar, detectActiveChangeForIntegration, detectAuthorIdentity, detectLanguage, detectProfileFromChange, detectPromptInjection, emitCiOutput, evaluateCompoundLicense, evaluateSingleDependency, extractCitations, extractCommitKpisFromRange, extractDirectDepNames, extractFeatureTags, extractFrontmatter, extractFunctions, extractFunctionsBraceLanguages, extractFunctionsPolyglot, extractFunctionsPython, extractFunctionsTypeScriptAst, extractGherkinBlock, extractGherkinFeatures, extractNormativeText, findChangeWorkspaceDir, findLicenseFile, formatCommitTrailers, formatPrKpiMarkdown, formatReleaseKpiMarkdown, generateBranchHierarchyPlan, generateCycloneDxSbom, generateDashboardReport, generateDuplicatesReportMarkdown, generateGovernanceReportMarkdown, generateLicenseReportMarkdown, generatePdacReportMarkdown, generateQualityReport, generateSastReportMarkdown, generateSecretsReportMarkdown, generateTestingCoverageReportMarkdown, generateThirdPartyNotices, generateTraceabilityReportMarkdown, getArchitectureTemplates, getCytoscapeScript, getGitDiffLines, getNextCorrelativeNumber, getSddAdapter, inferArtifactTypeFromId, inferMissingTrailers, initProject, injectKpisIntoPrBody, installGitHooks, integrateSddChange, isGitleaksInstalled, isPathProtectedFromPatch, isPlaceholderOrIgnored, isRequirementArtifact, isSemgrepInstalled, isToolAvailable, loadProductHandoffSidecar, locateTaskInActiveChanges, maskSecret, normalizeSpdxLicense, parseCommitTrailers, parseFrontmatter, parseFrontmatterId, parseGenericDoc, parseLicensePolicy, parseMarkdownFrontmatter, parseQualityPolicy, parseRequirementFile, parseSpecCatalogScope, parseTasksDoc, parseTasksFromContent, processPackageDir, readCodeCoverageSummary, readPackageJson, renderAntigravityAgentFile, renderClaudeAgentFile, renderCopilotAgentFile, renderCursorAgentFile, renderDashboardHtml, resolveAgentTargets, resolveBranchHierarchy, resolveCiEnvironment, resolveCytoscapePath, resolveFeatureFilePath, resolveLicenseFromFile, resolveSchemaForArtifact, resolveTargetFiles, runGitleaksCli, runSemgrepCli, scaffoldSddChange, scanAllProductHandoffs, scanAllTestArtifacts, scanContentForSecrets, scanFileForSast, scanInstalledLicenses, scanPnpmStore, scanSubdirectories, scanWithNativeFs, scanWithSyft, scanWithTrivy, slugify, syncPdacDigests, tokenizeTitle, updateCitationsInContent, validateAgainstSchema, validateArtifactSchema, verifyArtifactDuplicates, verifyArtifactsSchemas, verifyLicenses, verifyPdacGraph, verifyProgressiveFriction, verifyQualityGate, verifySast, verifySddIntegration, verifySecrets, verifyTasksGovernance, verifyTestingCoverage, verifyTraceability, walkDir, walkMdFiles, walkProjectFiles, walkSourceFiles, walkTaskFiles, writeCycloneDxSbom, writeReleaseKpiReport, writeThirdPartyNotices };
|
|
11387
11483
|
//# sourceMappingURL=index.js.map
|
|
11388
11484
|
//# sourceMappingURL=index.js.map
|