@nahisaho/musubix-lean 1.8.5
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/converters/EarsToLeanConverter.d.ts +61 -0
- package/dist/converters/EarsToLeanConverter.d.ts.map +1 -0
- package/dist/converters/EarsToLeanConverter.js +300 -0
- package/dist/converters/EarsToLeanConverter.js.map +1 -0
- package/dist/converters/TypeScriptSpecifier.d.ts +63 -0
- package/dist/converters/TypeScriptSpecifier.d.ts.map +1 -0
- package/dist/converters/TypeScriptSpecifier.js +307 -0
- package/dist/converters/TypeScriptSpecifier.js.map +1 -0
- package/dist/converters/index.d.ts +7 -0
- package/dist/converters/index.d.ts.map +1 -0
- package/dist/converters/index.js +7 -0
- package/dist/converters/index.js.map +1 -0
- package/dist/environment/LeanEnvironmentDetector.d.ts +57 -0
- package/dist/environment/LeanEnvironmentDetector.d.ts.map +1 -0
- package/dist/environment/LeanEnvironmentDetector.js +221 -0
- package/dist/environment/LeanEnvironmentDetector.js.map +1 -0
- package/dist/environment/LeanProjectInitializer.d.ts +49 -0
- package/dist/environment/LeanProjectInitializer.d.ts.map +1 -0
- package/dist/environment/LeanProjectInitializer.js +232 -0
- package/dist/environment/LeanProjectInitializer.js.map +1 -0
- package/dist/environment/index.d.ts +7 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +7 -0
- package/dist/environment/index.js.map +1 -0
- package/dist/errors.d.ts +141 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +254 -0
- package/dist/errors.js.map +1 -0
- package/dist/hybrid/HybridVerifier.d.ts +113 -0
- package/dist/hybrid/HybridVerifier.d.ts.map +1 -0
- package/dist/hybrid/HybridVerifier.js +247 -0
- package/dist/hybrid/HybridVerifier.js.map +1 -0
- package/dist/hybrid/index.d.ts +6 -0
- package/dist/hybrid/index.d.ts.map +1 -0
- package/dist/hybrid/index.js +6 -0
- package/dist/hybrid/index.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/LeanFileGenerator.d.ts +70 -0
- package/dist/infrastructure/LeanFileGenerator.d.ts.map +1 -0
- package/dist/infrastructure/LeanFileGenerator.js +253 -0
- package/dist/infrastructure/LeanFileGenerator.js.map +1 -0
- package/dist/infrastructure/LeanRunner.d.ts +93 -0
- package/dist/infrastructure/LeanRunner.d.ts.map +1 -0
- package/dist/infrastructure/LeanRunner.js +296 -0
- package/dist/infrastructure/LeanRunner.js.map +1 -0
- package/dist/infrastructure/index.d.ts +7 -0
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +7 -0
- package/dist/infrastructure/index.js.map +1 -0
- package/dist/integration/LeanIntegration.d.ts +138 -0
- package/dist/integration/LeanIntegration.d.ts.map +1 -0
- package/dist/integration/LeanIntegration.js +352 -0
- package/dist/integration/LeanIntegration.js.map +1 -0
- package/dist/proof/ProofGenerator.d.ts +53 -0
- package/dist/proof/ProofGenerator.d.ts.map +1 -0
- package/dist/proof/ProofGenerator.js +324 -0
- package/dist/proof/ProofGenerator.js.map +1 -0
- package/dist/proof/ReProverClient.d.ts +58 -0
- package/dist/proof/ReProverClient.d.ts.map +1 -0
- package/dist/proof/ReProverClient.js +260 -0
- package/dist/proof/ReProverClient.js.map +1 -0
- package/dist/proof/index.d.ts +7 -0
- package/dist/proof/index.d.ts.map +1 -0
- package/dist/proof/index.js +7 -0
- package/dist/proof/index.js.map +1 -0
- package/dist/reporting/VerificationReporter.d.ts +89 -0
- package/dist/reporting/VerificationReporter.d.ts.map +1 -0
- package/dist/reporting/VerificationReporter.js +296 -0
- package/dist/reporting/VerificationReporter.js.map +1 -0
- package/dist/reporting/index.d.ts +6 -0
- package/dist/reporting/index.d.ts.map +1 -0
- package/dist/reporting/index.js +6 -0
- package/dist/reporting/index.js.map +1 -0
- package/dist/traceability/TraceabilityManager.d.ts +104 -0
- package/dist/traceability/TraceabilityManager.d.ts.map +1 -0
- package/dist/traceability/TraceabilityManager.js +299 -0
- package/dist/traceability/TraceabilityManager.js.map +1 -0
- package/dist/traceability/index.d.ts +6 -0
- package/dist/traceability/index.d.ts.map +1 -0
- package/dist/traceability/index.js +6 -0
- package/dist/traceability/index.js.map +1 -0
- package/dist/types.d.ts +466 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Proof module exports
|
|
3
|
+
* @module @nahisaho/musubix-lean/proof
|
|
4
|
+
*/
|
|
5
|
+
export { ProofGenerator, generateProof, generateProofSketch } from './ProofGenerator.js';
|
|
6
|
+
export { ReProverClient } from './ReProverClient.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/proof/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Verification report generator
|
|
3
|
+
* @module @nahisaho/musubix-lean/reporting
|
|
4
|
+
* @traceability REQ-LEAN-FEEDBACK-001 to REQ-LEAN-FEEDBACK-003
|
|
5
|
+
*/
|
|
6
|
+
import type { VerificationReport, LeanTheorem, LeanProof, ReportFormat, ProofFeedback, ProofState } from '../types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Verification result status
|
|
9
|
+
*/
|
|
10
|
+
export type VerificationStatus = 'proved' | 'disproved' | 'timeout' | 'error' | 'incomplete';
|
|
11
|
+
/**
|
|
12
|
+
* Detailed verification result entry
|
|
13
|
+
*/
|
|
14
|
+
export interface VerificationResultEntry {
|
|
15
|
+
theorem: LeanTheorem;
|
|
16
|
+
status: VerificationStatus;
|
|
17
|
+
proof?: LeanProof;
|
|
18
|
+
error?: string;
|
|
19
|
+
duration: number;
|
|
20
|
+
feedback?: ProofFeedback;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Generates comprehensive verification reports
|
|
24
|
+
* @traceability REQ-LEAN-FEEDBACK-001
|
|
25
|
+
*/
|
|
26
|
+
export declare class VerificationReporter {
|
|
27
|
+
private results;
|
|
28
|
+
private startTime;
|
|
29
|
+
/**
|
|
30
|
+
* Add a verification result
|
|
31
|
+
*/
|
|
32
|
+
addResult(entry: VerificationResultEntry): void;
|
|
33
|
+
/**
|
|
34
|
+
* Generate verification report
|
|
35
|
+
* @traceability REQ-LEAN-FEEDBACK-002
|
|
36
|
+
*/
|
|
37
|
+
generate(): VerificationReport;
|
|
38
|
+
/**
|
|
39
|
+
* Export report in specified format
|
|
40
|
+
* @traceability REQ-LEAN-FEEDBACK-003
|
|
41
|
+
*/
|
|
42
|
+
export(format: ReportFormat): string;
|
|
43
|
+
/**
|
|
44
|
+
* Convert entry to VerificationResult
|
|
45
|
+
*/
|
|
46
|
+
private convertToVerificationResult;
|
|
47
|
+
/**
|
|
48
|
+
* Calculate statistics from results
|
|
49
|
+
*/
|
|
50
|
+
private calculateStatistics;
|
|
51
|
+
/**
|
|
52
|
+
* Generate unique report ID
|
|
53
|
+
*/
|
|
54
|
+
private generateReportId;
|
|
55
|
+
/**
|
|
56
|
+
* Get system information
|
|
57
|
+
*/
|
|
58
|
+
private getSystemInfo;
|
|
59
|
+
/**
|
|
60
|
+
* Convert report to Markdown format
|
|
61
|
+
*/
|
|
62
|
+
private toMarkdown;
|
|
63
|
+
/**
|
|
64
|
+
* Convert report to HTML format
|
|
65
|
+
*/
|
|
66
|
+
private toHtml;
|
|
67
|
+
/**
|
|
68
|
+
* Escape HTML special characters
|
|
69
|
+
*/
|
|
70
|
+
private escapeHtml;
|
|
71
|
+
/**
|
|
72
|
+
* Convert report to CSV format
|
|
73
|
+
*/
|
|
74
|
+
private toCsv;
|
|
75
|
+
/**
|
|
76
|
+
* Clear all results
|
|
77
|
+
*/
|
|
78
|
+
clear(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Get current result count
|
|
81
|
+
*/
|
|
82
|
+
getResultCount(): number;
|
|
83
|
+
/**
|
|
84
|
+
* Provide user-friendly feedback for proof failures
|
|
85
|
+
* @traceability REQ-LEAN-FEEDBACK-002
|
|
86
|
+
*/
|
|
87
|
+
static generateUserFeedback(state: ProofState, attemptedTactics: string[]): string[];
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=VerificationReporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerificationReporter.d.ts","sourceRoot":"","sources":["../../src/reporting/VerificationReporter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAElB,WAAW,EACX,SAAS,EACT,YAAY,EAEZ,aAAa,EACb,UAAU,EACX,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED;;;GAGG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,SAAS,CAAsB;IAEvC;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI;IAI/C;;;OAGG;IACH,QAAQ,IAAI,kBAAkB;IAiB9B;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM;IAiBpC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAYnC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAsB3B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAMxB;;OAEG;IACH,OAAO,CAAC,aAAa;IAQrB;;OAEG;IACH,OAAO,CAAC,UAAU;IAsElB;;OAEG;IACH,OAAO,CAAC,MAAM;IAqDd;;OAEG;IACH,OAAO,CAAC,UAAU;IASlB;;OAEG;IACH,OAAO,CAAC,KAAK;IAiBb;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;CAqCrF"}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Verification report generator
|
|
3
|
+
* @module @nahisaho/musubix-lean/reporting
|
|
4
|
+
* @traceability REQ-LEAN-FEEDBACK-001 to REQ-LEAN-FEEDBACK-003
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Generates comprehensive verification reports
|
|
8
|
+
* @traceability REQ-LEAN-FEEDBACK-001
|
|
9
|
+
*/
|
|
10
|
+
export class VerificationReporter {
|
|
11
|
+
results = [];
|
|
12
|
+
startTime = Date.now();
|
|
13
|
+
/**
|
|
14
|
+
* Add a verification result
|
|
15
|
+
*/
|
|
16
|
+
addResult(entry) {
|
|
17
|
+
this.results.push(entry);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Generate verification report
|
|
21
|
+
* @traceability REQ-LEAN-FEEDBACK-002
|
|
22
|
+
*/
|
|
23
|
+
generate() {
|
|
24
|
+
const totalDuration = Date.now() - this.startTime;
|
|
25
|
+
const statistics = this.calculateStatistics();
|
|
26
|
+
return {
|
|
27
|
+
id: this.generateReportId(),
|
|
28
|
+
timestamp: new Date().toISOString(),
|
|
29
|
+
results: this.results.map((entry) => this.convertToVerificationResult(entry)),
|
|
30
|
+
statistics,
|
|
31
|
+
executionDetails: {
|
|
32
|
+
totalDuration,
|
|
33
|
+
leanVersion: '', // Would be populated by LeanRunner
|
|
34
|
+
systemInfo: this.getSystemInfo(),
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Export report in specified format
|
|
40
|
+
* @traceability REQ-LEAN-FEEDBACK-003
|
|
41
|
+
*/
|
|
42
|
+
export(format) {
|
|
43
|
+
const report = this.generate();
|
|
44
|
+
switch (format) {
|
|
45
|
+
case 'json':
|
|
46
|
+
return JSON.stringify(report, null, 2);
|
|
47
|
+
case 'markdown':
|
|
48
|
+
return this.toMarkdown(report);
|
|
49
|
+
case 'html':
|
|
50
|
+
return this.toHtml(report);
|
|
51
|
+
case 'csv':
|
|
52
|
+
return this.toCsv(report);
|
|
53
|
+
default:
|
|
54
|
+
return JSON.stringify(report, null, 2);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Convert entry to VerificationResult
|
|
59
|
+
*/
|
|
60
|
+
convertToVerificationResult(entry) {
|
|
61
|
+
return {
|
|
62
|
+
theoremId: entry.theorem.id,
|
|
63
|
+
status: entry.status === 'proved' ? 'proved' : entry.status === 'error' ? 'error' : 'incomplete',
|
|
64
|
+
proof: entry.proof,
|
|
65
|
+
errors: entry.error ? [entry.error] : [],
|
|
66
|
+
warnings: [],
|
|
67
|
+
duration: entry.duration,
|
|
68
|
+
feedback: entry.feedback,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Calculate statistics from results
|
|
73
|
+
*/
|
|
74
|
+
calculateStatistics() {
|
|
75
|
+
const proved = this.results.filter((r) => r.status === 'proved').length;
|
|
76
|
+
const failed = this.results.filter((r) => r.status === 'disproved' || r.status === 'error').length;
|
|
77
|
+
const incomplete = this.results.filter((r) => r.status === 'incomplete' || r.status === 'timeout').length;
|
|
78
|
+
const totalTime = this.results.reduce((sum, r) => sum + r.duration, 0);
|
|
79
|
+
const avgTime = this.results.length > 0 ? totalTime / this.results.length : 0;
|
|
80
|
+
return {
|
|
81
|
+
totalTheorems: this.results.length,
|
|
82
|
+
provedCount: proved,
|
|
83
|
+
failedCount: failed,
|
|
84
|
+
incompleteCount: incomplete,
|
|
85
|
+
averageProofTime: avgTime,
|
|
86
|
+
totalTime,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Generate unique report ID
|
|
91
|
+
*/
|
|
92
|
+
generateReportId() {
|
|
93
|
+
const timestamp = Date.now().toString(36);
|
|
94
|
+
const random = Math.random().toString(36).substring(2, 8);
|
|
95
|
+
return `RPT-${timestamp}-${random}`;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get system information
|
|
99
|
+
*/
|
|
100
|
+
getSystemInfo() {
|
|
101
|
+
return {
|
|
102
|
+
platform: typeof process !== 'undefined' ? process.platform : 'unknown',
|
|
103
|
+
nodeVersion: typeof process !== 'undefined' ? process.version : 'unknown',
|
|
104
|
+
musubixVersion: '2.0.0-alpha.1',
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Convert report to Markdown format
|
|
109
|
+
*/
|
|
110
|
+
toMarkdown(report) {
|
|
111
|
+
const lines = [];
|
|
112
|
+
lines.push('# Verification Report');
|
|
113
|
+
lines.push('');
|
|
114
|
+
lines.push(`**Report ID**: ${report.id}`);
|
|
115
|
+
lines.push(`**Generated**: ${report.timestamp}`);
|
|
116
|
+
lines.push('');
|
|
117
|
+
// Statistics
|
|
118
|
+
lines.push('## Summary');
|
|
119
|
+
lines.push('');
|
|
120
|
+
lines.push('| Metric | Value |');
|
|
121
|
+
lines.push('|--------|-------|');
|
|
122
|
+
lines.push(`| Total Theorems | ${report.statistics.totalTheorems} |`);
|
|
123
|
+
lines.push(`| Proved | ${report.statistics.provedCount} |`);
|
|
124
|
+
lines.push(`| Failed | ${report.statistics.failedCount} |`);
|
|
125
|
+
lines.push(`| Incomplete | ${report.statistics.incompleteCount} |`);
|
|
126
|
+
lines.push(`| Avg Proof Time | ${report.statistics.averageProofTime.toFixed(2)}ms |`);
|
|
127
|
+
lines.push(`| Total Time | ${report.statistics.totalTime.toFixed(2)}ms |`);
|
|
128
|
+
lines.push('');
|
|
129
|
+
// Pass rate
|
|
130
|
+
const passRate = report.statistics.totalTheorems > 0
|
|
131
|
+
? ((report.statistics.provedCount / report.statistics.totalTheorems) * 100).toFixed(1)
|
|
132
|
+
: '0.0';
|
|
133
|
+
lines.push(`**Pass Rate**: ${passRate}%`);
|
|
134
|
+
lines.push('');
|
|
135
|
+
// Results
|
|
136
|
+
lines.push('## Results');
|
|
137
|
+
lines.push('');
|
|
138
|
+
for (const result of report.results) {
|
|
139
|
+
const statusIcon = result.status === 'proved' ? '✅' : result.status === 'error' ? '❌' : '⚠️';
|
|
140
|
+
lines.push(`### ${statusIcon} ${result.theoremId}`);
|
|
141
|
+
lines.push('');
|
|
142
|
+
lines.push(`- **Status**: ${result.status}`);
|
|
143
|
+
lines.push(`- **Duration**: ${result.duration}ms`);
|
|
144
|
+
if (result.proof) {
|
|
145
|
+
lines.push('');
|
|
146
|
+
lines.push('**Proof**:');
|
|
147
|
+
lines.push('```lean');
|
|
148
|
+
lines.push(result.proof.leanCode);
|
|
149
|
+
lines.push('```');
|
|
150
|
+
}
|
|
151
|
+
if (result.errors.length > 0) {
|
|
152
|
+
lines.push('');
|
|
153
|
+
lines.push('**Errors**:');
|
|
154
|
+
for (const error of result.errors) {
|
|
155
|
+
lines.push(`- ${error}`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (result.feedback) {
|
|
159
|
+
lines.push('');
|
|
160
|
+
lines.push('**Feedback**:');
|
|
161
|
+
for (const guidance of result.feedback.guidance) {
|
|
162
|
+
lines.push(`- ${guidance}`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
lines.push('');
|
|
166
|
+
}
|
|
167
|
+
return lines.join('\n');
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Convert report to HTML format
|
|
171
|
+
*/
|
|
172
|
+
toHtml(report) {
|
|
173
|
+
const passRate = report.statistics.totalTheorems > 0
|
|
174
|
+
? ((report.statistics.provedCount / report.statistics.totalTheorems) * 100).toFixed(1)
|
|
175
|
+
: '0.0';
|
|
176
|
+
return `<!DOCTYPE html>
|
|
177
|
+
<html lang="en">
|
|
178
|
+
<head>
|
|
179
|
+
<meta charset="UTF-8">
|
|
180
|
+
<title>Verification Report ${report.id}</title>
|
|
181
|
+
<style>
|
|
182
|
+
body { font-family: system-ui, sans-serif; max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
|
|
183
|
+
h1, h2, h3 { color: #1a1a1a; }
|
|
184
|
+
.summary { background: #f5f5f5; padding: 1rem; border-radius: 8px; margin: 1rem 0; }
|
|
185
|
+
.stat { display: inline-block; margin: 0.5rem 1rem; }
|
|
186
|
+
.stat-value { font-size: 1.5rem; font-weight: bold; }
|
|
187
|
+
.stat-label { color: #666; font-size: 0.9rem; }
|
|
188
|
+
.result { border: 1px solid #ddd; border-radius: 8px; padding: 1rem; margin: 1rem 0; }
|
|
189
|
+
.result.proved { border-color: #22c55e; }
|
|
190
|
+
.result.error { border-color: #ef4444; }
|
|
191
|
+
.result.incomplete { border-color: #f59e0b; }
|
|
192
|
+
pre { background: #1a1a1a; color: #e5e5e5; padding: 1rem; border-radius: 4px; overflow-x: auto; }
|
|
193
|
+
.pass-rate { font-size: 2rem; font-weight: bold; color: ${parseFloat(passRate) >= 80 ? '#22c55e' : parseFloat(passRate) >= 50 ? '#f59e0b' : '#ef4444'}; }
|
|
194
|
+
</style>
|
|
195
|
+
</head>
|
|
196
|
+
<body>
|
|
197
|
+
<h1>Verification Report</h1>
|
|
198
|
+
<p><strong>ID:</strong> ${report.id}</p>
|
|
199
|
+
<p><strong>Generated:</strong> ${report.timestamp}</p>
|
|
200
|
+
|
|
201
|
+
<div class="summary">
|
|
202
|
+
<h2>Summary</h2>
|
|
203
|
+
<div class="stat"><div class="stat-value">${report.statistics.totalTheorems}</div><div class="stat-label">Total</div></div>
|
|
204
|
+
<div class="stat"><div class="stat-value">${report.statistics.provedCount}</div><div class="stat-label">Proved</div></div>
|
|
205
|
+
<div class="stat"><div class="stat-value">${report.statistics.failedCount}</div><div class="stat-label">Failed</div></div>
|
|
206
|
+
<div class="stat"><div class="stat-value">${report.statistics.incompleteCount}</div><div class="stat-label">Incomplete</div></div>
|
|
207
|
+
<div class="stat"><div class="pass-rate">${passRate}%</div><div class="stat-label">Pass Rate</div></div>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<h2>Results</h2>
|
|
211
|
+
${report.results.map((r) => `
|
|
212
|
+
<div class="result ${r.status}">
|
|
213
|
+
<h3>${r.status === 'proved' ? '✅' : r.status === 'error' ? '❌' : '⚠️'} ${r.theoremId}</h3>
|
|
214
|
+
<p><strong>Status:</strong> ${r.status} | <strong>Duration:</strong> ${r.duration}ms</p>
|
|
215
|
+
${r.proof ? `<pre>${this.escapeHtml(r.proof.leanCode)}</pre>` : ''}
|
|
216
|
+
${r.errors.length > 0 ? `<p><strong>Errors:</strong> ${r.errors.join(', ')}</p>` : ''}
|
|
217
|
+
${r.feedback ? `<p><strong>Feedback:</strong> ${r.feedback.guidance.join('; ')}</p>` : ''}
|
|
218
|
+
</div>
|
|
219
|
+
`).join('\n')}
|
|
220
|
+
</body>
|
|
221
|
+
</html>`;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Escape HTML special characters
|
|
225
|
+
*/
|
|
226
|
+
escapeHtml(text) {
|
|
227
|
+
return text
|
|
228
|
+
.replace(/&/g, '&')
|
|
229
|
+
.replace(/</g, '<')
|
|
230
|
+
.replace(/>/g, '>')
|
|
231
|
+
.replace(/"/g, '"')
|
|
232
|
+
.replace(/'/g, ''');
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Convert report to CSV format
|
|
236
|
+
*/
|
|
237
|
+
toCsv(report) {
|
|
238
|
+
const lines = [];
|
|
239
|
+
// Header
|
|
240
|
+
lines.push('Theorem ID,Status,Duration (ms),Errors');
|
|
241
|
+
// Data rows
|
|
242
|
+
for (const result of report.results) {
|
|
243
|
+
const errors = result.errors.join('; ').replace(/"/g, '""');
|
|
244
|
+
lines.push(`"${result.theoremId}","${result.status}",${result.duration},"${errors}"`);
|
|
245
|
+
}
|
|
246
|
+
return lines.join('\n');
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Clear all results
|
|
250
|
+
*/
|
|
251
|
+
clear() {
|
|
252
|
+
this.results = [];
|
|
253
|
+
this.startTime = Date.now();
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Get current result count
|
|
257
|
+
*/
|
|
258
|
+
getResultCount() {
|
|
259
|
+
return this.results.length;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Provide user-friendly feedback for proof failures
|
|
263
|
+
* @traceability REQ-LEAN-FEEDBACK-002
|
|
264
|
+
*/
|
|
265
|
+
static generateUserFeedback(state, attemptedTactics) {
|
|
266
|
+
const feedback = [];
|
|
267
|
+
if (state.goals.length === 0) {
|
|
268
|
+
feedback.push('All goals have been proved!');
|
|
269
|
+
return feedback;
|
|
270
|
+
}
|
|
271
|
+
const currentGoal = state.goals[state.currentGoal];
|
|
272
|
+
if (currentGoal) {
|
|
273
|
+
feedback.push(`Current goal: ${currentGoal.type}`);
|
|
274
|
+
feedback.push('');
|
|
275
|
+
if (attemptedTactics.length > 0) {
|
|
276
|
+
feedback.push(`Attempted tactics: ${attemptedTactics.join(', ')}`);
|
|
277
|
+
}
|
|
278
|
+
// Goal-specific suggestions
|
|
279
|
+
if (currentGoal.leanCode.includes('=')) {
|
|
280
|
+
feedback.push('Hint: This is an equality. Try "rfl" for reflexivity or "simp" to simplify.');
|
|
281
|
+
}
|
|
282
|
+
if (currentGoal.leanCode.includes('True')) {
|
|
283
|
+
feedback.push('Hint: Goal is "True". Use "trivial" tactic.');
|
|
284
|
+
}
|
|
285
|
+
if (state.hypotheses.length > 0) {
|
|
286
|
+
feedback.push('');
|
|
287
|
+
feedback.push('Available hypotheses:');
|
|
288
|
+
for (const hyp of state.hypotheses) {
|
|
289
|
+
feedback.push(` ${hyp.name} : ${hyp.type}`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return feedback;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=VerificationReporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerificationReporter.js","sourceRoot":"","sources":["../../src/reporting/VerificationReporter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8BH;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IACvB,OAAO,GAA8B,EAAE,CAAC;IACxC,SAAS,GAAW,IAAI,CAAC,GAAG,EAAE,CAAC;IAEvC;;OAEG;IACH,SAAS,CAAC,KAA8B;QACtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,QAAQ;QACN,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QAClD,MAAM,UAAU,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAE9C,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,gBAAgB,EAAE;YAC3B,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;YAC7E,UAAU;YACV,g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IAAI,CAAC,uBAAuB,CAAC,CAAC;gBACvC,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;oBACnC,QAAQ,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC/C,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reporting/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,oBAAoB,EACpB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reporting/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,oBAAoB,GAGrB,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Traceability manager for requirement-to-proof mapping
|
|
3
|
+
* @module @nahisaho/musubix-lean/traceability
|
|
4
|
+
* @traceability REQ-LEAN-TRACE-001 to REQ-LEAN-TRACE-003
|
|
5
|
+
*/
|
|
6
|
+
import type { TraceabilityLink, TraceabilityArtifact, LeanTheorem, LeanProof, VerificationResult } from '../types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Traceability link type
|
|
9
|
+
*/
|
|
10
|
+
export type LinkType = 'requirement_to_theorem' | 'theorem_to_proof' | 'theorem_to_code' | 'requirement_to_code' | 'proof_to_verification';
|
|
11
|
+
/**
|
|
12
|
+
* Traceability coverage metrics
|
|
13
|
+
*/
|
|
14
|
+
export interface TraceabilityCoverage {
|
|
15
|
+
totalRequirements: number;
|
|
16
|
+
coveredRequirements: number;
|
|
17
|
+
coveragePercentage: number;
|
|
18
|
+
untraced: string[];
|
|
19
|
+
partiallyTraced: string[];
|
|
20
|
+
fullyTraced: string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Manages requirement-to-proof traceability
|
|
24
|
+
* @traceability REQ-LEAN-TRACE-001
|
|
25
|
+
*/
|
|
26
|
+
export declare class TraceabilityManager {
|
|
27
|
+
private links;
|
|
28
|
+
private artifacts;
|
|
29
|
+
private linkCounter;
|
|
30
|
+
/**
|
|
31
|
+
* Register an artifact (requirement, theorem, proof, code)
|
|
32
|
+
*/
|
|
33
|
+
registerArtifact(artifact: Omit<TraceabilityArtifact, 'id'> & {
|
|
34
|
+
artifactId?: string;
|
|
35
|
+
}): TraceabilityArtifact;
|
|
36
|
+
/**
|
|
37
|
+
* Create a traceability link between artifacts
|
|
38
|
+
* @traceability REQ-LEAN-TRACE-002
|
|
39
|
+
*/
|
|
40
|
+
createLink(sourceId: string, targetId: string, type: LinkType, confidence?: number, metadata?: Record<string, unknown>): TraceabilityLink;
|
|
41
|
+
/**
|
|
42
|
+
* Link a theorem to its requirement
|
|
43
|
+
*/
|
|
44
|
+
linkTheoremToRequirement(theorem: LeanTheorem): TraceabilityLink;
|
|
45
|
+
/**
|
|
46
|
+
* Link a proof to its theorem
|
|
47
|
+
*/
|
|
48
|
+
linkProofToTheorem(proof: LeanProof, theorem: LeanTheorem): TraceabilityLink;
|
|
49
|
+
/**
|
|
50
|
+
* Record verification result in traceability
|
|
51
|
+
*/
|
|
52
|
+
recordVerification(result: VerificationResult): TraceabilityLink | null;
|
|
53
|
+
/**
|
|
54
|
+
* Get all links for a source artifact
|
|
55
|
+
*/
|
|
56
|
+
getLinksFromSource(sourceId: string): TraceabilityLink[];
|
|
57
|
+
/**
|
|
58
|
+
* Get all links targeting an artifact
|
|
59
|
+
*/
|
|
60
|
+
getLinksToTarget(targetId: string): TraceabilityLink[];
|
|
61
|
+
/**
|
|
62
|
+
* Get all links of a specific type
|
|
63
|
+
*/
|
|
64
|
+
getLinksByType(type: LinkType): TraceabilityLink[];
|
|
65
|
+
/**
|
|
66
|
+
* Calculate traceability coverage
|
|
67
|
+
* @traceability REQ-LEAN-TRACE-003
|
|
68
|
+
*/
|
|
69
|
+
calculateCoverage(requirementIds: string[]): TraceabilityCoverage;
|
|
70
|
+
/**
|
|
71
|
+
* Get full traceability chain for a requirement
|
|
72
|
+
*/
|
|
73
|
+
getTraceChain(requirementId: string): TraceabilityArtifact[];
|
|
74
|
+
/**
|
|
75
|
+
* Validate traceability integrity
|
|
76
|
+
*/
|
|
77
|
+
validateIntegrity(): {
|
|
78
|
+
valid: boolean;
|
|
79
|
+
errors: string[];
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Export traceability matrix
|
|
83
|
+
*/
|
|
84
|
+
exportMatrix(): Record<string, Record<string, string>>;
|
|
85
|
+
/**
|
|
86
|
+
* Export to Markdown format
|
|
87
|
+
*/
|
|
88
|
+
exportMarkdown(): string;
|
|
89
|
+
/**
|
|
90
|
+
* Clear all data
|
|
91
|
+
*/
|
|
92
|
+
clear(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Get statistics
|
|
95
|
+
*/
|
|
96
|
+
getStats(): {
|
|
97
|
+
artifacts: number;
|
|
98
|
+
links: number;
|
|
99
|
+
byType: Record<string, number>;
|
|
100
|
+
};
|
|
101
|
+
private generateLinkId;
|
|
102
|
+
private generateArtifactId;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=TraceabilityManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraceabilityManager.d.ts","sourceRoot":"","sources":["../../src/traceability/TraceabilityManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,WAAW,EACX,SAAS,EACT,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,wBAAwB,GACxB,kBAAkB,GA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