@nahisaho/musubix-formal-verify 1.7.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.
Files changed (78) hide show
  1. package/README.md +62 -0
  2. package/dist/converters/EarsToSmtConverter.d.ts +102 -0
  3. package/dist/converters/EarsToSmtConverter.d.ts.map +1 -0
  4. package/dist/converters/EarsToSmtConverter.js +368 -0
  5. package/dist/converters/EarsToSmtConverter.js.map +1 -0
  6. package/dist/converters/index.d.ts +6 -0
  7. package/dist/converters/index.d.ts.map +1 -0
  8. package/dist/converters/index.js +5 -0
  9. package/dist/converters/index.js.map +1 -0
  10. package/dist/converters/types.d.ts +103 -0
  11. package/dist/converters/types.d.ts.map +1 -0
  12. package/dist/converters/types.js +7 -0
  13. package/dist/converters/types.js.map +1 -0
  14. package/dist/index.d.ts +22 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +23 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/tools/formal-verify-tools.d.ts +60 -0
  19. package/dist/tools/formal-verify-tools.d.ts.map +1 -0
  20. package/dist/tools/formal-verify-tools.js +371 -0
  21. package/dist/tools/formal-verify-tools.js.map +1 -0
  22. package/dist/tools/index.d.ts +5 -0
  23. package/dist/tools/index.d.ts.map +1 -0
  24. package/dist/tools/index.js +5 -0
  25. package/dist/tools/index.js.map +1 -0
  26. package/dist/traceability/ImpactAnalyzer.d.ts +103 -0
  27. package/dist/traceability/ImpactAnalyzer.d.ts.map +1 -0
  28. package/dist/traceability/ImpactAnalyzer.js +281 -0
  29. package/dist/traceability/ImpactAnalyzer.js.map +1 -0
  30. package/dist/traceability/TraceabilityDB.d.ts +123 -0
  31. package/dist/traceability/TraceabilityDB.d.ts.map +1 -0
  32. package/dist/traceability/TraceabilityDB.js +379 -0
  33. package/dist/traceability/TraceabilityDB.js.map +1 -0
  34. package/dist/traceability/index.d.ts +8 -0
  35. package/dist/traceability/index.d.ts.map +1 -0
  36. package/dist/traceability/index.js +6 -0
  37. package/dist/traceability/index.js.map +1 -0
  38. package/dist/traceability/types.d.ts +156 -0
  39. package/dist/traceability/types.d.ts.map +1 -0
  40. package/dist/traceability/types.js +7 -0
  41. package/dist/traceability/types.js.map +1 -0
  42. package/dist/verifiers/PostconditionVerifier.d.ts +105 -0
  43. package/dist/verifiers/PostconditionVerifier.d.ts.map +1 -0
  44. package/dist/verifiers/PostconditionVerifier.js +326 -0
  45. package/dist/verifiers/PostconditionVerifier.js.map +1 -0
  46. package/dist/verifiers/PreconditionVerifier.d.ts +87 -0
  47. package/dist/verifiers/PreconditionVerifier.d.ts.map +1 -0
  48. package/dist/verifiers/PreconditionVerifier.js +286 -0
  49. package/dist/verifiers/PreconditionVerifier.js.map +1 -0
  50. package/dist/verifiers/index.d.ts +7 -0
  51. package/dist/verifiers/index.d.ts.map +1 -0
  52. package/dist/verifiers/index.js +6 -0
  53. package/dist/verifiers/index.js.map +1 -0
  54. package/dist/verifiers/types.d.ts +109 -0
  55. package/dist/verifiers/types.d.ts.map +1 -0
  56. package/dist/verifiers/types.js +7 -0
  57. package/dist/verifiers/types.js.map +1 -0
  58. package/dist/z3/Z3Adapter.d.ts +92 -0
  59. package/dist/z3/Z3Adapter.d.ts.map +1 -0
  60. package/dist/z3/Z3Adapter.js +189 -0
  61. package/dist/z3/Z3Adapter.js.map +1 -0
  62. package/dist/z3/Z3ProcessFallback.d.ts +67 -0
  63. package/dist/z3/Z3ProcessFallback.d.ts.map +1 -0
  64. package/dist/z3/Z3ProcessFallback.js +287 -0
  65. package/dist/z3/Z3ProcessFallback.js.map +1 -0
  66. package/dist/z3/Z3WasmClient.d.ts +55 -0
  67. package/dist/z3/Z3WasmClient.d.ts.map +1 -0
  68. package/dist/z3/Z3WasmClient.js +172 -0
  69. package/dist/z3/Z3WasmClient.js.map +1 -0
  70. package/dist/z3/index.d.ts +9 -0
  71. package/dist/z3/index.d.ts.map +1 -0
  72. package/dist/z3/index.js +7 -0
  73. package/dist/z3/index.js.map +1 -0
  74. package/dist/z3/types.d.ts +82 -0
  75. package/dist/z3/types.d.ts.map +1 -0
  76. package/dist/z3/types.js +7 -0
  77. package/dist/z3/types.js.map +1 -0
  78. package/package.json +79 -0
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Converter Types
3
+ *
4
+ * EARS→SMT変換の型定義
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/converters/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @nahisaho/musubix-formal-verify
3
+ *
4
+ * MUSUBIX v1.7.5 Formal Verification Edition
5
+ * 形式検証ツールパッケージ
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ export { Z3Adapter } from './z3/Z3Adapter.js';
10
+ export { Z3WasmClient } from './z3/Z3WasmClient.js';
11
+ export { Z3ProcessFallback } from './z3/Z3ProcessFallback.js';
12
+ export type { Z3Client, Z3Result, Z3Options } from './z3/types.js';
13
+ export { PreconditionVerifier } from './verifiers/PreconditionVerifier.js';
14
+ export { PostconditionVerifier } from './verifiers/PostconditionVerifier.js';
15
+ export type { VerificationResult, VerificationOptions, Condition, VariableDeclaration } from './verifiers/types.js';
16
+ export { EarsToSmtConverter } from './converters/EarsToSmtConverter.js';
17
+ export type { EarsPattern, SmtFormula, ConversionResult } from './converters/types.js';
18
+ export { TraceabilityDB } from './traceability/TraceabilityDB.js';
19
+ export { ImpactAnalyzer } from './traceability/ImpactAnalyzer.js';
20
+ export type { TraceLink, TraceLinkType, ImpactResult, TraceNode } from './traceability/types.js';
21
+ export { verifyPreconditionTool, verifyPostconditionTool, earsToSmtTool, traceAddLinkTool, traceQueryTool, traceImpactTool, formalVerifyTools, getFormalVerifyTools, handleFormalVerifyTool, } from './tools/index.js';
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,SAAS,EACT,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,YAAY,EACV,WAAW,EACX,UAAU,EACV,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,YAAY,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,SAAS,EACV,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @nahisaho/musubix-formal-verify
3
+ *
4
+ * MUSUBIX v1.7.5 Formal Verification Edition
5
+ * 形式検証ツールパッケージ
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ // Z3 Integration
10
+ export { Z3Adapter } from './z3/Z3Adapter.js';
11
+ export { Z3WasmClient } from './z3/Z3WasmClient.js';
12
+ export { Z3ProcessFallback } from './z3/Z3ProcessFallback.js';
13
+ // Verifiers
14
+ export { PreconditionVerifier } from './verifiers/PreconditionVerifier.js';
15
+ export { PostconditionVerifier } from './verifiers/PostconditionVerifier.js';
16
+ // Converters
17
+ export { EarsToSmtConverter } from './converters/EarsToSmtConverter.js';
18
+ // Traceability
19
+ export { TraceabilityDB } from './traceability/TraceabilityDB.js';
20
+ export { ImpactAnalyzer } from './traceability/ImpactAnalyzer.js';
21
+ // MCP Tools
22
+ export { verifyPreconditionTool, verifyPostconditionTool, earsToSmtTool, traceAddLinkTool, traceQueryTool, traceImpactTool, formalVerifyTools, getFormalVerifyTools, handleFormalVerifyTool, } from './tools/index.js';
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,iBAAiB;AACjB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D,YAAY;AACZ,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAQ7E,aAAa;AACb,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAOxE,eAAe;AACf,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAQlE,YAAY;AACZ,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Formal Verify MCP Tools
3
+ *
4
+ * Tools for formal verification, EARS-to-SMT conversion, and traceability.
5
+ */
6
+ import type { Tool } from '@modelcontextprotocol/sdk/types.js';
7
+ /**
8
+ * Tool: verify_precondition
9
+ * Verifies preconditions using Z3 SMT solver
10
+ */
11
+ export declare const verifyPreconditionTool: Tool;
12
+ /**
13
+ * Tool: verify_postcondition
14
+ * Verifies Hoare triples {P} C {Q}
15
+ */
16
+ export declare const verifyPostconditionTool: Tool;
17
+ /**
18
+ * Tool: ears_to_smt
19
+ * Converts EARS requirements to SMT-LIB2 formulas
20
+ */
21
+ export declare const earsToSmtTool: Tool;
22
+ /**
23
+ * Tool: trace_add_link
24
+ * Adds a traceability link between artifacts
25
+ */
26
+ export declare const traceAddLinkTool: Tool;
27
+ /**
28
+ * Tool: trace_query
29
+ * Queries the traceability database
30
+ */
31
+ export declare const traceQueryTool: Tool;
32
+ /**
33
+ * Tool: trace_impact
34
+ * Analyzes change impact
35
+ */
36
+ export declare const traceImpactTool: Tool;
37
+ /**
38
+ * All formal verify tools
39
+ */
40
+ export declare const formalVerifyTools: Tool[];
41
+ /**
42
+ * Get all formal verify tools
43
+ */
44
+ export declare function getFormalVerifyTools(): Tool[];
45
+ /**
46
+ * Tool result type
47
+ */
48
+ interface ToolResult {
49
+ content: Array<{
50
+ type: string;
51
+ text: string;
52
+ }>;
53
+ isError?: boolean;
54
+ }
55
+ /**
56
+ * Handle formal verify tool calls
57
+ */
58
+ export declare function handleFormalVerifyTool(toolName: string, args: Record<string, unknown>): Promise<ToolResult>;
59
+ export {};
60
+ //# sourceMappingURL=formal-verify-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formal-verify-tools.d.ts","sourceRoot":"","sources":["../../src/tools/formal-verify-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,IA6BpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,IAqCrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,IAqB3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,IA0B9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,IA2B5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,IAsB7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,IAAI,EAOnC,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,EAAE,CAE7C;AAED;;GAEG;AACH,UAAU,UAAU;IAClB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,UAAU,CAAC,CA4BrB"}
@@ -0,0 +1,371 @@
1
+ /**
2
+ * Formal Verify MCP Tools
3
+ *
4
+ * Tools for formal verification, EARS-to-SMT conversion, and traceability.
5
+ */
6
+ /**
7
+ * Tool: verify_precondition
8
+ * Verifies preconditions using Z3 SMT solver
9
+ */
10
+ export const verifyPreconditionTool = {
11
+ name: 'verify_precondition',
12
+ description: 'Verify a precondition expression using Z3 SMT solver. Checks if the precondition is satisfiable or unsatisfiable.',
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {
16
+ expression: {
17
+ type: 'string',
18
+ description: 'The precondition expression to verify (e.g., "x > 0 && y >= 0")',
19
+ },
20
+ variables: {
21
+ type: 'array',
22
+ items: {
23
+ type: 'object',
24
+ properties: {
25
+ name: { type: 'string', description: 'Variable name' },
26
+ type: { type: 'string', enum: ['Int', 'Real', 'Bool'], description: 'Variable type' },
27
+ },
28
+ required: ['name', 'type'],
29
+ },
30
+ description: 'Variables used in the expression',
31
+ },
32
+ id: {
33
+ type: 'string',
34
+ description: 'Optional identifier for the precondition',
35
+ },
36
+ },
37
+ required: ['expression'],
38
+ },
39
+ };
40
+ /**
41
+ * Tool: verify_postcondition
42
+ * Verifies Hoare triples {P} C {Q}
43
+ */
44
+ export const verifyPostconditionTool = {
45
+ name: 'verify_postcondition',
46
+ description: 'Verify a Hoare triple {P} C {Q} using Z3 SMT solver. Checks if the postcondition Q holds after executing C when precondition P is satisfied.',
47
+ inputSchema: {
48
+ type: 'object',
49
+ properties: {
50
+ precondition: {
51
+ type: 'string',
52
+ description: 'The precondition P (e.g., "x >= 0")',
53
+ },
54
+ transition: {
55
+ type: 'string',
56
+ description: 'The transition/command C as a logical formula (e.g., "x_next == x + 1")',
57
+ },
58
+ postcondition: {
59
+ type: 'string',
60
+ description: 'The postcondition Q to verify (e.g., "x_next > 0")',
61
+ },
62
+ variables: {
63
+ type: 'array',
64
+ items: {
65
+ type: 'object',
66
+ properties: {
67
+ name: { type: 'string', description: 'Variable name' },
68
+ type: { type: 'string', enum: ['Int', 'Real', 'Bool'], description: 'Variable type' },
69
+ },
70
+ required: ['name', 'type'],
71
+ },
72
+ description: 'Variables used in the expressions',
73
+ },
74
+ id: {
75
+ type: 'string',
76
+ description: 'Optional identifier for the verification',
77
+ },
78
+ },
79
+ required: ['precondition', 'transition', 'postcondition'],
80
+ },
81
+ };
82
+ /**
83
+ * Tool: ears_to_smt
84
+ * Converts EARS requirements to SMT-LIB2 formulas
85
+ */
86
+ export const earsToSmtTool = {
87
+ name: 'ears_to_smt',
88
+ description: 'Convert an EARS (Easy Approach to Requirements Syntax) requirement to SMT-LIB2 formula for formal verification.',
89
+ inputSchema: {
90
+ type: 'object',
91
+ properties: {
92
+ requirement: {
93
+ type: 'string',
94
+ description: 'The EARS requirement text (e.g., "THE system SHALL validate all user inputs")',
95
+ },
96
+ options: {
97
+ type: 'object',
98
+ properties: {
99
+ strict: { type: 'boolean', description: 'Enable strict parsing mode' },
100
+ inferTypes: { type: 'boolean', description: 'Infer variable types automatically' },
101
+ },
102
+ description: 'Conversion options',
103
+ },
104
+ },
105
+ required: ['requirement'],
106
+ },
107
+ };
108
+ /**
109
+ * Tool: trace_add_link
110
+ * Adds a traceability link between artifacts
111
+ */
112
+ export const traceAddLinkTool = {
113
+ name: 'trace_add_link',
114
+ description: 'Add a traceability link between two artifacts (requirements, designs, code, tests).',
115
+ inputSchema: {
116
+ type: 'object',
117
+ properties: {
118
+ source: {
119
+ type: 'string',
120
+ description: 'Source artifact ID (e.g., "DES-001")',
121
+ },
122
+ target: {
123
+ type: 'string',
124
+ description: 'Target artifact ID (e.g., "REQ-001")',
125
+ },
126
+ linkType: {
127
+ type: 'string',
128
+ enum: ['satisfies', 'implements', 'verifies', 'derives', 'refines', 'depends'],
129
+ description: 'Type of traceability link',
130
+ },
131
+ description: {
132
+ type: 'string',
133
+ description: 'Optional description of the link',
134
+ },
135
+ },
136
+ required: ['source', 'target', 'linkType'],
137
+ },
138
+ };
139
+ /**
140
+ * Tool: trace_query
141
+ * Queries the traceability database
142
+ */
143
+ export const traceQueryTool = {
144
+ name: 'trace_query',
145
+ description: 'Query the traceability database to find artifacts and their relationships.',
146
+ inputSchema: {
147
+ type: 'object',
148
+ properties: {
149
+ nodeType: {
150
+ type: 'string',
151
+ enum: ['requirement', 'design', 'code', 'test', 'task'],
152
+ description: 'Filter by artifact type',
153
+ },
154
+ linkedTo: {
155
+ type: 'string',
156
+ description: 'Find artifacts linked to this ID',
157
+ },
158
+ titlePattern: {
159
+ type: 'string',
160
+ description: 'Filter by title pattern (SQL LIKE syntax)',
161
+ },
162
+ linkType: {
163
+ type: 'string',
164
+ enum: ['satisfies', 'implements', 'verifies', 'derives', 'refines', 'depends'],
165
+ description: 'Filter by link type',
166
+ },
167
+ },
168
+ required: [],
169
+ },
170
+ };
171
+ /**
172
+ * Tool: trace_impact
173
+ * Analyzes change impact
174
+ */
175
+ export const traceImpactTool = {
176
+ name: 'trace_impact',
177
+ description: 'Analyze the impact of changing an artifact. Returns all affected artifacts with impact scores.',
178
+ inputSchema: {
179
+ type: 'object',
180
+ properties: {
181
+ nodeId: {
182
+ type: 'string',
183
+ description: 'ID of the artifact to analyze (e.g., "REQ-001")',
184
+ },
185
+ maxDepth: {
186
+ type: 'number',
187
+ description: 'Maximum depth to traverse (default: 5)',
188
+ },
189
+ direction: {
190
+ type: 'string',
191
+ enum: ['forward', 'reverse', 'both'],
192
+ description: 'Direction of impact analysis',
193
+ },
194
+ },
195
+ required: ['nodeId'],
196
+ },
197
+ };
198
+ /**
199
+ * All formal verify tools
200
+ */
201
+ export const formalVerifyTools = [
202
+ verifyPreconditionTool,
203
+ verifyPostconditionTool,
204
+ earsToSmtTool,
205
+ traceAddLinkTool,
206
+ traceQueryTool,
207
+ traceImpactTool,
208
+ ];
209
+ /**
210
+ * Get all formal verify tools
211
+ */
212
+ export function getFormalVerifyTools() {
213
+ return formalVerifyTools;
214
+ }
215
+ /**
216
+ * Handle formal verify tool calls
217
+ */
218
+ export async function handleFormalVerifyTool(toolName, args) {
219
+ try {
220
+ switch (toolName) {
221
+ case 'verify_precondition':
222
+ return await handleVerifyPrecondition(args);
223
+ case 'verify_postcondition':
224
+ return await handleVerifyPostcondition(args);
225
+ case 'ears_to_smt':
226
+ return await handleEarsToSmt(args);
227
+ case 'trace_add_link':
228
+ return await handleTraceAddLink(args);
229
+ case 'trace_query':
230
+ return await handleTraceQuery(args);
231
+ case 'trace_impact':
232
+ return await handleTraceImpact(args);
233
+ default:
234
+ return {
235
+ content: [{ type: 'text', text: `Unknown tool: ${toolName}` }],
236
+ isError: true,
237
+ };
238
+ }
239
+ }
240
+ catch (error) {
241
+ const message = error instanceof Error ? error.message : String(error);
242
+ return {
243
+ content: [{ type: 'text', text: `Error: ${message}` }],
244
+ isError: true,
245
+ };
246
+ }
247
+ }
248
+ // Handler implementations (placeholder - will be connected to actual implementations)
249
+ async function handleVerifyPrecondition(args) {
250
+ const expression = args.expression;
251
+ const variables = args.variables;
252
+ const id = args.id;
253
+ // Placeholder implementation
254
+ const result = {
255
+ id: id || 'PRE-' + Date.now(),
256
+ expression,
257
+ variables: variables || [],
258
+ status: 'placeholder',
259
+ message: 'Z3 integration pending - will verify precondition when connected',
260
+ };
261
+ return {
262
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
263
+ };
264
+ }
265
+ async function handleVerifyPostcondition(args) {
266
+ const precondition = args.precondition;
267
+ const transition = args.transition;
268
+ const postcondition = args.postcondition;
269
+ const variables = args.variables;
270
+ const id = args.id;
271
+ // Placeholder implementation
272
+ const result = {
273
+ id: id || 'POST-' + Date.now(),
274
+ hoareTriple: { P: precondition, C: transition, Q: postcondition },
275
+ variables: variables || [],
276
+ status: 'placeholder',
277
+ message: 'Z3 integration pending - will verify Hoare triple when connected',
278
+ };
279
+ return {
280
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
281
+ };
282
+ }
283
+ async function handleEarsToSmt(args) {
284
+ const requirement = args.requirement;
285
+ const options = args.options;
286
+ // Placeholder implementation - detect EARS pattern
287
+ let pattern = 'unknown';
288
+ if (requirement.includes('SHALL NOT')) {
289
+ pattern = 'unwanted';
290
+ }
291
+ else if (requirement.startsWith('WHEN') || requirement.includes('WHEN ')) {
292
+ pattern = 'event-driven';
293
+ }
294
+ else if (requirement.startsWith('WHILE') || requirement.includes('WHILE ')) {
295
+ pattern = 'state-driven';
296
+ }
297
+ else if (requirement.startsWith('IF') || requirement.includes('IF ')) {
298
+ pattern = 'optional';
299
+ }
300
+ else if (requirement.includes('SHALL')) {
301
+ pattern = 'ubiquitous';
302
+ }
303
+ const result = {
304
+ requirement,
305
+ pattern,
306
+ options: options || {},
307
+ status: 'placeholder',
308
+ smtLib2: '; SMT-LIB2 conversion pending',
309
+ message: 'Full EARS-to-SMT conversion will be available when connected',
310
+ };
311
+ return {
312
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
313
+ };
314
+ }
315
+ async function handleTraceAddLink(args) {
316
+ const source = args.source;
317
+ const target = args.target;
318
+ const linkType = args.linkType;
319
+ const description = args.description;
320
+ // Placeholder implementation
321
+ const result = {
322
+ link: {
323
+ id: `LINK-${Date.now()}`,
324
+ source,
325
+ target,
326
+ type: linkType,
327
+ description,
328
+ createdAt: new Date().toISOString(),
329
+ },
330
+ status: 'placeholder',
331
+ message: 'TraceabilityDB integration pending - link will be persisted when connected',
332
+ };
333
+ return {
334
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
335
+ };
336
+ }
337
+ async function handleTraceQuery(args) {
338
+ const nodeType = args.nodeType;
339
+ const linkedTo = args.linkedTo;
340
+ const titlePattern = args.titlePattern;
341
+ // Placeholder implementation
342
+ const result = {
343
+ query: { nodeType, linkedTo, titlePattern },
344
+ results: [],
345
+ count: 0,
346
+ status: 'placeholder',
347
+ message: 'TraceabilityDB integration pending - query will return results when connected',
348
+ };
349
+ return {
350
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
351
+ };
352
+ }
353
+ async function handleTraceImpact(args) {
354
+ const nodeId = args.nodeId;
355
+ const maxDepth = args.maxDepth;
356
+ const direction = args.direction;
357
+ // Placeholder implementation
358
+ const result = {
359
+ sourceNode: nodeId,
360
+ maxDepth: maxDepth || 5,
361
+ direction: direction || 'forward',
362
+ impactedNodes: [],
363
+ totalAffected: 0,
364
+ status: 'placeholder',
365
+ message: 'ImpactAnalyzer integration pending - impact analysis will be available when connected',
366
+ };
367
+ return {
368
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
369
+ };
370
+ }
371
+ //# sourceMappingURL=formal-verify-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formal-verify-tools.js","sourceRoot":"","sources":["../../src/tools/formal-verify-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAA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*/
4
+ export { verifyPreconditionTool, verifyPostconditionTool, earsToSmtTool, traceAddLinkTool, traceQueryTool, traceImpactTool, formalVerifyTools, getFormalVerifyTools, handleFormalVerifyTool, } from './formal-verify-tools.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Formal Verify Tools - Module Exports
3
+ */
4
+ export { verifyPreconditionTool, verifyPostconditionTool, earsToSmtTool, traceAddLinkTool, traceQueryTool, traceImpactTool, formalVerifyTools, getFormalVerifyTools, handleFormalVerifyTool, } from './formal-verify-tools.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Impact Analyzer
3
+ *
4
+ * 変更の影響範囲を分析するクラス
5
+ */
6
+ import type { TraceabilityDB } from './TraceabilityDB.js';
7
+ import type { ImpactResult, TraceNodeType, TraceLinkType } from './types.js';
8
+ /**
9
+ * 影響分析オプション
10
+ */
11
+ export interface ImpactAnalysisOptions {
12
+ /** 最大分析深度 */
13
+ maxDepth?: number;
14
+ /** 追跡するリンクタイプ */
15
+ linkTypes?: TraceLinkType[];
16
+ /** 分析対象のノードタイプ */
17
+ nodeTypes?: TraceNodeType[];
18
+ /** 影響度の減衰率(深さごと) */
19
+ decayRate?: number;
20
+ /** 最小影響度のしきい値 */
21
+ minImpactScore?: number;
22
+ }
23
+ /**
24
+ * 影響分析器
25
+ *
26
+ * トレーサビリティDBを使用して、特定のノードが変更された場合の
27
+ * 影響範囲を分析します。
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * const db = new TraceabilityDB('./trace.db');
32
+ * const analyzer = new ImpactAnalyzer(db);
33
+ *
34
+ * // REQ-001が変更された場合の影響分析
35
+ * const impact = await analyzer.analyze('REQ-001');
36
+ *
37
+ * console.log(`影響を受けるノード: ${impact.totalImpacted}件`);
38
+ * for (const node of impact.impactedNodes) {
39
+ * console.log(`- ${node.id}: 影響度 ${node.impactScore}`);
40
+ * }
41
+ * ```
42
+ */
43
+ export declare class ImpactAnalyzer {
44
+ private readonly db;
45
+ constructor(db: TraceabilityDB);
46
+ /**
47
+ * 影響分析を実行
48
+ *
49
+ * @param sourceId - 変更の起点となるノードID
50
+ * @param options - 分析オプション
51
+ * @returns 影響分析結果
52
+ */
53
+ analyze(sourceId: string, options?: ImpactAnalysisOptions): Promise<ImpactResult>;
54
+ /**
55
+ * 逆方向の影響分析(依存元を探す)
56
+ *
57
+ * @param targetId - 調査対象のノードID
58
+ * @param options - 分析オプション
59
+ */
60
+ analyzeReverse(targetId: string, options?: ImpactAnalysisOptions): Promise<ImpactResult>;
61
+ /**
62
+ * カバレッジ分析
63
+ *
64
+ * 要件がどの程度テストでカバーされているかを分析
65
+ */
66
+ analyzeCoverage(requirementType?: TraceNodeType, testType?: TraceNodeType): Promise<CoverageResult>;
67
+ /**
68
+ * 循環依存を検出
69
+ */
70
+ detectCycles(): Promise<string[][]>;
71
+ /**
72
+ * DFSで循環を検出
73
+ */
74
+ private detectCyclesDFS;
75
+ /**
76
+ * 出力リンクを取得
77
+ */
78
+ private getOutgoingLinks;
79
+ /**
80
+ * 入力リンクを取得
81
+ */
82
+ private getIncomingLinks;
83
+ }
84
+ /**
85
+ * カバレッジ分析結果
86
+ */
87
+ export interface CoverageResult {
88
+ /** 総要件数 */
89
+ totalRequirements: number;
90
+ /** カバーされた要件数 */
91
+ coveredRequirements: number;
92
+ /** カバーされていない要件数 */
93
+ uncoveredRequirements: number;
94
+ /** カバレッジ率 */
95
+ coveragePercentage: number;
96
+ /** カバーされた要件のID */
97
+ covered: string[];
98
+ /** カバーされていない要件のID */
99
+ uncovered: string[];
100
+ /** 総テスト数 */
101
+ totalTests: number;
102
+ }
103
+ //# sourceMappingURL=ImpactAnalyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImpactAnalyzer.d.ts","sourceRoot":"","sources":["../../src/traceability/ImpactAnalyzer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EACV,YAAY,EAEZ,aAAa,EACb,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,aAAa;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB;IACjB,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAC5B,kBAAkB;IAClB,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAC5B,oBAAoB;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAiB;gBAExB,EAAE,EAAE,cAAc;IAI9B;;;;;;OAMG;IACG,OAAO,CACX,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,YAAY,CAAC;IAuGxB;;;;;OAKG;IACG,cAAc,CAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAA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