windows-exe-decompiler-mcp-server 0.1.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.
Files changed (190) hide show
  1. package/CODEX_INSTALLATION.md +69 -0
  2. package/COPILOT_INSTALLATION.md +77 -0
  3. package/LICENSE +21 -0
  4. package/README.md +314 -0
  5. package/bin/windows-exe-decompiler-mcp-server.js +3 -0
  6. package/dist/analysis-provenance.d.ts +184 -0
  7. package/dist/analysis-provenance.js +74 -0
  8. package/dist/analysis-task-runner.d.ts +31 -0
  9. package/dist/analysis-task-runner.js +160 -0
  10. package/dist/artifact-inventory.d.ts +23 -0
  11. package/dist/artifact-inventory.js +175 -0
  12. package/dist/cache-manager.d.ts +128 -0
  13. package/dist/cache-manager.js +454 -0
  14. package/dist/confidence-semantics.d.ts +66 -0
  15. package/dist/confidence-semantics.js +122 -0
  16. package/dist/config.d.ts +335 -0
  17. package/dist/config.js +193 -0
  18. package/dist/database.d.ts +227 -0
  19. package/dist/database.js +601 -0
  20. package/dist/decompiler-worker.d.ts +441 -0
  21. package/dist/decompiler-worker.js +1962 -0
  22. package/dist/dynamic-trace.d.ts +95 -0
  23. package/dist/dynamic-trace.js +629 -0
  24. package/dist/env-validator.d.ts +15 -0
  25. package/dist/env-validator.js +249 -0
  26. package/dist/error-handler.d.ts +28 -0
  27. package/dist/error-handler.example.d.ts +22 -0
  28. package/dist/error-handler.example.js +141 -0
  29. package/dist/error-handler.js +139 -0
  30. package/dist/ghidra-analysis-status.d.ts +49 -0
  31. package/dist/ghidra-analysis-status.js +178 -0
  32. package/dist/ghidra-config.d.ts +134 -0
  33. package/dist/ghidra-config.js +464 -0
  34. package/dist/index.d.ts +9 -0
  35. package/dist/index.js +200 -0
  36. package/dist/job-queue.d.ts +169 -0
  37. package/dist/job-queue.js +407 -0
  38. package/dist/logger.d.ts +106 -0
  39. package/dist/logger.js +176 -0
  40. package/dist/policy-guard.d.ts +115 -0
  41. package/dist/policy-guard.js +243 -0
  42. package/dist/process-output.d.ts +15 -0
  43. package/dist/process-output.js +90 -0
  44. package/dist/prompts/function-explanation-review.d.ts +5 -0
  45. package/dist/prompts/function-explanation-review.js +64 -0
  46. package/dist/prompts/semantic-name-review.d.ts +5 -0
  47. package/dist/prompts/semantic-name-review.js +63 -0
  48. package/dist/runtime-correlation.d.ts +34 -0
  49. package/dist/runtime-correlation.js +279 -0
  50. package/dist/runtime-paths.d.ts +3 -0
  51. package/dist/runtime-paths.js +11 -0
  52. package/dist/selection-diff.d.ts +667 -0
  53. package/dist/selection-diff.js +53 -0
  54. package/dist/semantic-name-suggestion-artifacts.d.ts +116 -0
  55. package/dist/semantic-name-suggestion-artifacts.js +314 -0
  56. package/dist/server.d.ts +129 -0
  57. package/dist/server.js +578 -0
  58. package/dist/tools/artifact-read.d.ts +235 -0
  59. package/dist/tools/artifact-read.js +317 -0
  60. package/dist/tools/artifacts-diff.d.ts +728 -0
  61. package/dist/tools/artifacts-diff.js +304 -0
  62. package/dist/tools/artifacts-list.d.ts +515 -0
  63. package/dist/tools/artifacts-list.js +389 -0
  64. package/dist/tools/attack-map.d.ts +290 -0
  65. package/dist/tools/attack-map.js +519 -0
  66. package/dist/tools/cache-observability.d.ts +4 -0
  67. package/dist/tools/cache-observability.js +36 -0
  68. package/dist/tools/code-function-cfg.d.ts +50 -0
  69. package/dist/tools/code-function-cfg.js +102 -0
  70. package/dist/tools/code-function-decompile.d.ts +55 -0
  71. package/dist/tools/code-function-decompile.js +103 -0
  72. package/dist/tools/code-function-disassemble.d.ts +43 -0
  73. package/dist/tools/code-function-disassemble.js +185 -0
  74. package/dist/tools/code-function-explain-apply.d.ts +255 -0
  75. package/dist/tools/code-function-explain-apply.js +225 -0
  76. package/dist/tools/code-function-explain-prepare.d.ts +535 -0
  77. package/dist/tools/code-function-explain-prepare.js +276 -0
  78. package/dist/tools/code-function-explain-review.d.ts +397 -0
  79. package/dist/tools/code-function-explain-review.js +589 -0
  80. package/dist/tools/code-function-rename-apply.d.ts +248 -0
  81. package/dist/tools/code-function-rename-apply.js +220 -0
  82. package/dist/tools/code-function-rename-prepare.d.ts +506 -0
  83. package/dist/tools/code-function-rename-prepare.js +279 -0
  84. package/dist/tools/code-function-rename-review.d.ts +574 -0
  85. package/dist/tools/code-function-rename-review.js +761 -0
  86. package/dist/tools/code-functions-list.d.ts +37 -0
  87. package/dist/tools/code-functions-list.js +91 -0
  88. package/dist/tools/code-functions-rank.d.ts +34 -0
  89. package/dist/tools/code-functions-rank.js +90 -0
  90. package/dist/tools/code-functions-reconstruct.d.ts +2725 -0
  91. package/dist/tools/code-functions-reconstruct.js +2807 -0
  92. package/dist/tools/code-functions-search.d.ts +39 -0
  93. package/dist/tools/code-functions-search.js +90 -0
  94. package/dist/tools/code-reconstruct-export.d.ts +1212 -0
  95. package/dist/tools/code-reconstruct-export.js +4002 -0
  96. package/dist/tools/code-reconstruct-plan.d.ts +274 -0
  97. package/dist/tools/code-reconstruct-plan.js +342 -0
  98. package/dist/tools/dotnet-metadata-extract.d.ts +541 -0
  99. package/dist/tools/dotnet-metadata-extract.js +355 -0
  100. package/dist/tools/dotnet-reconstruct-export.d.ts +567 -0
  101. package/dist/tools/dotnet-reconstruct-export.js +1151 -0
  102. package/dist/tools/dotnet-types-list.d.ts +325 -0
  103. package/dist/tools/dotnet-types-list.js +201 -0
  104. package/dist/tools/dynamic-dependencies.d.ts +115 -0
  105. package/dist/tools/dynamic-dependencies.js +213 -0
  106. package/dist/tools/dynamic-memory-import.d.ts +10 -0
  107. package/dist/tools/dynamic-memory-import.js +567 -0
  108. package/dist/tools/dynamic-trace-import.d.ts +10 -0
  109. package/dist/tools/dynamic-trace-import.js +235 -0
  110. package/dist/tools/entrypoint-fallback-disasm.d.ts +30 -0
  111. package/dist/tools/entrypoint-fallback-disasm.js +89 -0
  112. package/dist/tools/ghidra-analyze.d.ts +88 -0
  113. package/dist/tools/ghidra-analyze.js +208 -0
  114. package/dist/tools/ghidra-health.d.ts +37 -0
  115. package/dist/tools/ghidra-health.js +212 -0
  116. package/dist/tools/ioc-export.d.ts +209 -0
  117. package/dist/tools/ioc-export.js +542 -0
  118. package/dist/tools/packer-detect.d.ts +165 -0
  119. package/dist/tools/packer-detect.js +284 -0
  120. package/dist/tools/pe-exports-extract.d.ts +175 -0
  121. package/dist/tools/pe-exports-extract.js +253 -0
  122. package/dist/tools/pe-fingerprint.d.ts +234 -0
  123. package/dist/tools/pe-fingerprint.js +269 -0
  124. package/dist/tools/pe-imports-extract.d.ts +105 -0
  125. package/dist/tools/pe-imports-extract.js +245 -0
  126. package/dist/tools/report-generate.d.ts +157 -0
  127. package/dist/tools/report-generate.js +457 -0
  128. package/dist/tools/report-summarize.d.ts +2131 -0
  129. package/dist/tools/report-summarize.js +596 -0
  130. package/dist/tools/runtime-detect.d.ts +135 -0
  131. package/dist/tools/runtime-detect.js +247 -0
  132. package/dist/tools/sample-ingest.d.ts +94 -0
  133. package/dist/tools/sample-ingest.js +327 -0
  134. package/dist/tools/sample-profile-get.d.ts +183 -0
  135. package/dist/tools/sample-profile-get.js +121 -0
  136. package/dist/tools/sandbox-execute.d.ts +441 -0
  137. package/dist/tools/sandbox-execute.js +392 -0
  138. package/dist/tools/strings-extract.d.ts +375 -0
  139. package/dist/tools/strings-extract.js +314 -0
  140. package/dist/tools/strings-floss-decode.d.ts +143 -0
  141. package/dist/tools/strings-floss-decode.js +259 -0
  142. package/dist/tools/system-health.d.ts +434 -0
  143. package/dist/tools/system-health.js +446 -0
  144. package/dist/tools/task-cancel.d.ts +21 -0
  145. package/dist/tools/task-cancel.js +70 -0
  146. package/dist/tools/task-status.d.ts +27 -0
  147. package/dist/tools/task-status.js +106 -0
  148. package/dist/tools/task-sweep.d.ts +22 -0
  149. package/dist/tools/task-sweep.js +77 -0
  150. package/dist/tools/tool-help.d.ts +340 -0
  151. package/dist/tools/tool-help.js +261 -0
  152. package/dist/tools/yara-scan.d.ts +554 -0
  153. package/dist/tools/yara-scan.js +313 -0
  154. package/dist/types.d.ts +266 -0
  155. package/dist/types.js +41 -0
  156. package/dist/worker-pool.d.ts +204 -0
  157. package/dist/worker-pool.js +650 -0
  158. package/dist/workflows/deep-static.d.ts +104 -0
  159. package/dist/workflows/deep-static.js +276 -0
  160. package/dist/workflows/function-explanation-review.d.ts +655 -0
  161. package/dist/workflows/function-explanation-review.js +440 -0
  162. package/dist/workflows/reconstruct.d.ts +2053 -0
  163. package/dist/workflows/reconstruct.js +666 -0
  164. package/dist/workflows/semantic-name-review.d.ts +2418 -0
  165. package/dist/workflows/semantic-name-review.js +521 -0
  166. package/dist/workflows/triage.d.ts +659 -0
  167. package/dist/workflows/triage.js +1374 -0
  168. package/dist/workspace-manager.d.ts +150 -0
  169. package/dist/workspace-manager.js +411 -0
  170. package/ghidra_scripts/DecompileFunction.java +487 -0
  171. package/ghidra_scripts/DecompileFunction.py +150 -0
  172. package/ghidra_scripts/ExtractCFG.java +256 -0
  173. package/ghidra_scripts/ExtractCFG.py +233 -0
  174. package/ghidra_scripts/ExtractFunctions.java +442 -0
  175. package/ghidra_scripts/ExtractFunctions.py +101 -0
  176. package/ghidra_scripts/README.md +125 -0
  177. package/ghidra_scripts/SearchFunctionReferences.java +380 -0
  178. package/helpers/DotNetMetadataProbe/DotNetMetadataProbe.csproj +9 -0
  179. package/helpers/DotNetMetadataProbe/Program.cs +566 -0
  180. package/install-to-codex.ps1 +178 -0
  181. package/install-to-copilot.ps1 +303 -0
  182. package/package.json +101 -0
  183. package/requirements.txt +9 -0
  184. package/workers/requirements-dynamic.txt +11 -0
  185. package/workers/requirements.txt +8 -0
  186. package/workers/speakeasy_compat.py +175 -0
  187. package/workers/static_worker.py +5183 -0
  188. package/workers/yara_rules/default.yar +33 -0
  189. package/workers/yara_rules/malware_families.yar +93 -0
  190. package/workers/yara_rules/packers.yar +80 -0
@@ -0,0 +1,2725 @@
1
+ /**
2
+ * code.functions.reconstruct tool implementation
3
+ * Function-level semantic reconstruction by combining decompile + CFG + assembly evidence.
4
+ */
5
+ import { z } from 'zod';
6
+ import type { ToolDefinition, ToolArgs, WorkerResult } from '../types.js';
7
+ import type { WorkspaceManager } from '../workspace-manager.js';
8
+ import type { DatabaseManager } from '../database.js';
9
+ import type { CacheManager } from '../cache-manager.js';
10
+ import { type RankedFunction, type DecompiledFunction, type ControlFlowGraph, type FunctionXrefSummary } from '../decompiler-worker.js';
11
+ import { type DynamicTraceSummary } from '../dynamic-trace.js';
12
+ import { correlateFunctionWithRuntimeEvidence } from '../runtime-correlation.js';
13
+ import { type SemanticNameSuggestionIndex } from '../semantic-name-suggestion-artifacts.js';
14
+ export declare const CodeFunctionsReconstructInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
15
+ sample_id: z.ZodString;
16
+ address: z.ZodOptional<z.ZodString>;
17
+ symbol: z.ZodOptional<z.ZodString>;
18
+ topk: z.ZodDefault<z.ZodNumber>;
19
+ include_xrefs: z.ZodDefault<z.ZodBoolean>;
20
+ max_pseudocode_lines: z.ZodDefault<z.ZodNumber>;
21
+ max_assembly_lines: z.ZodDefault<z.ZodNumber>;
22
+ timeout: z.ZodDefault<z.ZodNumber>;
23
+ evidence_scope: z.ZodDefault<z.ZodEnum<["all", "latest", "session"]>>;
24
+ evidence_session_tag: z.ZodOptional<z.ZodString>;
25
+ semantic_scope: z.ZodDefault<z.ZodEnum<["all", "latest", "session"]>>;
26
+ semantic_session_tag: z.ZodOptional<z.ZodString>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ timeout: number;
29
+ sample_id: string;
30
+ evidence_scope: "all" | "latest" | "session";
31
+ topk: number;
32
+ include_xrefs: boolean;
33
+ max_pseudocode_lines: number;
34
+ max_assembly_lines: number;
35
+ semantic_scope: "all" | "latest" | "session";
36
+ symbol?: string | undefined;
37
+ address?: string | undefined;
38
+ evidence_session_tag?: string | undefined;
39
+ semantic_session_tag?: string | undefined;
40
+ }, {
41
+ sample_id: string;
42
+ symbol?: string | undefined;
43
+ timeout?: number | undefined;
44
+ address?: string | undefined;
45
+ evidence_scope?: "all" | "latest" | "session" | undefined;
46
+ topk?: number | undefined;
47
+ include_xrefs?: boolean | undefined;
48
+ max_pseudocode_lines?: number | undefined;
49
+ max_assembly_lines?: number | undefined;
50
+ evidence_session_tag?: string | undefined;
51
+ semantic_scope?: "all" | "latest" | "session" | undefined;
52
+ semantic_session_tag?: string | undefined;
53
+ }>, {
54
+ timeout: number;
55
+ sample_id: string;
56
+ evidence_scope: "all" | "latest" | "session";
57
+ topk: number;
58
+ include_xrefs: boolean;
59
+ max_pseudocode_lines: number;
60
+ max_assembly_lines: number;
61
+ semantic_scope: "all" | "latest" | "session";
62
+ symbol?: string | undefined;
63
+ address?: string | undefined;
64
+ evidence_session_tag?: string | undefined;
65
+ semantic_session_tag?: string | undefined;
66
+ }, {
67
+ sample_id: string;
68
+ symbol?: string | undefined;
69
+ timeout?: number | undefined;
70
+ address?: string | undefined;
71
+ evidence_scope?: "all" | "latest" | "session" | undefined;
72
+ topk?: number | undefined;
73
+ include_xrefs?: boolean | undefined;
74
+ max_pseudocode_lines?: number | undefined;
75
+ max_assembly_lines?: number | undefined;
76
+ evidence_session_tag?: string | undefined;
77
+ semantic_scope?: "all" | "latest" | "session" | undefined;
78
+ semantic_session_tag?: string | undefined;
79
+ }>, {
80
+ timeout: number;
81
+ sample_id: string;
82
+ evidence_scope: "all" | "latest" | "session";
83
+ topk: number;
84
+ include_xrefs: boolean;
85
+ max_pseudocode_lines: number;
86
+ max_assembly_lines: number;
87
+ semantic_scope: "all" | "latest" | "session";
88
+ symbol?: string | undefined;
89
+ address?: string | undefined;
90
+ evidence_session_tag?: string | undefined;
91
+ semantic_session_tag?: string | undefined;
92
+ }, {
93
+ sample_id: string;
94
+ symbol?: string | undefined;
95
+ timeout?: number | undefined;
96
+ address?: string | undefined;
97
+ evidence_scope?: "all" | "latest" | "session" | undefined;
98
+ topk?: number | undefined;
99
+ include_xrefs?: boolean | undefined;
100
+ max_pseudocode_lines?: number | undefined;
101
+ max_assembly_lines?: number | undefined;
102
+ evidence_session_tag?: string | undefined;
103
+ semantic_scope?: "all" | "latest" | "session" | undefined;
104
+ semantic_session_tag?: string | undefined;
105
+ }>;
106
+ export type CodeFunctionsReconstructInput = z.infer<typeof CodeFunctionsReconstructInputSchema>;
107
+ export declare const CodeFunctionsReconstructOutputSchema: z.ZodObject<{
108
+ ok: z.ZodBoolean;
109
+ data: z.ZodOptional<z.ZodObject<{
110
+ sample_id: z.ZodString;
111
+ mode: z.ZodEnum<["single", "topk"]>;
112
+ requested_count: z.ZodNumber;
113
+ reconstructed_count: z.ZodNumber;
114
+ overall_confidence: z.ZodNumber;
115
+ provenance: z.ZodObject<{
116
+ runtime: z.ZodObject<{
117
+ scope: z.ZodEnum<["all", "latest", "session"]>;
118
+ session_selector: z.ZodNullable<z.ZodString>;
119
+ artifact_count: z.ZodNumber;
120
+ artifact_ids: z.ZodArray<z.ZodString, "many">;
121
+ session_tags: z.ZodArray<z.ZodString, "many">;
122
+ earliest_artifact_at: z.ZodNullable<z.ZodString>;
123
+ latest_artifact_at: z.ZodNullable<z.ZodString>;
124
+ scope_note: z.ZodString;
125
+ }, "strip", z.ZodTypeAny, {
126
+ artifact_count: number;
127
+ scope_note: string;
128
+ artifact_ids: string[];
129
+ session_selector: string | null;
130
+ session_tags: string[];
131
+ scope: "all" | "latest" | "session";
132
+ earliest_artifact_at: string | null;
133
+ latest_artifact_at: string | null;
134
+ }, {
135
+ artifact_count: number;
136
+ scope_note: string;
137
+ artifact_ids: string[];
138
+ session_selector: string | null;
139
+ session_tags: string[];
140
+ scope: "all" | "latest" | "session";
141
+ earliest_artifact_at: string | null;
142
+ latest_artifact_at: string | null;
143
+ }>;
144
+ semantic_names: z.ZodOptional<z.ZodObject<{
145
+ scope: z.ZodEnum<["all", "latest", "session"]>;
146
+ session_selector: z.ZodNullable<z.ZodString>;
147
+ artifact_count: z.ZodNumber;
148
+ artifact_ids: z.ZodArray<z.ZodString, "many">;
149
+ session_tags: z.ZodArray<z.ZodString, "many">;
150
+ earliest_artifact_at: z.ZodNullable<z.ZodString>;
151
+ latest_artifact_at: z.ZodNullable<z.ZodString>;
152
+ scope_note: z.ZodString;
153
+ }, "strip", z.ZodTypeAny, {
154
+ artifact_count: number;
155
+ scope_note: string;
156
+ artifact_ids: string[];
157
+ session_selector: string | null;
158
+ session_tags: string[];
159
+ scope: "all" | "latest" | "session";
160
+ earliest_artifact_at: string | null;
161
+ latest_artifact_at: string | null;
162
+ }, {
163
+ artifact_count: number;
164
+ scope_note: string;
165
+ artifact_ids: string[];
166
+ session_selector: string | null;
167
+ session_tags: string[];
168
+ scope: "all" | "latest" | "session";
169
+ earliest_artifact_at: string | null;
170
+ latest_artifact_at: string | null;
171
+ }>>;
172
+ semantic_explanations: z.ZodOptional<z.ZodObject<{
173
+ scope: z.ZodEnum<["all", "latest", "session"]>;
174
+ session_selector: z.ZodNullable<z.ZodString>;
175
+ artifact_count: z.ZodNumber;
176
+ artifact_ids: z.ZodArray<z.ZodString, "many">;
177
+ session_tags: z.ZodArray<z.ZodString, "many">;
178
+ earliest_artifact_at: z.ZodNullable<z.ZodString>;
179
+ latest_artifact_at: z.ZodNullable<z.ZodString>;
180
+ scope_note: z.ZodString;
181
+ }, "strip", z.ZodTypeAny, {
182
+ artifact_count: number;
183
+ scope_note: string;
184
+ artifact_ids: string[];
185
+ session_selector: string | null;
186
+ session_tags: string[];
187
+ scope: "all" | "latest" | "session";
188
+ earliest_artifact_at: string | null;
189
+ latest_artifact_at: string | null;
190
+ }, {
191
+ artifact_count: number;
192
+ scope_note: string;
193
+ artifact_ids: string[];
194
+ session_selector: string | null;
195
+ session_tags: string[];
196
+ scope: "all" | "latest" | "session";
197
+ earliest_artifact_at: string | null;
198
+ latest_artifact_at: string | null;
199
+ }>>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ runtime: {
202
+ artifact_count: number;
203
+ scope_note: string;
204
+ artifact_ids: string[];
205
+ session_selector: string | null;
206
+ session_tags: string[];
207
+ scope: "all" | "latest" | "session";
208
+ earliest_artifact_at: string | null;
209
+ latest_artifact_at: string | null;
210
+ };
211
+ semantic_names?: {
212
+ artifact_count: number;
213
+ scope_note: string;
214
+ artifact_ids: string[];
215
+ session_selector: string | null;
216
+ session_tags: string[];
217
+ scope: "all" | "latest" | "session";
218
+ earliest_artifact_at: string | null;
219
+ latest_artifact_at: string | null;
220
+ } | undefined;
221
+ semantic_explanations?: {
222
+ artifact_count: number;
223
+ scope_note: string;
224
+ artifact_ids: string[];
225
+ session_selector: string | null;
226
+ session_tags: string[];
227
+ scope: "all" | "latest" | "session";
228
+ earliest_artifact_at: string | null;
229
+ latest_artifact_at: string | null;
230
+ } | undefined;
231
+ }, {
232
+ runtime: {
233
+ artifact_count: number;
234
+ scope_note: string;
235
+ artifact_ids: string[];
236
+ session_selector: string | null;
237
+ session_tags: string[];
238
+ scope: "all" | "latest" | "session";
239
+ earliest_artifact_at: string | null;
240
+ latest_artifact_at: string | null;
241
+ };
242
+ semantic_names?: {
243
+ artifact_count: number;
244
+ scope_note: string;
245
+ artifact_ids: string[];
246
+ session_selector: string | null;
247
+ session_tags: string[];
248
+ scope: "all" | "latest" | "session";
249
+ earliest_artifact_at: string | null;
250
+ latest_artifact_at: string | null;
251
+ } | undefined;
252
+ semantic_explanations?: {
253
+ artifact_count: number;
254
+ scope_note: string;
255
+ artifact_ids: string[];
256
+ session_selector: string | null;
257
+ session_tags: string[];
258
+ scope: "all" | "latest" | "session";
259
+ earliest_artifact_at: string | null;
260
+ latest_artifact_at: string | null;
261
+ } | undefined;
262
+ }>;
263
+ confidence_map: z.ZodArray<z.ZodObject<{
264
+ function: z.ZodString;
265
+ address: z.ZodString;
266
+ confidence: z.ZodNumber;
267
+ gaps: z.ZodArray<z.ZodString, "many">;
268
+ }, "strip", z.ZodTypeAny, {
269
+ function: string;
270
+ address: string;
271
+ gaps: string[];
272
+ confidence: number;
273
+ }, {
274
+ function: string;
275
+ address: string;
276
+ gaps: string[];
277
+ confidence: number;
278
+ }>, "many">;
279
+ functions: z.ZodArray<z.ZodObject<{
280
+ target: z.ZodString;
281
+ function: z.ZodString;
282
+ address: z.ZodString;
283
+ rank_score: z.ZodNullable<z.ZodNumber>;
284
+ rank_reasons: z.ZodArray<z.ZodString, "many">;
285
+ suggested_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
286
+ suggested_role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
287
+ rename_confidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
288
+ rename_evidence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
289
+ semantic_summary: z.ZodString;
290
+ xref_signals: z.ZodArray<z.ZodObject<{
291
+ api: z.ZodString;
292
+ provenance: z.ZodEnum<["static_named_call", "dynamic_resolution_api", "dynamic_resolution_helper", "global_string_hint", "unknown"]>;
293
+ confidence: z.ZodNumber;
294
+ evidence: z.ZodArray<z.ZodString, "many">;
295
+ }, "strip", z.ZodTypeAny, {
296
+ confidence: number;
297
+ api: string;
298
+ evidence: string[];
299
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
300
+ }, {
301
+ confidence: number;
302
+ api: string;
303
+ evidence: string[];
304
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
305
+ }>, "many">;
306
+ call_context: z.ZodObject<{
307
+ callers: z.ZodArray<z.ZodString, "many">;
308
+ callees: z.ZodArray<z.ZodString, "many">;
309
+ }, "strip", z.ZodTypeAny, {
310
+ callees: string[];
311
+ callers: string[];
312
+ }, {
313
+ callees: string[];
314
+ callers: string[];
315
+ }>;
316
+ call_relationships: z.ZodObject<{
317
+ callers: z.ZodArray<z.ZodObject<{
318
+ target: z.ZodString;
319
+ relation_types: z.ZodArray<z.ZodString, "many">;
320
+ reference_types: z.ZodArray<z.ZodString, "many">;
321
+ resolved_by: z.ZodNullable<z.ZodString>;
322
+ is_exact: z.ZodNullable<z.ZodBoolean>;
323
+ }, "strip", z.ZodTypeAny, {
324
+ target: string;
325
+ relation_types: string[];
326
+ reference_types: string[];
327
+ resolved_by: string | null;
328
+ is_exact: boolean | null;
329
+ }, {
330
+ target: string;
331
+ relation_types: string[];
332
+ reference_types: string[];
333
+ resolved_by: string | null;
334
+ is_exact: boolean | null;
335
+ }>, "many">;
336
+ callees: z.ZodArray<z.ZodObject<{
337
+ target: z.ZodString;
338
+ relation_types: z.ZodArray<z.ZodString, "many">;
339
+ reference_types: z.ZodArray<z.ZodString, "many">;
340
+ resolved_by: z.ZodNullable<z.ZodString>;
341
+ is_exact: z.ZodNullable<z.ZodBoolean>;
342
+ }, "strip", z.ZodTypeAny, {
343
+ target: string;
344
+ relation_types: string[];
345
+ reference_types: string[];
346
+ resolved_by: string | null;
347
+ is_exact: boolean | null;
348
+ }, {
349
+ target: string;
350
+ relation_types: string[];
351
+ reference_types: string[];
352
+ resolved_by: string | null;
353
+ is_exact: boolean | null;
354
+ }>, "many">;
355
+ }, "strip", z.ZodTypeAny, {
356
+ callees: {
357
+ target: string;
358
+ relation_types: string[];
359
+ reference_types: string[];
360
+ resolved_by: string | null;
361
+ is_exact: boolean | null;
362
+ }[];
363
+ callers: {
364
+ target: string;
365
+ relation_types: string[];
366
+ reference_types: string[];
367
+ resolved_by: string | null;
368
+ is_exact: boolean | null;
369
+ }[];
370
+ }, {
371
+ callees: {
372
+ target: string;
373
+ relation_types: string[];
374
+ reference_types: string[];
375
+ resolved_by: string | null;
376
+ is_exact: boolean | null;
377
+ }[];
378
+ callers: {
379
+ target: string;
380
+ relation_types: string[];
381
+ reference_types: string[];
382
+ resolved_by: string | null;
383
+ is_exact: boolean | null;
384
+ }[];
385
+ }>;
386
+ runtime_context: z.ZodOptional<z.ZodNullable<z.ZodObject<{
387
+ corroborated_apis: z.ZodArray<z.ZodString, "many">;
388
+ corroborated_stages: z.ZodArray<z.ZodString, "many">;
389
+ notes: z.ZodArray<z.ZodString, "many">;
390
+ confidence: z.ZodNumber;
391
+ executed: z.ZodOptional<z.ZodBoolean>;
392
+ evidence_sources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
393
+ source_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
394
+ artifact_count: z.ZodOptional<z.ZodNumber>;
395
+ executed_artifact_count: z.ZodOptional<z.ZodNumber>;
396
+ matched_memory_regions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
397
+ suggested_modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
398
+ matched_by: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
399
+ provenance_layers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
400
+ latest_artifact_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
401
+ scope_note: z.ZodOptional<z.ZodString>;
402
+ }, "strip", z.ZodTypeAny, {
403
+ confidence: number;
404
+ notes: string[];
405
+ corroborated_apis: string[];
406
+ corroborated_stages: string[];
407
+ executed?: boolean | undefined;
408
+ artifact_count?: number | undefined;
409
+ executed_artifact_count?: number | undefined;
410
+ source_names?: string[] | undefined;
411
+ scope_note?: string | undefined;
412
+ latest_artifact_at?: string | null | undefined;
413
+ evidence_sources?: string[] | undefined;
414
+ matched_memory_regions?: string[] | undefined;
415
+ suggested_modules?: string[] | undefined;
416
+ matched_by?: string[] | undefined;
417
+ provenance_layers?: string[] | undefined;
418
+ }, {
419
+ confidence: number;
420
+ notes: string[];
421
+ corroborated_apis: string[];
422
+ corroborated_stages: string[];
423
+ executed?: boolean | undefined;
424
+ artifact_count?: number | undefined;
425
+ executed_artifact_count?: number | undefined;
426
+ source_names?: string[] | undefined;
427
+ scope_note?: string | undefined;
428
+ latest_artifact_at?: string | null | undefined;
429
+ evidence_sources?: string[] | undefined;
430
+ matched_memory_regions?: string[] | undefined;
431
+ suggested_modules?: string[] | undefined;
432
+ matched_by?: string[] | undefined;
433
+ provenance_layers?: string[] | undefined;
434
+ }>>>;
435
+ parameter_roles: z.ZodOptional<z.ZodArray<z.ZodObject<{
436
+ slot: z.ZodString;
437
+ role: z.ZodString;
438
+ inferred_type: z.ZodString;
439
+ confidence: z.ZodNumber;
440
+ evidence: z.ZodArray<z.ZodString, "many">;
441
+ }, "strip", z.ZodTypeAny, {
442
+ confidence: number;
443
+ evidence: string[];
444
+ role: string;
445
+ slot: string;
446
+ inferred_type: string;
447
+ }, {
448
+ confidence: number;
449
+ evidence: string[];
450
+ role: string;
451
+ slot: string;
452
+ inferred_type: string;
453
+ }>, "many">>;
454
+ state_roles: z.ZodOptional<z.ZodArray<z.ZodObject<{
455
+ state_key: z.ZodString;
456
+ role: z.ZodString;
457
+ confidence: z.ZodNumber;
458
+ evidence: z.ZodArray<z.ZodString, "many">;
459
+ }, "strip", z.ZodTypeAny, {
460
+ confidence: number;
461
+ evidence: string[];
462
+ role: string;
463
+ state_key: string;
464
+ }, {
465
+ confidence: number;
466
+ evidence: string[];
467
+ role: string;
468
+ state_key: string;
469
+ }>, "many">>;
470
+ struct_inference: z.ZodOptional<z.ZodArray<z.ZodObject<{
471
+ semantic_name: z.ZodString;
472
+ rewrite_type_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
473
+ kind: z.ZodEnum<["request", "result", "context", "table", "session"]>;
474
+ confidence: z.ZodNumber;
475
+ fields: z.ZodArray<z.ZodObject<{
476
+ name: z.ZodString;
477
+ inferred_type: z.ZodString;
478
+ source_slot: z.ZodOptional<z.ZodNullable<z.ZodString>>;
479
+ }, "strip", z.ZodTypeAny, {
480
+ name: string;
481
+ inferred_type: string;
482
+ source_slot?: string | null | undefined;
483
+ }, {
484
+ name: string;
485
+ inferred_type: string;
486
+ source_slot?: string | null | undefined;
487
+ }>, "many">;
488
+ evidence: z.ZodArray<z.ZodString, "many">;
489
+ }, "strip", z.ZodTypeAny, {
490
+ kind: "session" | "context" | "result" | "request" | "table";
491
+ confidence: number;
492
+ evidence: string[];
493
+ semantic_name: string;
494
+ fields: {
495
+ name: string;
496
+ inferred_type: string;
497
+ source_slot?: string | null | undefined;
498
+ }[];
499
+ rewrite_type_name?: string | null | undefined;
500
+ }, {
501
+ kind: "session" | "context" | "result" | "request" | "table";
502
+ confidence: number;
503
+ evidence: string[];
504
+ semantic_name: string;
505
+ fields: {
506
+ name: string;
507
+ inferred_type: string;
508
+ source_slot?: string | null | undefined;
509
+ }[];
510
+ rewrite_type_name?: string | null | undefined;
511
+ }>, "many">>;
512
+ semantic_evidence: z.ZodOptional<z.ZodObject<{
513
+ semantic_summary: z.ZodString;
514
+ xref_signals: z.ZodArray<z.ZodObject<{
515
+ api: z.ZodString;
516
+ provenance: z.ZodEnum<["static_named_call", "dynamic_resolution_api", "dynamic_resolution_helper", "global_string_hint", "unknown"]>;
517
+ confidence: z.ZodNumber;
518
+ evidence: z.ZodArray<z.ZodString, "many">;
519
+ }, "strip", z.ZodTypeAny, {
520
+ confidence: number;
521
+ api: string;
522
+ evidence: string[];
523
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
524
+ }, {
525
+ confidence: number;
526
+ api: string;
527
+ evidence: string[];
528
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
529
+ }>, "many">;
530
+ call_relationships: z.ZodObject<{
531
+ callers: z.ZodArray<z.ZodObject<{
532
+ target: z.ZodString;
533
+ relation_types: z.ZodArray<z.ZodString, "many">;
534
+ reference_types: z.ZodArray<z.ZodString, "many">;
535
+ resolved_by: z.ZodNullable<z.ZodString>;
536
+ is_exact: z.ZodNullable<z.ZodBoolean>;
537
+ }, "strip", z.ZodTypeAny, {
538
+ target: string;
539
+ relation_types: string[];
540
+ reference_types: string[];
541
+ resolved_by: string | null;
542
+ is_exact: boolean | null;
543
+ }, {
544
+ target: string;
545
+ relation_types: string[];
546
+ reference_types: string[];
547
+ resolved_by: string | null;
548
+ is_exact: boolean | null;
549
+ }>, "many">;
550
+ callees: z.ZodArray<z.ZodObject<{
551
+ target: z.ZodString;
552
+ relation_types: z.ZodArray<z.ZodString, "many">;
553
+ reference_types: z.ZodArray<z.ZodString, "many">;
554
+ resolved_by: z.ZodNullable<z.ZodString>;
555
+ is_exact: z.ZodNullable<z.ZodBoolean>;
556
+ }, "strip", z.ZodTypeAny, {
557
+ target: string;
558
+ relation_types: string[];
559
+ reference_types: string[];
560
+ resolved_by: string | null;
561
+ is_exact: boolean | null;
562
+ }, {
563
+ target: string;
564
+ relation_types: string[];
565
+ reference_types: string[];
566
+ resolved_by: string | null;
567
+ is_exact: boolean | null;
568
+ }>, "many">;
569
+ }, "strip", z.ZodTypeAny, {
570
+ callees: {
571
+ target: string;
572
+ relation_types: string[];
573
+ reference_types: string[];
574
+ resolved_by: string | null;
575
+ is_exact: boolean | null;
576
+ }[];
577
+ callers: {
578
+ target: string;
579
+ relation_types: string[];
580
+ reference_types: string[];
581
+ resolved_by: string | null;
582
+ is_exact: boolean | null;
583
+ }[];
584
+ }, {
585
+ callees: {
586
+ target: string;
587
+ relation_types: string[];
588
+ reference_types: string[];
589
+ resolved_by: string | null;
590
+ is_exact: boolean | null;
591
+ }[];
592
+ callers: {
593
+ target: string;
594
+ relation_types: string[];
595
+ reference_types: string[];
596
+ resolved_by: string | null;
597
+ is_exact: boolean | null;
598
+ }[];
599
+ }>;
600
+ runtime_context: z.ZodOptional<z.ZodNullable<z.ZodObject<{
601
+ corroborated_apis: z.ZodArray<z.ZodString, "many">;
602
+ corroborated_stages: z.ZodArray<z.ZodString, "many">;
603
+ notes: z.ZodArray<z.ZodString, "many">;
604
+ confidence: z.ZodNumber;
605
+ executed: z.ZodOptional<z.ZodBoolean>;
606
+ evidence_sources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
607
+ source_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
608
+ artifact_count: z.ZodOptional<z.ZodNumber>;
609
+ executed_artifact_count: z.ZodOptional<z.ZodNumber>;
610
+ matched_memory_regions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
611
+ suggested_modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
612
+ matched_by: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
613
+ provenance_layers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
614
+ latest_artifact_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
615
+ scope_note: z.ZodOptional<z.ZodString>;
616
+ }, "strip", z.ZodTypeAny, {
617
+ confidence: number;
618
+ notes: string[];
619
+ corroborated_apis: string[];
620
+ corroborated_stages: string[];
621
+ executed?: boolean | undefined;
622
+ artifact_count?: number | undefined;
623
+ executed_artifact_count?: number | undefined;
624
+ source_names?: string[] | undefined;
625
+ scope_note?: string | undefined;
626
+ latest_artifact_at?: string | null | undefined;
627
+ evidence_sources?: string[] | undefined;
628
+ matched_memory_regions?: string[] | undefined;
629
+ suggested_modules?: string[] | undefined;
630
+ matched_by?: string[] | undefined;
631
+ provenance_layers?: string[] | undefined;
632
+ }, {
633
+ confidence: number;
634
+ notes: string[];
635
+ corroborated_apis: string[];
636
+ corroborated_stages: string[];
637
+ executed?: boolean | undefined;
638
+ artifact_count?: number | undefined;
639
+ executed_artifact_count?: number | undefined;
640
+ source_names?: string[] | undefined;
641
+ scope_note?: string | undefined;
642
+ latest_artifact_at?: string | null | undefined;
643
+ evidence_sources?: string[] | undefined;
644
+ matched_memory_regions?: string[] | undefined;
645
+ suggested_modules?: string[] | undefined;
646
+ matched_by?: string[] | undefined;
647
+ provenance_layers?: string[] | undefined;
648
+ }>>>;
649
+ string_hints: z.ZodArray<z.ZodString, "many">;
650
+ pseudocode_excerpt: z.ZodString;
651
+ cfg_shape: z.ZodObject<{
652
+ node_count: z.ZodNumber;
653
+ edge_count: z.ZodNumber;
654
+ has_loop: z.ZodBoolean;
655
+ has_branching: z.ZodBoolean;
656
+ block_types: z.ZodArray<z.ZodString, "many">;
657
+ entry_block_type: z.ZodNullable<z.ZodString>;
658
+ }, "strip", z.ZodTypeAny, {
659
+ node_count: number;
660
+ edge_count: number;
661
+ has_loop: boolean;
662
+ has_branching: boolean;
663
+ block_types: string[];
664
+ entry_block_type: string | null;
665
+ }, {
666
+ node_count: number;
667
+ edge_count: number;
668
+ has_loop: boolean;
669
+ has_branching: boolean;
670
+ block_types: string[];
671
+ entry_block_type: string | null;
672
+ }>;
673
+ parameter_roles: z.ZodArray<z.ZodObject<{
674
+ slot: z.ZodString;
675
+ role: z.ZodString;
676
+ inferred_type: z.ZodString;
677
+ confidence: z.ZodNumber;
678
+ evidence: z.ZodArray<z.ZodString, "many">;
679
+ }, "strip", z.ZodTypeAny, {
680
+ confidence: number;
681
+ evidence: string[];
682
+ role: string;
683
+ slot: string;
684
+ inferred_type: string;
685
+ }, {
686
+ confidence: number;
687
+ evidence: string[];
688
+ role: string;
689
+ slot: string;
690
+ inferred_type: string;
691
+ }>, "many">;
692
+ state_roles: z.ZodArray<z.ZodObject<{
693
+ state_key: z.ZodString;
694
+ role: z.ZodString;
695
+ confidence: z.ZodNumber;
696
+ evidence: z.ZodArray<z.ZodString, "many">;
697
+ }, "strip", z.ZodTypeAny, {
698
+ confidence: number;
699
+ evidence: string[];
700
+ role: string;
701
+ state_key: string;
702
+ }, {
703
+ confidence: number;
704
+ evidence: string[];
705
+ role: string;
706
+ state_key: string;
707
+ }>, "many">;
708
+ struct_inference: z.ZodArray<z.ZodObject<{
709
+ semantic_name: z.ZodString;
710
+ rewrite_type_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
711
+ kind: z.ZodEnum<["request", "result", "context", "table", "session"]>;
712
+ confidence: z.ZodNumber;
713
+ fields: z.ZodArray<z.ZodObject<{
714
+ name: z.ZodString;
715
+ inferred_type: z.ZodString;
716
+ source_slot: z.ZodOptional<z.ZodNullable<z.ZodString>>;
717
+ }, "strip", z.ZodTypeAny, {
718
+ name: string;
719
+ inferred_type: string;
720
+ source_slot?: string | null | undefined;
721
+ }, {
722
+ name: string;
723
+ inferred_type: string;
724
+ source_slot?: string | null | undefined;
725
+ }>, "many">;
726
+ evidence: z.ZodArray<z.ZodString, "many">;
727
+ }, "strip", z.ZodTypeAny, {
728
+ kind: "session" | "context" | "result" | "request" | "table";
729
+ confidence: number;
730
+ evidence: string[];
731
+ semantic_name: string;
732
+ fields: {
733
+ name: string;
734
+ inferred_type: string;
735
+ source_slot?: string | null | undefined;
736
+ }[];
737
+ rewrite_type_name?: string | null | undefined;
738
+ }, {
739
+ kind: "session" | "context" | "result" | "request" | "table";
740
+ confidence: number;
741
+ evidence: string[];
742
+ semantic_name: string;
743
+ fields: {
744
+ name: string;
745
+ inferred_type: string;
746
+ source_slot?: string | null | undefined;
747
+ }[];
748
+ rewrite_type_name?: string | null | undefined;
749
+ }>, "many">;
750
+ }, "strip", z.ZodTypeAny, {
751
+ semantic_summary: string;
752
+ xref_signals: {
753
+ confidence: number;
754
+ api: string;
755
+ evidence: string[];
756
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
757
+ }[];
758
+ call_relationships: {
759
+ callees: {
760
+ target: string;
761
+ relation_types: string[];
762
+ reference_types: string[];
763
+ resolved_by: string | null;
764
+ is_exact: boolean | null;
765
+ }[];
766
+ callers: {
767
+ target: string;
768
+ relation_types: string[];
769
+ reference_types: string[];
770
+ resolved_by: string | null;
771
+ is_exact: boolean | null;
772
+ }[];
773
+ };
774
+ string_hints: string[];
775
+ pseudocode_excerpt: string;
776
+ cfg_shape: {
777
+ node_count: number;
778
+ edge_count: number;
779
+ has_loop: boolean;
780
+ has_branching: boolean;
781
+ block_types: string[];
782
+ entry_block_type: string | null;
783
+ };
784
+ parameter_roles: {
785
+ confidence: number;
786
+ evidence: string[];
787
+ role: string;
788
+ slot: string;
789
+ inferred_type: string;
790
+ }[];
791
+ state_roles: {
792
+ confidence: number;
793
+ evidence: string[];
794
+ role: string;
795
+ state_key: string;
796
+ }[];
797
+ struct_inference: {
798
+ kind: "session" | "context" | "result" | "request" | "table";
799
+ confidence: number;
800
+ evidence: string[];
801
+ semantic_name: string;
802
+ fields: {
803
+ name: string;
804
+ inferred_type: string;
805
+ source_slot?: string | null | undefined;
806
+ }[];
807
+ rewrite_type_name?: string | null | undefined;
808
+ }[];
809
+ runtime_context?: {
810
+ confidence: number;
811
+ notes: string[];
812
+ corroborated_apis: string[];
813
+ corroborated_stages: string[];
814
+ executed?: boolean | undefined;
815
+ artifact_count?: number | undefined;
816
+ executed_artifact_count?: number | undefined;
817
+ source_names?: string[] | undefined;
818
+ scope_note?: string | undefined;
819
+ latest_artifact_at?: string | null | undefined;
820
+ evidence_sources?: string[] | undefined;
821
+ matched_memory_regions?: string[] | undefined;
822
+ suggested_modules?: string[] | undefined;
823
+ matched_by?: string[] | undefined;
824
+ provenance_layers?: string[] | undefined;
825
+ } | null | undefined;
826
+ }, {
827
+ semantic_summary: string;
828
+ xref_signals: {
829
+ confidence: number;
830
+ api: string;
831
+ evidence: string[];
832
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
833
+ }[];
834
+ call_relationships: {
835
+ callees: {
836
+ target: string;
837
+ relation_types: string[];
838
+ reference_types: string[];
839
+ resolved_by: string | null;
840
+ is_exact: boolean | null;
841
+ }[];
842
+ callers: {
843
+ target: string;
844
+ relation_types: string[];
845
+ reference_types: string[];
846
+ resolved_by: string | null;
847
+ is_exact: boolean | null;
848
+ }[];
849
+ };
850
+ string_hints: string[];
851
+ pseudocode_excerpt: string;
852
+ cfg_shape: {
853
+ node_count: number;
854
+ edge_count: number;
855
+ has_loop: boolean;
856
+ has_branching: boolean;
857
+ block_types: string[];
858
+ entry_block_type: string | null;
859
+ };
860
+ parameter_roles: {
861
+ confidence: number;
862
+ evidence: string[];
863
+ role: string;
864
+ slot: string;
865
+ inferred_type: string;
866
+ }[];
867
+ state_roles: {
868
+ confidence: number;
869
+ evidence: string[];
870
+ role: string;
871
+ state_key: string;
872
+ }[];
873
+ struct_inference: {
874
+ kind: "session" | "context" | "result" | "request" | "table";
875
+ confidence: number;
876
+ evidence: string[];
877
+ semantic_name: string;
878
+ fields: {
879
+ name: string;
880
+ inferred_type: string;
881
+ source_slot?: string | null | undefined;
882
+ }[];
883
+ rewrite_type_name?: string | null | undefined;
884
+ }[];
885
+ runtime_context?: {
886
+ confidence: number;
887
+ notes: string[];
888
+ corroborated_apis: string[];
889
+ corroborated_stages: string[];
890
+ executed?: boolean | undefined;
891
+ artifact_count?: number | undefined;
892
+ executed_artifact_count?: number | undefined;
893
+ source_names?: string[] | undefined;
894
+ scope_note?: string | undefined;
895
+ latest_artifact_at?: string | null | undefined;
896
+ evidence_sources?: string[] | undefined;
897
+ matched_memory_regions?: string[] | undefined;
898
+ suggested_modules?: string[] | undefined;
899
+ matched_by?: string[] | undefined;
900
+ provenance_layers?: string[] | undefined;
901
+ } | null | undefined;
902
+ }>>;
903
+ name_resolution: z.ZodOptional<z.ZodObject<{
904
+ rule_based_name: z.ZodNullable<z.ZodString>;
905
+ llm_suggested_name: z.ZodNullable<z.ZodString>;
906
+ llm_confidence: z.ZodNullable<z.ZodNumber>;
907
+ llm_why: z.ZodNullable<z.ZodString>;
908
+ required_assumptions: z.ZodArray<z.ZodString, "many">;
909
+ evidence_used: z.ZodArray<z.ZodString, "many">;
910
+ validated_name: z.ZodNullable<z.ZodString>;
911
+ resolution_source: z.ZodEnum<["rule", "llm", "hybrid", "unresolved"]>;
912
+ unresolved_semantic_name: z.ZodBoolean;
913
+ }, "strip", z.ZodTypeAny, {
914
+ rule_based_name: string | null;
915
+ llm_suggested_name: string | null;
916
+ llm_confidence: number | null;
917
+ llm_why: string | null;
918
+ required_assumptions: string[];
919
+ evidence_used: string[];
920
+ validated_name: string | null;
921
+ resolution_source: "hybrid" | "rule" | "llm" | "unresolved";
922
+ unresolved_semantic_name: boolean;
923
+ }, {
924
+ rule_based_name: string | null;
925
+ llm_suggested_name: string | null;
926
+ llm_confidence: number | null;
927
+ llm_why: string | null;
928
+ required_assumptions: string[];
929
+ evidence_used: string[];
930
+ validated_name: string | null;
931
+ resolution_source: "hybrid" | "rule" | "llm" | "unresolved";
932
+ unresolved_semantic_name: boolean;
933
+ }>>;
934
+ confidence_profile: z.ZodOptional<z.ZodObject<{
935
+ score_kind: z.ZodEnum<["heuristic_reconstruction", "runtime_correlation", "naming_resolution", "report_assessment"]>;
936
+ score: z.ZodNullable<z.ZodNumber>;
937
+ band: z.ZodEnum<["none", "low", "medium", "high"]>;
938
+ calibrated: z.ZodBoolean;
939
+ meaning: z.ZodString;
940
+ compare_within: z.ZodString;
941
+ caution: z.ZodString;
942
+ acceptance_rule: z.ZodOptional<z.ZodNullable<z.ZodString>>;
943
+ drivers: z.ZodArray<z.ZodString, "many">;
944
+ }, "strip", z.ZodTypeAny, {
945
+ score: number | null;
946
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
947
+ band: "high" | "none" | "low" | "medium";
948
+ calibrated: boolean;
949
+ meaning: string;
950
+ compare_within: string;
951
+ caution: string;
952
+ drivers: string[];
953
+ acceptance_rule?: string | null | undefined;
954
+ }, {
955
+ score: number | null;
956
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
957
+ band: "high" | "none" | "low" | "medium";
958
+ calibrated: boolean;
959
+ meaning: string;
960
+ compare_within: string;
961
+ caution: string;
962
+ drivers: string[];
963
+ acceptance_rule?: string | null | undefined;
964
+ }>>;
965
+ runtime_confidence_profile: z.ZodOptional<z.ZodNullable<z.ZodObject<{
966
+ score_kind: z.ZodEnum<["heuristic_reconstruction", "runtime_correlation", "naming_resolution", "report_assessment"]>;
967
+ score: z.ZodNullable<z.ZodNumber>;
968
+ band: z.ZodEnum<["none", "low", "medium", "high"]>;
969
+ calibrated: z.ZodBoolean;
970
+ meaning: z.ZodString;
971
+ compare_within: z.ZodString;
972
+ caution: z.ZodString;
973
+ acceptance_rule: z.ZodOptional<z.ZodNullable<z.ZodString>>;
974
+ drivers: z.ZodArray<z.ZodString, "many">;
975
+ }, "strip", z.ZodTypeAny, {
976
+ score: number | null;
977
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
978
+ band: "high" | "none" | "low" | "medium";
979
+ calibrated: boolean;
980
+ meaning: string;
981
+ compare_within: string;
982
+ caution: string;
983
+ drivers: string[];
984
+ acceptance_rule?: string | null | undefined;
985
+ }, {
986
+ score: number | null;
987
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
988
+ band: "high" | "none" | "low" | "medium";
989
+ calibrated: boolean;
990
+ meaning: string;
991
+ compare_within: string;
992
+ caution: string;
993
+ drivers: string[];
994
+ acceptance_rule?: string | null | undefined;
995
+ }>>>;
996
+ naming_confidence_profile: z.ZodOptional<z.ZodObject<{
997
+ score_kind: z.ZodEnum<["heuristic_reconstruction", "runtime_correlation", "naming_resolution", "report_assessment"]>;
998
+ score: z.ZodNullable<z.ZodNumber>;
999
+ band: z.ZodEnum<["none", "low", "medium", "high"]>;
1000
+ calibrated: z.ZodBoolean;
1001
+ meaning: z.ZodString;
1002
+ compare_within: z.ZodString;
1003
+ caution: z.ZodString;
1004
+ acceptance_rule: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1005
+ drivers: z.ZodArray<z.ZodString, "many">;
1006
+ }, "strip", z.ZodTypeAny, {
1007
+ score: number | null;
1008
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1009
+ band: "high" | "none" | "low" | "medium";
1010
+ calibrated: boolean;
1011
+ meaning: string;
1012
+ compare_within: string;
1013
+ caution: string;
1014
+ drivers: string[];
1015
+ acceptance_rule?: string | null | undefined;
1016
+ }, {
1017
+ score: number | null;
1018
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1019
+ band: "high" | "none" | "low" | "medium";
1020
+ calibrated: boolean;
1021
+ meaning: string;
1022
+ compare_within: string;
1023
+ caution: string;
1024
+ drivers: string[];
1025
+ acceptance_rule?: string | null | undefined;
1026
+ }>>;
1027
+ confidence: z.ZodNumber;
1028
+ confidence_breakdown: z.ZodObject<{
1029
+ decompile: z.ZodNumber;
1030
+ cfg: z.ZodNumber;
1031
+ assembly: z.ZodNumber;
1032
+ context: z.ZodNumber;
1033
+ }, "strip", z.ZodTypeAny, {
1034
+ decompile: number;
1035
+ cfg: number;
1036
+ context: number;
1037
+ assembly: number;
1038
+ }, {
1039
+ decompile: number;
1040
+ cfg: number;
1041
+ context: number;
1042
+ assembly: number;
1043
+ }>;
1044
+ gaps: z.ZodArray<z.ZodString, "many">;
1045
+ evidence: z.ZodObject<{
1046
+ pseudocode_lines: z.ZodNumber;
1047
+ cfg_nodes: z.ZodNumber;
1048
+ cfg_edges: z.ZodNumber;
1049
+ instruction_count: z.ZodNumber;
1050
+ caller_count: z.ZodNumber;
1051
+ callee_count: z.ZodNumber;
1052
+ }, "strip", z.ZodTypeAny, {
1053
+ caller_count: number;
1054
+ callee_count: number;
1055
+ pseudocode_lines: number;
1056
+ cfg_nodes: number;
1057
+ cfg_edges: number;
1058
+ instruction_count: number;
1059
+ }, {
1060
+ caller_count: number;
1061
+ callee_count: number;
1062
+ pseudocode_lines: number;
1063
+ cfg_nodes: number;
1064
+ cfg_edges: number;
1065
+ instruction_count: number;
1066
+ }>;
1067
+ behavior_tags: z.ZodArray<z.ZodString, "many">;
1068
+ source_like_snippet: z.ZodString;
1069
+ assembly_excerpt: z.ZodString;
1070
+ }, "strip", z.ZodTypeAny, {
1071
+ function: string;
1072
+ address: string;
1073
+ gaps: string[];
1074
+ confidence: number;
1075
+ target: string;
1076
+ evidence: {
1077
+ caller_count: number;
1078
+ callee_count: number;
1079
+ pseudocode_lines: number;
1080
+ cfg_nodes: number;
1081
+ cfg_edges: number;
1082
+ instruction_count: number;
1083
+ };
1084
+ confidence_breakdown: {
1085
+ decompile: number;
1086
+ cfg: number;
1087
+ context: number;
1088
+ assembly: number;
1089
+ };
1090
+ semantic_summary: string;
1091
+ xref_signals: {
1092
+ confidence: number;
1093
+ api: string;
1094
+ evidence: string[];
1095
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
1096
+ }[];
1097
+ call_relationships: {
1098
+ callees: {
1099
+ target: string;
1100
+ relation_types: string[];
1101
+ reference_types: string[];
1102
+ resolved_by: string | null;
1103
+ is_exact: boolean | null;
1104
+ }[];
1105
+ callers: {
1106
+ target: string;
1107
+ relation_types: string[];
1108
+ reference_types: string[];
1109
+ resolved_by: string | null;
1110
+ is_exact: boolean | null;
1111
+ }[];
1112
+ };
1113
+ rank_score: number | null;
1114
+ rank_reasons: string[];
1115
+ call_context: {
1116
+ callees: string[];
1117
+ callers: string[];
1118
+ };
1119
+ behavior_tags: string[];
1120
+ source_like_snippet: string;
1121
+ assembly_excerpt: string;
1122
+ runtime_context?: {
1123
+ confidence: number;
1124
+ notes: string[];
1125
+ corroborated_apis: string[];
1126
+ corroborated_stages: string[];
1127
+ executed?: boolean | undefined;
1128
+ artifact_count?: number | undefined;
1129
+ executed_artifact_count?: number | undefined;
1130
+ source_names?: string[] | undefined;
1131
+ scope_note?: string | undefined;
1132
+ latest_artifact_at?: string | null | undefined;
1133
+ evidence_sources?: string[] | undefined;
1134
+ matched_memory_regions?: string[] | undefined;
1135
+ suggested_modules?: string[] | undefined;
1136
+ matched_by?: string[] | undefined;
1137
+ provenance_layers?: string[] | undefined;
1138
+ } | null | undefined;
1139
+ parameter_roles?: {
1140
+ confidence: number;
1141
+ evidence: string[];
1142
+ role: string;
1143
+ slot: string;
1144
+ inferred_type: string;
1145
+ }[] | undefined;
1146
+ state_roles?: {
1147
+ confidence: number;
1148
+ evidence: string[];
1149
+ role: string;
1150
+ state_key: string;
1151
+ }[] | undefined;
1152
+ struct_inference?: {
1153
+ kind: "session" | "context" | "result" | "request" | "table";
1154
+ confidence: number;
1155
+ evidence: string[];
1156
+ semantic_name: string;
1157
+ fields: {
1158
+ name: string;
1159
+ inferred_type: string;
1160
+ source_slot?: string | null | undefined;
1161
+ }[];
1162
+ rewrite_type_name?: string | null | undefined;
1163
+ }[] | undefined;
1164
+ suggested_name?: string | null | undefined;
1165
+ suggested_role?: string | null | undefined;
1166
+ rename_confidence?: number | null | undefined;
1167
+ rename_evidence?: string[] | undefined;
1168
+ semantic_evidence?: {
1169
+ semantic_summary: string;
1170
+ xref_signals: {
1171
+ confidence: number;
1172
+ api: string;
1173
+ evidence: string[];
1174
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
1175
+ }[];
1176
+ call_relationships: {
1177
+ callees: {
1178
+ target: string;
1179
+ relation_types: string[];
1180
+ reference_types: string[];
1181
+ resolved_by: string | null;
1182
+ is_exact: boolean | null;
1183
+ }[];
1184
+ callers: {
1185
+ target: string;
1186
+ relation_types: string[];
1187
+ reference_types: string[];
1188
+ resolved_by: string | null;
1189
+ is_exact: boolean | null;
1190
+ }[];
1191
+ };
1192
+ string_hints: string[];
1193
+ pseudocode_excerpt: string;
1194
+ cfg_shape: {
1195
+ node_count: number;
1196
+ edge_count: number;
1197
+ has_loop: boolean;
1198
+ has_branching: boolean;
1199
+ block_types: string[];
1200
+ entry_block_type: string | null;
1201
+ };
1202
+ parameter_roles: {
1203
+ confidence: number;
1204
+ evidence: string[];
1205
+ role: string;
1206
+ slot: string;
1207
+ inferred_type: string;
1208
+ }[];
1209
+ state_roles: {
1210
+ confidence: number;
1211
+ evidence: string[];
1212
+ role: string;
1213
+ state_key: string;
1214
+ }[];
1215
+ struct_inference: {
1216
+ kind: "session" | "context" | "result" | "request" | "table";
1217
+ confidence: number;
1218
+ evidence: string[];
1219
+ semantic_name: string;
1220
+ fields: {
1221
+ name: string;
1222
+ inferred_type: string;
1223
+ source_slot?: string | null | undefined;
1224
+ }[];
1225
+ rewrite_type_name?: string | null | undefined;
1226
+ }[];
1227
+ runtime_context?: {
1228
+ confidence: number;
1229
+ notes: string[];
1230
+ corroborated_apis: string[];
1231
+ corroborated_stages: string[];
1232
+ executed?: boolean | undefined;
1233
+ artifact_count?: number | undefined;
1234
+ executed_artifact_count?: number | undefined;
1235
+ source_names?: string[] | undefined;
1236
+ scope_note?: string | undefined;
1237
+ latest_artifact_at?: string | null | undefined;
1238
+ evidence_sources?: string[] | undefined;
1239
+ matched_memory_regions?: string[] | undefined;
1240
+ suggested_modules?: string[] | undefined;
1241
+ matched_by?: string[] | undefined;
1242
+ provenance_layers?: string[] | undefined;
1243
+ } | null | undefined;
1244
+ } | undefined;
1245
+ name_resolution?: {
1246
+ rule_based_name: string | null;
1247
+ llm_suggested_name: string | null;
1248
+ llm_confidence: number | null;
1249
+ llm_why: string | null;
1250
+ required_assumptions: string[];
1251
+ evidence_used: string[];
1252
+ validated_name: string | null;
1253
+ resolution_source: "hybrid" | "rule" | "llm" | "unresolved";
1254
+ unresolved_semantic_name: boolean;
1255
+ } | undefined;
1256
+ confidence_profile?: {
1257
+ score: number | null;
1258
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1259
+ band: "high" | "none" | "low" | "medium";
1260
+ calibrated: boolean;
1261
+ meaning: string;
1262
+ compare_within: string;
1263
+ caution: string;
1264
+ drivers: string[];
1265
+ acceptance_rule?: string | null | undefined;
1266
+ } | undefined;
1267
+ runtime_confidence_profile?: {
1268
+ score: number | null;
1269
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1270
+ band: "high" | "none" | "low" | "medium";
1271
+ calibrated: boolean;
1272
+ meaning: string;
1273
+ compare_within: string;
1274
+ caution: string;
1275
+ drivers: string[];
1276
+ acceptance_rule?: string | null | undefined;
1277
+ } | null | undefined;
1278
+ naming_confidence_profile?: {
1279
+ score: number | null;
1280
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1281
+ band: "high" | "none" | "low" | "medium";
1282
+ calibrated: boolean;
1283
+ meaning: string;
1284
+ compare_within: string;
1285
+ caution: string;
1286
+ drivers: string[];
1287
+ acceptance_rule?: string | null | undefined;
1288
+ } | undefined;
1289
+ }, {
1290
+ function: string;
1291
+ address: string;
1292
+ gaps: string[];
1293
+ confidence: number;
1294
+ target: string;
1295
+ evidence: {
1296
+ caller_count: number;
1297
+ callee_count: number;
1298
+ pseudocode_lines: number;
1299
+ cfg_nodes: number;
1300
+ cfg_edges: number;
1301
+ instruction_count: number;
1302
+ };
1303
+ confidence_breakdown: {
1304
+ decompile: number;
1305
+ cfg: number;
1306
+ context: number;
1307
+ assembly: number;
1308
+ };
1309
+ semantic_summary: string;
1310
+ xref_signals: {
1311
+ confidence: number;
1312
+ api: string;
1313
+ evidence: string[];
1314
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
1315
+ }[];
1316
+ call_relationships: {
1317
+ callees: {
1318
+ target: string;
1319
+ relation_types: string[];
1320
+ reference_types: string[];
1321
+ resolved_by: string | null;
1322
+ is_exact: boolean | null;
1323
+ }[];
1324
+ callers: {
1325
+ target: string;
1326
+ relation_types: string[];
1327
+ reference_types: string[];
1328
+ resolved_by: string | null;
1329
+ is_exact: boolean | null;
1330
+ }[];
1331
+ };
1332
+ rank_score: number | null;
1333
+ rank_reasons: string[];
1334
+ call_context: {
1335
+ callees: string[];
1336
+ callers: string[];
1337
+ };
1338
+ behavior_tags: string[];
1339
+ source_like_snippet: string;
1340
+ assembly_excerpt: string;
1341
+ runtime_context?: {
1342
+ confidence: number;
1343
+ notes: string[];
1344
+ corroborated_apis: string[];
1345
+ corroborated_stages: string[];
1346
+ executed?: boolean | undefined;
1347
+ artifact_count?: number | undefined;
1348
+ executed_artifact_count?: number | undefined;
1349
+ source_names?: string[] | undefined;
1350
+ scope_note?: string | undefined;
1351
+ latest_artifact_at?: string | null | undefined;
1352
+ evidence_sources?: string[] | undefined;
1353
+ matched_memory_regions?: string[] | undefined;
1354
+ suggested_modules?: string[] | undefined;
1355
+ matched_by?: string[] | undefined;
1356
+ provenance_layers?: string[] | undefined;
1357
+ } | null | undefined;
1358
+ parameter_roles?: {
1359
+ confidence: number;
1360
+ evidence: string[];
1361
+ role: string;
1362
+ slot: string;
1363
+ inferred_type: string;
1364
+ }[] | undefined;
1365
+ state_roles?: {
1366
+ confidence: number;
1367
+ evidence: string[];
1368
+ role: string;
1369
+ state_key: string;
1370
+ }[] | undefined;
1371
+ struct_inference?: {
1372
+ kind: "session" | "context" | "result" | "request" | "table";
1373
+ confidence: number;
1374
+ evidence: string[];
1375
+ semantic_name: string;
1376
+ fields: {
1377
+ name: string;
1378
+ inferred_type: string;
1379
+ source_slot?: string | null | undefined;
1380
+ }[];
1381
+ rewrite_type_name?: string | null | undefined;
1382
+ }[] | undefined;
1383
+ suggested_name?: string | null | undefined;
1384
+ suggested_role?: string | null | undefined;
1385
+ rename_confidence?: number | null | undefined;
1386
+ rename_evidence?: string[] | undefined;
1387
+ semantic_evidence?: {
1388
+ semantic_summary: string;
1389
+ xref_signals: {
1390
+ confidence: number;
1391
+ api: string;
1392
+ evidence: string[];
1393
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
1394
+ }[];
1395
+ call_relationships: {
1396
+ callees: {
1397
+ target: string;
1398
+ relation_types: string[];
1399
+ reference_types: string[];
1400
+ resolved_by: string | null;
1401
+ is_exact: boolean | null;
1402
+ }[];
1403
+ callers: {
1404
+ target: string;
1405
+ relation_types: string[];
1406
+ reference_types: string[];
1407
+ resolved_by: string | null;
1408
+ is_exact: boolean | null;
1409
+ }[];
1410
+ };
1411
+ string_hints: string[];
1412
+ pseudocode_excerpt: string;
1413
+ cfg_shape: {
1414
+ node_count: number;
1415
+ edge_count: number;
1416
+ has_loop: boolean;
1417
+ has_branching: boolean;
1418
+ block_types: string[];
1419
+ entry_block_type: string | null;
1420
+ };
1421
+ parameter_roles: {
1422
+ confidence: number;
1423
+ evidence: string[];
1424
+ role: string;
1425
+ slot: string;
1426
+ inferred_type: string;
1427
+ }[];
1428
+ state_roles: {
1429
+ confidence: number;
1430
+ evidence: string[];
1431
+ role: string;
1432
+ state_key: string;
1433
+ }[];
1434
+ struct_inference: {
1435
+ kind: "session" | "context" | "result" | "request" | "table";
1436
+ confidence: number;
1437
+ evidence: string[];
1438
+ semantic_name: string;
1439
+ fields: {
1440
+ name: string;
1441
+ inferred_type: string;
1442
+ source_slot?: string | null | undefined;
1443
+ }[];
1444
+ rewrite_type_name?: string | null | undefined;
1445
+ }[];
1446
+ runtime_context?: {
1447
+ confidence: number;
1448
+ notes: string[];
1449
+ corroborated_apis: string[];
1450
+ corroborated_stages: string[];
1451
+ executed?: boolean | undefined;
1452
+ artifact_count?: number | undefined;
1453
+ executed_artifact_count?: number | undefined;
1454
+ source_names?: string[] | undefined;
1455
+ scope_note?: string | undefined;
1456
+ latest_artifact_at?: string | null | undefined;
1457
+ evidence_sources?: string[] | undefined;
1458
+ matched_memory_regions?: string[] | undefined;
1459
+ suggested_modules?: string[] | undefined;
1460
+ matched_by?: string[] | undefined;
1461
+ provenance_layers?: string[] | undefined;
1462
+ } | null | undefined;
1463
+ } | undefined;
1464
+ name_resolution?: {
1465
+ rule_based_name: string | null;
1466
+ llm_suggested_name: string | null;
1467
+ llm_confidence: number | null;
1468
+ llm_why: string | null;
1469
+ required_assumptions: string[];
1470
+ evidence_used: string[];
1471
+ validated_name: string | null;
1472
+ resolution_source: "hybrid" | "rule" | "llm" | "unresolved";
1473
+ unresolved_semantic_name: boolean;
1474
+ } | undefined;
1475
+ confidence_profile?: {
1476
+ score: number | null;
1477
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1478
+ band: "high" | "none" | "low" | "medium";
1479
+ calibrated: boolean;
1480
+ meaning: string;
1481
+ compare_within: string;
1482
+ caution: string;
1483
+ drivers: string[];
1484
+ acceptance_rule?: string | null | undefined;
1485
+ } | undefined;
1486
+ runtime_confidence_profile?: {
1487
+ score: number | null;
1488
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1489
+ band: "high" | "none" | "low" | "medium";
1490
+ calibrated: boolean;
1491
+ meaning: string;
1492
+ compare_within: string;
1493
+ caution: string;
1494
+ drivers: string[];
1495
+ acceptance_rule?: string | null | undefined;
1496
+ } | null | undefined;
1497
+ naming_confidence_profile?: {
1498
+ score: number | null;
1499
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1500
+ band: "high" | "none" | "low" | "medium";
1501
+ calibrated: boolean;
1502
+ meaning: string;
1503
+ compare_within: string;
1504
+ caution: string;
1505
+ drivers: string[];
1506
+ acceptance_rule?: string | null | undefined;
1507
+ } | undefined;
1508
+ }>, "many">;
1509
+ }, "strip", z.ZodTypeAny, {
1510
+ sample_id: string;
1511
+ mode: "topk" | "single";
1512
+ functions: {
1513
+ function: string;
1514
+ address: string;
1515
+ gaps: string[];
1516
+ confidence: number;
1517
+ target: string;
1518
+ evidence: {
1519
+ caller_count: number;
1520
+ callee_count: number;
1521
+ pseudocode_lines: number;
1522
+ cfg_nodes: number;
1523
+ cfg_edges: number;
1524
+ instruction_count: number;
1525
+ };
1526
+ confidence_breakdown: {
1527
+ decompile: number;
1528
+ cfg: number;
1529
+ context: number;
1530
+ assembly: number;
1531
+ };
1532
+ semantic_summary: string;
1533
+ xref_signals: {
1534
+ confidence: number;
1535
+ api: string;
1536
+ evidence: string[];
1537
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
1538
+ }[];
1539
+ call_relationships: {
1540
+ callees: {
1541
+ target: string;
1542
+ relation_types: string[];
1543
+ reference_types: string[];
1544
+ resolved_by: string | null;
1545
+ is_exact: boolean | null;
1546
+ }[];
1547
+ callers: {
1548
+ target: string;
1549
+ relation_types: string[];
1550
+ reference_types: string[];
1551
+ resolved_by: string | null;
1552
+ is_exact: boolean | null;
1553
+ }[];
1554
+ };
1555
+ rank_score: number | null;
1556
+ rank_reasons: string[];
1557
+ call_context: {
1558
+ callees: string[];
1559
+ callers: string[];
1560
+ };
1561
+ behavior_tags: string[];
1562
+ source_like_snippet: string;
1563
+ assembly_excerpt: string;
1564
+ runtime_context?: {
1565
+ confidence: number;
1566
+ notes: string[];
1567
+ corroborated_apis: string[];
1568
+ corroborated_stages: string[];
1569
+ executed?: boolean | undefined;
1570
+ artifact_count?: number | undefined;
1571
+ executed_artifact_count?: number | undefined;
1572
+ source_names?: string[] | undefined;
1573
+ scope_note?: string | undefined;
1574
+ latest_artifact_at?: string | null | undefined;
1575
+ evidence_sources?: string[] | undefined;
1576
+ matched_memory_regions?: string[] | undefined;
1577
+ suggested_modules?: string[] | undefined;
1578
+ matched_by?: string[] | undefined;
1579
+ provenance_layers?: string[] | undefined;
1580
+ } | null | undefined;
1581
+ parameter_roles?: {
1582
+ confidence: number;
1583
+ evidence: string[];
1584
+ role: string;
1585
+ slot: string;
1586
+ inferred_type: string;
1587
+ }[] | undefined;
1588
+ state_roles?: {
1589
+ confidence: number;
1590
+ evidence: string[];
1591
+ role: string;
1592
+ state_key: string;
1593
+ }[] | undefined;
1594
+ struct_inference?: {
1595
+ kind: "session" | "context" | "result" | "request" | "table";
1596
+ confidence: number;
1597
+ evidence: string[];
1598
+ semantic_name: string;
1599
+ fields: {
1600
+ name: string;
1601
+ inferred_type: string;
1602
+ source_slot?: string | null | undefined;
1603
+ }[];
1604
+ rewrite_type_name?: string | null | undefined;
1605
+ }[] | undefined;
1606
+ suggested_name?: string | null | undefined;
1607
+ suggested_role?: string | null | undefined;
1608
+ rename_confidence?: number | null | undefined;
1609
+ rename_evidence?: string[] | undefined;
1610
+ semantic_evidence?: {
1611
+ semantic_summary: string;
1612
+ xref_signals: {
1613
+ confidence: number;
1614
+ api: string;
1615
+ evidence: string[];
1616
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
1617
+ }[];
1618
+ call_relationships: {
1619
+ callees: {
1620
+ target: string;
1621
+ relation_types: string[];
1622
+ reference_types: string[];
1623
+ resolved_by: string | null;
1624
+ is_exact: boolean | null;
1625
+ }[];
1626
+ callers: {
1627
+ target: string;
1628
+ relation_types: string[];
1629
+ reference_types: string[];
1630
+ resolved_by: string | null;
1631
+ is_exact: boolean | null;
1632
+ }[];
1633
+ };
1634
+ string_hints: string[];
1635
+ pseudocode_excerpt: string;
1636
+ cfg_shape: {
1637
+ node_count: number;
1638
+ edge_count: number;
1639
+ has_loop: boolean;
1640
+ has_branching: boolean;
1641
+ block_types: string[];
1642
+ entry_block_type: string | null;
1643
+ };
1644
+ parameter_roles: {
1645
+ confidence: number;
1646
+ evidence: string[];
1647
+ role: string;
1648
+ slot: string;
1649
+ inferred_type: string;
1650
+ }[];
1651
+ state_roles: {
1652
+ confidence: number;
1653
+ evidence: string[];
1654
+ role: string;
1655
+ state_key: string;
1656
+ }[];
1657
+ struct_inference: {
1658
+ kind: "session" | "context" | "result" | "request" | "table";
1659
+ confidence: number;
1660
+ evidence: string[];
1661
+ semantic_name: string;
1662
+ fields: {
1663
+ name: string;
1664
+ inferred_type: string;
1665
+ source_slot?: string | null | undefined;
1666
+ }[];
1667
+ rewrite_type_name?: string | null | undefined;
1668
+ }[];
1669
+ runtime_context?: {
1670
+ confidence: number;
1671
+ notes: string[];
1672
+ corroborated_apis: string[];
1673
+ corroborated_stages: string[];
1674
+ executed?: boolean | undefined;
1675
+ artifact_count?: number | undefined;
1676
+ executed_artifact_count?: number | undefined;
1677
+ source_names?: string[] | undefined;
1678
+ scope_note?: string | undefined;
1679
+ latest_artifact_at?: string | null | undefined;
1680
+ evidence_sources?: string[] | undefined;
1681
+ matched_memory_regions?: string[] | undefined;
1682
+ suggested_modules?: string[] | undefined;
1683
+ matched_by?: string[] | undefined;
1684
+ provenance_layers?: string[] | undefined;
1685
+ } | null | undefined;
1686
+ } | undefined;
1687
+ name_resolution?: {
1688
+ rule_based_name: string | null;
1689
+ llm_suggested_name: string | null;
1690
+ llm_confidence: number | null;
1691
+ llm_why: string | null;
1692
+ required_assumptions: string[];
1693
+ evidence_used: string[];
1694
+ validated_name: string | null;
1695
+ resolution_source: "hybrid" | "rule" | "llm" | "unresolved";
1696
+ unresolved_semantic_name: boolean;
1697
+ } | undefined;
1698
+ confidence_profile?: {
1699
+ score: number | null;
1700
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1701
+ band: "high" | "none" | "low" | "medium";
1702
+ calibrated: boolean;
1703
+ meaning: string;
1704
+ compare_within: string;
1705
+ caution: string;
1706
+ drivers: string[];
1707
+ acceptance_rule?: string | null | undefined;
1708
+ } | undefined;
1709
+ runtime_confidence_profile?: {
1710
+ score: number | null;
1711
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1712
+ band: "high" | "none" | "low" | "medium";
1713
+ calibrated: boolean;
1714
+ meaning: string;
1715
+ compare_within: string;
1716
+ caution: string;
1717
+ drivers: string[];
1718
+ acceptance_rule?: string | null | undefined;
1719
+ } | null | undefined;
1720
+ naming_confidence_profile?: {
1721
+ score: number | null;
1722
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1723
+ band: "high" | "none" | "low" | "medium";
1724
+ calibrated: boolean;
1725
+ meaning: string;
1726
+ compare_within: string;
1727
+ caution: string;
1728
+ drivers: string[];
1729
+ acceptance_rule?: string | null | undefined;
1730
+ } | undefined;
1731
+ }[];
1732
+ provenance: {
1733
+ runtime: {
1734
+ artifact_count: number;
1735
+ scope_note: string;
1736
+ artifact_ids: string[];
1737
+ session_selector: string | null;
1738
+ session_tags: string[];
1739
+ scope: "all" | "latest" | "session";
1740
+ earliest_artifact_at: string | null;
1741
+ latest_artifact_at: string | null;
1742
+ };
1743
+ semantic_names?: {
1744
+ artifact_count: number;
1745
+ scope_note: string;
1746
+ artifact_ids: string[];
1747
+ session_selector: string | null;
1748
+ session_tags: string[];
1749
+ scope: "all" | "latest" | "session";
1750
+ earliest_artifact_at: string | null;
1751
+ latest_artifact_at: string | null;
1752
+ } | undefined;
1753
+ semantic_explanations?: {
1754
+ artifact_count: number;
1755
+ scope_note: string;
1756
+ artifact_ids: string[];
1757
+ session_selector: string | null;
1758
+ session_tags: string[];
1759
+ scope: "all" | "latest" | "session";
1760
+ earliest_artifact_at: string | null;
1761
+ latest_artifact_at: string | null;
1762
+ } | undefined;
1763
+ };
1764
+ requested_count: number;
1765
+ reconstructed_count: number;
1766
+ overall_confidence: number;
1767
+ confidence_map: {
1768
+ function: string;
1769
+ address: string;
1770
+ gaps: string[];
1771
+ confidence: number;
1772
+ }[];
1773
+ }, {
1774
+ sample_id: string;
1775
+ mode: "topk" | "single";
1776
+ functions: {
1777
+ function: string;
1778
+ address: string;
1779
+ gaps: string[];
1780
+ confidence: number;
1781
+ target: string;
1782
+ evidence: {
1783
+ caller_count: number;
1784
+ callee_count: number;
1785
+ pseudocode_lines: number;
1786
+ cfg_nodes: number;
1787
+ cfg_edges: number;
1788
+ instruction_count: number;
1789
+ };
1790
+ confidence_breakdown: {
1791
+ decompile: number;
1792
+ cfg: number;
1793
+ context: number;
1794
+ assembly: number;
1795
+ };
1796
+ semantic_summary: string;
1797
+ xref_signals: {
1798
+ confidence: number;
1799
+ api: string;
1800
+ evidence: string[];
1801
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
1802
+ }[];
1803
+ call_relationships: {
1804
+ callees: {
1805
+ target: string;
1806
+ relation_types: string[];
1807
+ reference_types: string[];
1808
+ resolved_by: string | null;
1809
+ is_exact: boolean | null;
1810
+ }[];
1811
+ callers: {
1812
+ target: string;
1813
+ relation_types: string[];
1814
+ reference_types: string[];
1815
+ resolved_by: string | null;
1816
+ is_exact: boolean | null;
1817
+ }[];
1818
+ };
1819
+ rank_score: number | null;
1820
+ rank_reasons: string[];
1821
+ call_context: {
1822
+ callees: string[];
1823
+ callers: string[];
1824
+ };
1825
+ behavior_tags: string[];
1826
+ source_like_snippet: string;
1827
+ assembly_excerpt: string;
1828
+ runtime_context?: {
1829
+ confidence: number;
1830
+ notes: string[];
1831
+ corroborated_apis: string[];
1832
+ corroborated_stages: string[];
1833
+ executed?: boolean | undefined;
1834
+ artifact_count?: number | undefined;
1835
+ executed_artifact_count?: number | undefined;
1836
+ source_names?: string[] | undefined;
1837
+ scope_note?: string | undefined;
1838
+ latest_artifact_at?: string | null | undefined;
1839
+ evidence_sources?: string[] | undefined;
1840
+ matched_memory_regions?: string[] | undefined;
1841
+ suggested_modules?: string[] | undefined;
1842
+ matched_by?: string[] | undefined;
1843
+ provenance_layers?: string[] | undefined;
1844
+ } | null | undefined;
1845
+ parameter_roles?: {
1846
+ confidence: number;
1847
+ evidence: string[];
1848
+ role: string;
1849
+ slot: string;
1850
+ inferred_type: string;
1851
+ }[] | undefined;
1852
+ state_roles?: {
1853
+ confidence: number;
1854
+ evidence: string[];
1855
+ role: string;
1856
+ state_key: string;
1857
+ }[] | undefined;
1858
+ struct_inference?: {
1859
+ kind: "session" | "context" | "result" | "request" | "table";
1860
+ confidence: number;
1861
+ evidence: string[];
1862
+ semantic_name: string;
1863
+ fields: {
1864
+ name: string;
1865
+ inferred_type: string;
1866
+ source_slot?: string | null | undefined;
1867
+ }[];
1868
+ rewrite_type_name?: string | null | undefined;
1869
+ }[] | undefined;
1870
+ suggested_name?: string | null | undefined;
1871
+ suggested_role?: string | null | undefined;
1872
+ rename_confidence?: number | null | undefined;
1873
+ rename_evidence?: string[] | undefined;
1874
+ semantic_evidence?: {
1875
+ semantic_summary: string;
1876
+ xref_signals: {
1877
+ confidence: number;
1878
+ api: string;
1879
+ evidence: string[];
1880
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
1881
+ }[];
1882
+ call_relationships: {
1883
+ callees: {
1884
+ target: string;
1885
+ relation_types: string[];
1886
+ reference_types: string[];
1887
+ resolved_by: string | null;
1888
+ is_exact: boolean | null;
1889
+ }[];
1890
+ callers: {
1891
+ target: string;
1892
+ relation_types: string[];
1893
+ reference_types: string[];
1894
+ resolved_by: string | null;
1895
+ is_exact: boolean | null;
1896
+ }[];
1897
+ };
1898
+ string_hints: string[];
1899
+ pseudocode_excerpt: string;
1900
+ cfg_shape: {
1901
+ node_count: number;
1902
+ edge_count: number;
1903
+ has_loop: boolean;
1904
+ has_branching: boolean;
1905
+ block_types: string[];
1906
+ entry_block_type: string | null;
1907
+ };
1908
+ parameter_roles: {
1909
+ confidence: number;
1910
+ evidence: string[];
1911
+ role: string;
1912
+ slot: string;
1913
+ inferred_type: string;
1914
+ }[];
1915
+ state_roles: {
1916
+ confidence: number;
1917
+ evidence: string[];
1918
+ role: string;
1919
+ state_key: string;
1920
+ }[];
1921
+ struct_inference: {
1922
+ kind: "session" | "context" | "result" | "request" | "table";
1923
+ confidence: number;
1924
+ evidence: string[];
1925
+ semantic_name: string;
1926
+ fields: {
1927
+ name: string;
1928
+ inferred_type: string;
1929
+ source_slot?: string | null | undefined;
1930
+ }[];
1931
+ rewrite_type_name?: string | null | undefined;
1932
+ }[];
1933
+ runtime_context?: {
1934
+ confidence: number;
1935
+ notes: string[];
1936
+ corroborated_apis: string[];
1937
+ corroborated_stages: string[];
1938
+ executed?: boolean | undefined;
1939
+ artifact_count?: number | undefined;
1940
+ executed_artifact_count?: number | undefined;
1941
+ source_names?: string[] | undefined;
1942
+ scope_note?: string | undefined;
1943
+ latest_artifact_at?: string | null | undefined;
1944
+ evidence_sources?: string[] | undefined;
1945
+ matched_memory_regions?: string[] | undefined;
1946
+ suggested_modules?: string[] | undefined;
1947
+ matched_by?: string[] | undefined;
1948
+ provenance_layers?: string[] | undefined;
1949
+ } | null | undefined;
1950
+ } | undefined;
1951
+ name_resolution?: {
1952
+ rule_based_name: string | null;
1953
+ llm_suggested_name: string | null;
1954
+ llm_confidence: number | null;
1955
+ llm_why: string | null;
1956
+ required_assumptions: string[];
1957
+ evidence_used: string[];
1958
+ validated_name: string | null;
1959
+ resolution_source: "hybrid" | "rule" | "llm" | "unresolved";
1960
+ unresolved_semantic_name: boolean;
1961
+ } | undefined;
1962
+ confidence_profile?: {
1963
+ score: number | null;
1964
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1965
+ band: "high" | "none" | "low" | "medium";
1966
+ calibrated: boolean;
1967
+ meaning: string;
1968
+ compare_within: string;
1969
+ caution: string;
1970
+ drivers: string[];
1971
+ acceptance_rule?: string | null | undefined;
1972
+ } | undefined;
1973
+ runtime_confidence_profile?: {
1974
+ score: number | null;
1975
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1976
+ band: "high" | "none" | "low" | "medium";
1977
+ calibrated: boolean;
1978
+ meaning: string;
1979
+ compare_within: string;
1980
+ caution: string;
1981
+ drivers: string[];
1982
+ acceptance_rule?: string | null | undefined;
1983
+ } | null | undefined;
1984
+ naming_confidence_profile?: {
1985
+ score: number | null;
1986
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
1987
+ band: "high" | "none" | "low" | "medium";
1988
+ calibrated: boolean;
1989
+ meaning: string;
1990
+ compare_within: string;
1991
+ caution: string;
1992
+ drivers: string[];
1993
+ acceptance_rule?: string | null | undefined;
1994
+ } | undefined;
1995
+ }[];
1996
+ provenance: {
1997
+ runtime: {
1998
+ artifact_count: number;
1999
+ scope_note: string;
2000
+ artifact_ids: string[];
2001
+ session_selector: string | null;
2002
+ session_tags: string[];
2003
+ scope: "all" | "latest" | "session";
2004
+ earliest_artifact_at: string | null;
2005
+ latest_artifact_at: string | null;
2006
+ };
2007
+ semantic_names?: {
2008
+ artifact_count: number;
2009
+ scope_note: string;
2010
+ artifact_ids: string[];
2011
+ session_selector: string | null;
2012
+ session_tags: string[];
2013
+ scope: "all" | "latest" | "session";
2014
+ earliest_artifact_at: string | null;
2015
+ latest_artifact_at: string | null;
2016
+ } | undefined;
2017
+ semantic_explanations?: {
2018
+ artifact_count: number;
2019
+ scope_note: string;
2020
+ artifact_ids: string[];
2021
+ session_selector: string | null;
2022
+ session_tags: string[];
2023
+ scope: "all" | "latest" | "session";
2024
+ earliest_artifact_at: string | null;
2025
+ latest_artifact_at: string | null;
2026
+ } | undefined;
2027
+ };
2028
+ requested_count: number;
2029
+ reconstructed_count: number;
2030
+ overall_confidence: number;
2031
+ confidence_map: {
2032
+ function: string;
2033
+ address: string;
2034
+ gaps: string[];
2035
+ confidence: number;
2036
+ }[];
2037
+ }>>;
2038
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2039
+ errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2040
+ metrics: z.ZodOptional<z.ZodObject<{
2041
+ elapsed_ms: z.ZodNumber;
2042
+ tool: z.ZodString;
2043
+ cached: z.ZodOptional<z.ZodBoolean>;
2044
+ cache_key: z.ZodOptional<z.ZodString>;
2045
+ cache_tier: z.ZodOptional<z.ZodString>;
2046
+ cache_created_at: z.ZodOptional<z.ZodString>;
2047
+ cache_expires_at: z.ZodOptional<z.ZodString>;
2048
+ cache_hit_at: z.ZodOptional<z.ZodString>;
2049
+ }, "strip", z.ZodTypeAny, {
2050
+ elapsed_ms: number;
2051
+ tool: string;
2052
+ cached?: boolean | undefined;
2053
+ cache_key?: string | undefined;
2054
+ cache_tier?: string | undefined;
2055
+ cache_created_at?: string | undefined;
2056
+ cache_expires_at?: string | undefined;
2057
+ cache_hit_at?: string | undefined;
2058
+ }, {
2059
+ elapsed_ms: number;
2060
+ tool: string;
2061
+ cached?: boolean | undefined;
2062
+ cache_key?: string | undefined;
2063
+ cache_tier?: string | undefined;
2064
+ cache_created_at?: string | undefined;
2065
+ cache_expires_at?: string | undefined;
2066
+ cache_hit_at?: string | undefined;
2067
+ }>>;
2068
+ }, "strip", z.ZodTypeAny, {
2069
+ ok: boolean;
2070
+ metrics?: {
2071
+ elapsed_ms: number;
2072
+ tool: string;
2073
+ cached?: boolean | undefined;
2074
+ cache_key?: string | undefined;
2075
+ cache_tier?: string | undefined;
2076
+ cache_created_at?: string | undefined;
2077
+ cache_expires_at?: string | undefined;
2078
+ cache_hit_at?: string | undefined;
2079
+ } | undefined;
2080
+ data?: {
2081
+ sample_id: string;
2082
+ mode: "topk" | "single";
2083
+ functions: {
2084
+ function: string;
2085
+ address: string;
2086
+ gaps: string[];
2087
+ confidence: number;
2088
+ target: string;
2089
+ evidence: {
2090
+ caller_count: number;
2091
+ callee_count: number;
2092
+ pseudocode_lines: number;
2093
+ cfg_nodes: number;
2094
+ cfg_edges: number;
2095
+ instruction_count: number;
2096
+ };
2097
+ confidence_breakdown: {
2098
+ decompile: number;
2099
+ cfg: number;
2100
+ context: number;
2101
+ assembly: number;
2102
+ };
2103
+ semantic_summary: string;
2104
+ xref_signals: {
2105
+ confidence: number;
2106
+ api: string;
2107
+ evidence: string[];
2108
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
2109
+ }[];
2110
+ call_relationships: {
2111
+ callees: {
2112
+ target: string;
2113
+ relation_types: string[];
2114
+ reference_types: string[];
2115
+ resolved_by: string | null;
2116
+ is_exact: boolean | null;
2117
+ }[];
2118
+ callers: {
2119
+ target: string;
2120
+ relation_types: string[];
2121
+ reference_types: string[];
2122
+ resolved_by: string | null;
2123
+ is_exact: boolean | null;
2124
+ }[];
2125
+ };
2126
+ rank_score: number | null;
2127
+ rank_reasons: string[];
2128
+ call_context: {
2129
+ callees: string[];
2130
+ callers: string[];
2131
+ };
2132
+ behavior_tags: string[];
2133
+ source_like_snippet: string;
2134
+ assembly_excerpt: string;
2135
+ runtime_context?: {
2136
+ confidence: number;
2137
+ notes: string[];
2138
+ corroborated_apis: string[];
2139
+ corroborated_stages: string[];
2140
+ executed?: boolean | undefined;
2141
+ artifact_count?: number | undefined;
2142
+ executed_artifact_count?: number | undefined;
2143
+ source_names?: string[] | undefined;
2144
+ scope_note?: string | undefined;
2145
+ latest_artifact_at?: string | null | undefined;
2146
+ evidence_sources?: string[] | undefined;
2147
+ matched_memory_regions?: string[] | undefined;
2148
+ suggested_modules?: string[] | undefined;
2149
+ matched_by?: string[] | undefined;
2150
+ provenance_layers?: string[] | undefined;
2151
+ } | null | undefined;
2152
+ parameter_roles?: {
2153
+ confidence: number;
2154
+ evidence: string[];
2155
+ role: string;
2156
+ slot: string;
2157
+ inferred_type: string;
2158
+ }[] | undefined;
2159
+ state_roles?: {
2160
+ confidence: number;
2161
+ evidence: string[];
2162
+ role: string;
2163
+ state_key: string;
2164
+ }[] | undefined;
2165
+ struct_inference?: {
2166
+ kind: "session" | "context" | "result" | "request" | "table";
2167
+ confidence: number;
2168
+ evidence: string[];
2169
+ semantic_name: string;
2170
+ fields: {
2171
+ name: string;
2172
+ inferred_type: string;
2173
+ source_slot?: string | null | undefined;
2174
+ }[];
2175
+ rewrite_type_name?: string | null | undefined;
2176
+ }[] | undefined;
2177
+ suggested_name?: string | null | undefined;
2178
+ suggested_role?: string | null | undefined;
2179
+ rename_confidence?: number | null | undefined;
2180
+ rename_evidence?: string[] | undefined;
2181
+ semantic_evidence?: {
2182
+ semantic_summary: string;
2183
+ xref_signals: {
2184
+ confidence: number;
2185
+ api: string;
2186
+ evidence: string[];
2187
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
2188
+ }[];
2189
+ call_relationships: {
2190
+ callees: {
2191
+ target: string;
2192
+ relation_types: string[];
2193
+ reference_types: string[];
2194
+ resolved_by: string | null;
2195
+ is_exact: boolean | null;
2196
+ }[];
2197
+ callers: {
2198
+ target: string;
2199
+ relation_types: string[];
2200
+ reference_types: string[];
2201
+ resolved_by: string | null;
2202
+ is_exact: boolean | null;
2203
+ }[];
2204
+ };
2205
+ string_hints: string[];
2206
+ pseudocode_excerpt: string;
2207
+ cfg_shape: {
2208
+ node_count: number;
2209
+ edge_count: number;
2210
+ has_loop: boolean;
2211
+ has_branching: boolean;
2212
+ block_types: string[];
2213
+ entry_block_type: string | null;
2214
+ };
2215
+ parameter_roles: {
2216
+ confidence: number;
2217
+ evidence: string[];
2218
+ role: string;
2219
+ slot: string;
2220
+ inferred_type: string;
2221
+ }[];
2222
+ state_roles: {
2223
+ confidence: number;
2224
+ evidence: string[];
2225
+ role: string;
2226
+ state_key: string;
2227
+ }[];
2228
+ struct_inference: {
2229
+ kind: "session" | "context" | "result" | "request" | "table";
2230
+ confidence: number;
2231
+ evidence: string[];
2232
+ semantic_name: string;
2233
+ fields: {
2234
+ name: string;
2235
+ inferred_type: string;
2236
+ source_slot?: string | null | undefined;
2237
+ }[];
2238
+ rewrite_type_name?: string | null | undefined;
2239
+ }[];
2240
+ runtime_context?: {
2241
+ confidence: number;
2242
+ notes: string[];
2243
+ corroborated_apis: string[];
2244
+ corroborated_stages: string[];
2245
+ executed?: boolean | undefined;
2246
+ artifact_count?: number | undefined;
2247
+ executed_artifact_count?: number | undefined;
2248
+ source_names?: string[] | undefined;
2249
+ scope_note?: string | undefined;
2250
+ latest_artifact_at?: string | null | undefined;
2251
+ evidence_sources?: string[] | undefined;
2252
+ matched_memory_regions?: string[] | undefined;
2253
+ suggested_modules?: string[] | undefined;
2254
+ matched_by?: string[] | undefined;
2255
+ provenance_layers?: string[] | undefined;
2256
+ } | null | undefined;
2257
+ } | undefined;
2258
+ name_resolution?: {
2259
+ rule_based_name: string | null;
2260
+ llm_suggested_name: string | null;
2261
+ llm_confidence: number | null;
2262
+ llm_why: string | null;
2263
+ required_assumptions: string[];
2264
+ evidence_used: string[];
2265
+ validated_name: string | null;
2266
+ resolution_source: "hybrid" | "rule" | "llm" | "unresolved";
2267
+ unresolved_semantic_name: boolean;
2268
+ } | undefined;
2269
+ confidence_profile?: {
2270
+ score: number | null;
2271
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
2272
+ band: "high" | "none" | "low" | "medium";
2273
+ calibrated: boolean;
2274
+ meaning: string;
2275
+ compare_within: string;
2276
+ caution: string;
2277
+ drivers: string[];
2278
+ acceptance_rule?: string | null | undefined;
2279
+ } | undefined;
2280
+ runtime_confidence_profile?: {
2281
+ score: number | null;
2282
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
2283
+ band: "high" | "none" | "low" | "medium";
2284
+ calibrated: boolean;
2285
+ meaning: string;
2286
+ compare_within: string;
2287
+ caution: string;
2288
+ drivers: string[];
2289
+ acceptance_rule?: string | null | undefined;
2290
+ } | null | undefined;
2291
+ naming_confidence_profile?: {
2292
+ score: number | null;
2293
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
2294
+ band: "high" | "none" | "low" | "medium";
2295
+ calibrated: boolean;
2296
+ meaning: string;
2297
+ compare_within: string;
2298
+ caution: string;
2299
+ drivers: string[];
2300
+ acceptance_rule?: string | null | undefined;
2301
+ } | undefined;
2302
+ }[];
2303
+ provenance: {
2304
+ runtime: {
2305
+ artifact_count: number;
2306
+ scope_note: string;
2307
+ artifact_ids: string[];
2308
+ session_selector: string | null;
2309
+ session_tags: string[];
2310
+ scope: "all" | "latest" | "session";
2311
+ earliest_artifact_at: string | null;
2312
+ latest_artifact_at: string | null;
2313
+ };
2314
+ semantic_names?: {
2315
+ artifact_count: number;
2316
+ scope_note: string;
2317
+ artifact_ids: string[];
2318
+ session_selector: string | null;
2319
+ session_tags: string[];
2320
+ scope: "all" | "latest" | "session";
2321
+ earliest_artifact_at: string | null;
2322
+ latest_artifact_at: string | null;
2323
+ } | undefined;
2324
+ semantic_explanations?: {
2325
+ artifact_count: number;
2326
+ scope_note: string;
2327
+ artifact_ids: string[];
2328
+ session_selector: string | null;
2329
+ session_tags: string[];
2330
+ scope: "all" | "latest" | "session";
2331
+ earliest_artifact_at: string | null;
2332
+ latest_artifact_at: string | null;
2333
+ } | undefined;
2334
+ };
2335
+ requested_count: number;
2336
+ reconstructed_count: number;
2337
+ overall_confidence: number;
2338
+ confidence_map: {
2339
+ function: string;
2340
+ address: string;
2341
+ gaps: string[];
2342
+ confidence: number;
2343
+ }[];
2344
+ } | undefined;
2345
+ warnings?: string[] | undefined;
2346
+ errors?: string[] | undefined;
2347
+ }, {
2348
+ ok: boolean;
2349
+ metrics?: {
2350
+ elapsed_ms: number;
2351
+ tool: string;
2352
+ cached?: boolean | undefined;
2353
+ cache_key?: string | undefined;
2354
+ cache_tier?: string | undefined;
2355
+ cache_created_at?: string | undefined;
2356
+ cache_expires_at?: string | undefined;
2357
+ cache_hit_at?: string | undefined;
2358
+ } | undefined;
2359
+ data?: {
2360
+ sample_id: string;
2361
+ mode: "topk" | "single";
2362
+ functions: {
2363
+ function: string;
2364
+ address: string;
2365
+ gaps: string[];
2366
+ confidence: number;
2367
+ target: string;
2368
+ evidence: {
2369
+ caller_count: number;
2370
+ callee_count: number;
2371
+ pseudocode_lines: number;
2372
+ cfg_nodes: number;
2373
+ cfg_edges: number;
2374
+ instruction_count: number;
2375
+ };
2376
+ confidence_breakdown: {
2377
+ decompile: number;
2378
+ cfg: number;
2379
+ context: number;
2380
+ assembly: number;
2381
+ };
2382
+ semantic_summary: string;
2383
+ xref_signals: {
2384
+ confidence: number;
2385
+ api: string;
2386
+ evidence: string[];
2387
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
2388
+ }[];
2389
+ call_relationships: {
2390
+ callees: {
2391
+ target: string;
2392
+ relation_types: string[];
2393
+ reference_types: string[];
2394
+ resolved_by: string | null;
2395
+ is_exact: boolean | null;
2396
+ }[];
2397
+ callers: {
2398
+ target: string;
2399
+ relation_types: string[];
2400
+ reference_types: string[];
2401
+ resolved_by: string | null;
2402
+ is_exact: boolean | null;
2403
+ }[];
2404
+ };
2405
+ rank_score: number | null;
2406
+ rank_reasons: string[];
2407
+ call_context: {
2408
+ callees: string[];
2409
+ callers: string[];
2410
+ };
2411
+ behavior_tags: string[];
2412
+ source_like_snippet: string;
2413
+ assembly_excerpt: string;
2414
+ runtime_context?: {
2415
+ confidence: number;
2416
+ notes: string[];
2417
+ corroborated_apis: string[];
2418
+ corroborated_stages: string[];
2419
+ executed?: boolean | undefined;
2420
+ artifact_count?: number | undefined;
2421
+ executed_artifact_count?: number | undefined;
2422
+ source_names?: string[] | undefined;
2423
+ scope_note?: string | undefined;
2424
+ latest_artifact_at?: string | null | undefined;
2425
+ evidence_sources?: string[] | undefined;
2426
+ matched_memory_regions?: string[] | undefined;
2427
+ suggested_modules?: string[] | undefined;
2428
+ matched_by?: string[] | undefined;
2429
+ provenance_layers?: string[] | undefined;
2430
+ } | null | undefined;
2431
+ parameter_roles?: {
2432
+ confidence: number;
2433
+ evidence: string[];
2434
+ role: string;
2435
+ slot: string;
2436
+ inferred_type: string;
2437
+ }[] | undefined;
2438
+ state_roles?: {
2439
+ confidence: number;
2440
+ evidence: string[];
2441
+ role: string;
2442
+ state_key: string;
2443
+ }[] | undefined;
2444
+ struct_inference?: {
2445
+ kind: "session" | "context" | "result" | "request" | "table";
2446
+ confidence: number;
2447
+ evidence: string[];
2448
+ semantic_name: string;
2449
+ fields: {
2450
+ name: string;
2451
+ inferred_type: string;
2452
+ source_slot?: string | null | undefined;
2453
+ }[];
2454
+ rewrite_type_name?: string | null | undefined;
2455
+ }[] | undefined;
2456
+ suggested_name?: string | null | undefined;
2457
+ suggested_role?: string | null | undefined;
2458
+ rename_confidence?: number | null | undefined;
2459
+ rename_evidence?: string[] | undefined;
2460
+ semantic_evidence?: {
2461
+ semantic_summary: string;
2462
+ xref_signals: {
2463
+ confidence: number;
2464
+ api: string;
2465
+ evidence: string[];
2466
+ provenance: "unknown" | "static_named_call" | "dynamic_resolution_api" | "dynamic_resolution_helper" | "global_string_hint";
2467
+ }[];
2468
+ call_relationships: {
2469
+ callees: {
2470
+ target: string;
2471
+ relation_types: string[];
2472
+ reference_types: string[];
2473
+ resolved_by: string | null;
2474
+ is_exact: boolean | null;
2475
+ }[];
2476
+ callers: {
2477
+ target: string;
2478
+ relation_types: string[];
2479
+ reference_types: string[];
2480
+ resolved_by: string | null;
2481
+ is_exact: boolean | null;
2482
+ }[];
2483
+ };
2484
+ string_hints: string[];
2485
+ pseudocode_excerpt: string;
2486
+ cfg_shape: {
2487
+ node_count: number;
2488
+ edge_count: number;
2489
+ has_loop: boolean;
2490
+ has_branching: boolean;
2491
+ block_types: string[];
2492
+ entry_block_type: string | null;
2493
+ };
2494
+ parameter_roles: {
2495
+ confidence: number;
2496
+ evidence: string[];
2497
+ role: string;
2498
+ slot: string;
2499
+ inferred_type: string;
2500
+ }[];
2501
+ state_roles: {
2502
+ confidence: number;
2503
+ evidence: string[];
2504
+ role: string;
2505
+ state_key: string;
2506
+ }[];
2507
+ struct_inference: {
2508
+ kind: "session" | "context" | "result" | "request" | "table";
2509
+ confidence: number;
2510
+ evidence: string[];
2511
+ semantic_name: string;
2512
+ fields: {
2513
+ name: string;
2514
+ inferred_type: string;
2515
+ source_slot?: string | null | undefined;
2516
+ }[];
2517
+ rewrite_type_name?: string | null | undefined;
2518
+ }[];
2519
+ runtime_context?: {
2520
+ confidence: number;
2521
+ notes: string[];
2522
+ corroborated_apis: string[];
2523
+ corroborated_stages: string[];
2524
+ executed?: boolean | undefined;
2525
+ artifact_count?: number | undefined;
2526
+ executed_artifact_count?: number | undefined;
2527
+ source_names?: string[] | undefined;
2528
+ scope_note?: string | undefined;
2529
+ latest_artifact_at?: string | null | undefined;
2530
+ evidence_sources?: string[] | undefined;
2531
+ matched_memory_regions?: string[] | undefined;
2532
+ suggested_modules?: string[] | undefined;
2533
+ matched_by?: string[] | undefined;
2534
+ provenance_layers?: string[] | undefined;
2535
+ } | null | undefined;
2536
+ } | undefined;
2537
+ name_resolution?: {
2538
+ rule_based_name: string | null;
2539
+ llm_suggested_name: string | null;
2540
+ llm_confidence: number | null;
2541
+ llm_why: string | null;
2542
+ required_assumptions: string[];
2543
+ evidence_used: string[];
2544
+ validated_name: string | null;
2545
+ resolution_source: "hybrid" | "rule" | "llm" | "unresolved";
2546
+ unresolved_semantic_name: boolean;
2547
+ } | undefined;
2548
+ confidence_profile?: {
2549
+ score: number | null;
2550
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
2551
+ band: "high" | "none" | "low" | "medium";
2552
+ calibrated: boolean;
2553
+ meaning: string;
2554
+ compare_within: string;
2555
+ caution: string;
2556
+ drivers: string[];
2557
+ acceptance_rule?: string | null | undefined;
2558
+ } | undefined;
2559
+ runtime_confidence_profile?: {
2560
+ score: number | null;
2561
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
2562
+ band: "high" | "none" | "low" | "medium";
2563
+ calibrated: boolean;
2564
+ meaning: string;
2565
+ compare_within: string;
2566
+ caution: string;
2567
+ drivers: string[];
2568
+ acceptance_rule?: string | null | undefined;
2569
+ } | null | undefined;
2570
+ naming_confidence_profile?: {
2571
+ score: number | null;
2572
+ score_kind: "heuristic_reconstruction" | "runtime_correlation" | "naming_resolution" | "report_assessment";
2573
+ band: "high" | "none" | "low" | "medium";
2574
+ calibrated: boolean;
2575
+ meaning: string;
2576
+ compare_within: string;
2577
+ caution: string;
2578
+ drivers: string[];
2579
+ acceptance_rule?: string | null | undefined;
2580
+ } | undefined;
2581
+ }[];
2582
+ provenance: {
2583
+ runtime: {
2584
+ artifact_count: number;
2585
+ scope_note: string;
2586
+ artifact_ids: string[];
2587
+ session_selector: string | null;
2588
+ session_tags: string[];
2589
+ scope: "all" | "latest" | "session";
2590
+ earliest_artifact_at: string | null;
2591
+ latest_artifact_at: string | null;
2592
+ };
2593
+ semantic_names?: {
2594
+ artifact_count: number;
2595
+ scope_note: string;
2596
+ artifact_ids: string[];
2597
+ session_selector: string | null;
2598
+ session_tags: string[];
2599
+ scope: "all" | "latest" | "session";
2600
+ earliest_artifact_at: string | null;
2601
+ latest_artifact_at: string | null;
2602
+ } | undefined;
2603
+ semantic_explanations?: {
2604
+ artifact_count: number;
2605
+ scope_note: string;
2606
+ artifact_ids: string[];
2607
+ session_selector: string | null;
2608
+ session_tags: string[];
2609
+ scope: "all" | "latest" | "session";
2610
+ earliest_artifact_at: string | null;
2611
+ latest_artifact_at: string | null;
2612
+ } | undefined;
2613
+ };
2614
+ requested_count: number;
2615
+ reconstructed_count: number;
2616
+ overall_confidence: number;
2617
+ confidence_map: {
2618
+ function: string;
2619
+ address: string;
2620
+ gaps: string[];
2621
+ confidence: number;
2622
+ }[];
2623
+ } | undefined;
2624
+ warnings?: string[] | undefined;
2625
+ errors?: string[] | undefined;
2626
+ }>;
2627
+ export type CodeFunctionsReconstructOutput = z.infer<typeof CodeFunctionsReconstructOutputSchema>;
2628
+ export declare const codeFunctionsReconstructToolDefinition: ToolDefinition;
2629
+ interface CodeFunctionsReconstructDependencies {
2630
+ rankFunctions?: (sampleId: string, topK: number) => Promise<RankedFunction[]>;
2631
+ decompileFunction?: (sampleId: string, addressOrSymbol: string, includeXrefs: boolean, timeoutMs: number) => Promise<DecompiledFunction>;
2632
+ getFunctionCFG?: (sampleId: string, addressOrSymbol: string, timeoutMs: number) => Promise<ControlFlowGraph>;
2633
+ runtimeEvidenceLoader?: (sampleId: string, options?: {
2634
+ evidenceScope?: 'all' | 'latest' | 'session';
2635
+ sessionTag?: string;
2636
+ }) => Promise<DynamicTraceSummary | null>;
2637
+ stringEvidenceLoader?: (sampleId: string) => Promise<SampleStringEvidence | null>;
2638
+ semanticNameSuggester?: (evidencePack: SemanticEvidencePack) => Promise<ConstrainedSemanticNameSuggestion | null>;
2639
+ externalSemanticSuggestionLoader?: (sampleId: string, options?: {
2640
+ scope?: 'all' | 'latest' | 'session';
2641
+ sessionTag?: string;
2642
+ }) => Promise<SemanticNameSuggestionIndex | null>;
2643
+ }
2644
+ interface SampleStringValue {
2645
+ offset: number;
2646
+ string: string;
2647
+ encoding?: string;
2648
+ categories?: string[];
2649
+ }
2650
+ interface SampleStringContextWindow {
2651
+ start_offset: number;
2652
+ end_offset: number;
2653
+ score: number;
2654
+ categories: string[];
2655
+ strings: SampleStringValue[];
2656
+ }
2657
+ interface SampleStringEvidence {
2658
+ top_high_value: SampleStringValue[];
2659
+ context_windows: SampleStringContextWindow[];
2660
+ }
2661
+ interface SemanticEvidencePack {
2662
+ function_name: string;
2663
+ address: string;
2664
+ semantic_summary: string;
2665
+ xref_signals: FunctionXrefSummary[];
2666
+ call_relationships: RelationshipContext;
2667
+ runtime_context: ReturnType<typeof correlateFunctionWithRuntimeEvidence> | undefined;
2668
+ string_hints: string[];
2669
+ pseudocode_excerpt: string;
2670
+ cfg_shape: {
2671
+ node_count: number;
2672
+ edge_count: number;
2673
+ has_loop: boolean;
2674
+ has_branching: boolean;
2675
+ block_types: string[];
2676
+ entry_block_type: string | null;
2677
+ };
2678
+ parameter_roles: Array<{
2679
+ slot: string;
2680
+ role: string;
2681
+ inferred_type: string;
2682
+ confidence: number;
2683
+ evidence: string[];
2684
+ }>;
2685
+ state_roles: Array<{
2686
+ state_key: string;
2687
+ role: string;
2688
+ confidence: number;
2689
+ evidence: string[];
2690
+ }>;
2691
+ struct_inference: Array<{
2692
+ semantic_name: string;
2693
+ rewrite_type_name?: string | null;
2694
+ kind: 'request' | 'result' | 'context' | 'table' | 'session';
2695
+ confidence: number;
2696
+ fields: Array<{
2697
+ name: string;
2698
+ inferred_type: string;
2699
+ source_slot?: string | null;
2700
+ }>;
2701
+ evidence: string[];
2702
+ }>;
2703
+ }
2704
+ interface ConstrainedSemanticNameSuggestion {
2705
+ candidate_name: string;
2706
+ confidence: number;
2707
+ why: string;
2708
+ required_assumptions: string[];
2709
+ evidence_used: string[];
2710
+ }
2711
+ interface RelationshipSummaryEntry {
2712
+ target: string;
2713
+ relation_types: string[];
2714
+ reference_types: string[];
2715
+ resolved_by: string | null;
2716
+ is_exact: boolean | null;
2717
+ }
2718
+ interface RelationshipContext {
2719
+ callers: RelationshipSummaryEntry[];
2720
+ callees: RelationshipSummaryEntry[];
2721
+ }
2722
+ export declare function buildDefaultSemanticNameSuggestion(evidencePack: SemanticEvidencePack): ConstrainedSemanticNameSuggestion | null;
2723
+ export declare function createCodeFunctionsReconstructHandler(workspaceManager: WorkspaceManager, database: DatabaseManager, cacheManager: CacheManager, dependencies?: CodeFunctionsReconstructDependencies): (args: ToolArgs) => Promise<WorkerResult>;
2724
+ export {};
2725
+ //# sourceMappingURL=code-functions-reconstruct.d.ts.map