@mirnoorata/codexa 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +634 -0
  3. package/dist/artifacts.d.ts +2 -0
  4. package/dist/artifacts.js +375 -0
  5. package/dist/artifacts.js.map +1 -0
  6. package/dist/autonomy.d.ts +17 -0
  7. package/dist/autonomy.js +124 -0
  8. package/dist/autonomy.js.map +1 -0
  9. package/dist/autoverify/policy.d.ts +5 -0
  10. package/dist/autoverify/policy.js +18 -0
  11. package/dist/autoverify/policy.js.map +1 -0
  12. package/dist/autoverify.d.ts +45 -0
  13. package/dist/autoverify.js +1041 -0
  14. package/dist/autoverify.js.map +1 -0
  15. package/dist/cache-lock.d.ts +16 -0
  16. package/dist/cache-lock.js +181 -0
  17. package/dist/cache-lock.js.map +1 -0
  18. package/dist/cli/hooks.d.ts +5 -0
  19. package/dist/cli/hooks.js +264 -0
  20. package/dist/cli/hooks.js.map +1 -0
  21. package/dist/cli.d.ts +2 -0
  22. package/dist/cli.js +1034 -0
  23. package/dist/cli.js.map +1 -0
  24. package/dist/codex-contract.d.ts +2 -0
  25. package/dist/codex-contract.js +78 -0
  26. package/dist/codex-contract.js.map +1 -0
  27. package/dist/command.d.ts +34 -0
  28. package/dist/command.js +162 -0
  29. package/dist/command.js.map +1 -0
  30. package/dist/doctor.d.ts +112 -0
  31. package/dist/doctor.js +518 -0
  32. package/dist/doctor.js.map +1 -0
  33. package/dist/eval/baseline.d.ts +7 -0
  34. package/dist/eval/baseline.js +146 -0
  35. package/dist/eval/baseline.js.map +1 -0
  36. package/dist/eval/historical.d.ts +4 -0
  37. package/dist/eval/historical.js +663 -0
  38. package/dist/eval/historical.js.map +1 -0
  39. package/dist/eval/render.d.ts +2 -0
  40. package/dist/eval/render.js +53 -0
  41. package/dist/eval/render.js.map +1 -0
  42. package/dist/eval/scoring.d.ts +21 -0
  43. package/dist/eval/scoring.js +618 -0
  44. package/dist/eval/scoring.js.map +1 -0
  45. package/dist/eval/synthetic.d.ts +36 -0
  46. package/dist/eval/synthetic.js +107 -0
  47. package/dist/eval/synthetic.js.map +1 -0
  48. package/dist/eval/types.d.ts +36 -0
  49. package/dist/eval/types.js +2 -0
  50. package/dist/eval/types.js.map +1 -0
  51. package/dist/eval.d.ts +140 -0
  52. package/dist/eval.js +551 -0
  53. package/dist/eval.js.map +1 -0
  54. package/dist/git.d.ts +17 -0
  55. package/dist/git.js +189 -0
  56. package/dist/git.js.map +1 -0
  57. package/dist/github-release.d.ts +47 -0
  58. package/dist/github-release.js +610 -0
  59. package/dist/github-release.js.map +1 -0
  60. package/dist/github-sync.d.ts +68 -0
  61. package/dist/github-sync.js +345 -0
  62. package/dist/github-sync.js.map +1 -0
  63. package/dist/graph.d.ts +10 -0
  64. package/dist/graph.js +665 -0
  65. package/dist/graph.js.map +1 -0
  66. package/dist/indexer/aliases.d.ts +2 -0
  67. package/dist/indexer/aliases.js +190 -0
  68. package/dist/indexer/aliases.js.map +1 -0
  69. package/dist/indexer/artifact-writing.d.ts +3 -0
  70. package/dist/indexer/artifact-writing.js +79 -0
  71. package/dist/indexer/artifact-writing.js.map +1 -0
  72. package/dist/indexer/discovery.d.ts +2 -0
  73. package/dist/indexer/discovery.js +5 -0
  74. package/dist/indexer/discovery.js.map +1 -0
  75. package/dist/indexer/external-facts.d.ts +6 -0
  76. package/dist/indexer/external-facts.js +45 -0
  77. package/dist/indexer/external-facts.js.map +1 -0
  78. package/dist/indexer/freshness.d.ts +8 -0
  79. package/dist/indexer/freshness.js +56 -0
  80. package/dist/indexer/freshness.js.map +1 -0
  81. package/dist/indexer/graph-stage.d.ts +2 -0
  82. package/dist/indexer/graph-stage.js +21 -0
  83. package/dist/indexer/graph-stage.js.map +1 -0
  84. package/dist/indexer/parsing.d.ts +30 -0
  85. package/dist/indexer/parsing.js +177 -0
  86. package/dist/indexer/parsing.js.map +1 -0
  87. package/dist/indexer/pipeline.d.ts +5 -0
  88. package/dist/indexer/pipeline.js +8 -0
  89. package/dist/indexer/pipeline.js.map +1 -0
  90. package/dist/indexer/ranking.d.ts +4 -0
  91. package/dist/indexer/ranking.js +134 -0
  92. package/dist/indexer/ranking.js.map +1 -0
  93. package/dist/indexer.d.ts +13 -0
  94. package/dist/indexer.js +395 -0
  95. package/dist/indexer.js.map +1 -0
  96. package/dist/init.d.ts +24 -0
  97. package/dist/init.js +566 -0
  98. package/dist/init.js.map +1 -0
  99. package/dist/language.d.ts +8 -0
  100. package/dist/language.js +123 -0
  101. package/dist/language.js.map +1 -0
  102. package/dist/live-index.d.ts +68 -0
  103. package/dist/live-index.js +215 -0
  104. package/dist/live-index.js.map +1 -0
  105. package/dist/lsp/assist.d.ts +44 -0
  106. package/dist/lsp/assist.js +331 -0
  107. package/dist/lsp/assist.js.map +1 -0
  108. package/dist/lsp/client.d.ts +59 -0
  109. package/dist/lsp/client.js +208 -0
  110. package/dist/lsp/client.js.map +1 -0
  111. package/dist/mcp/compaction.d.ts +15 -0
  112. package/dist/mcp/compaction.js +1249 -0
  113. package/dist/mcp/compaction.js.map +1 -0
  114. package/dist/mcp/envelope.d.ts +44 -0
  115. package/dist/mcp/envelope.js +425 -0
  116. package/dist/mcp/envelope.js.map +1 -0
  117. package/dist/mcp/prompts.d.ts +2 -0
  118. package/dist/mcp/prompts.js +109 -0
  119. package/dist/mcp/prompts.js.map +1 -0
  120. package/dist/mcp/resources.d.ts +2 -0
  121. package/dist/mcp/resources.js +132 -0
  122. package/dist/mcp/resources.js.map +1 -0
  123. package/dist/mcp/runtime.d.ts +15 -0
  124. package/dist/mcp/runtime.js +122 -0
  125. package/dist/mcp/runtime.js.map +1 -0
  126. package/dist/mcp/session-memory.d.ts +3 -0
  127. package/dist/mcp/session-memory.js +61 -0
  128. package/dist/mcp/session-memory.js.map +1 -0
  129. package/dist/mcp/tool-registry.d.ts +269 -0
  130. package/dist/mcp/tool-registry.js +284 -0
  131. package/dist/mcp/tool-registry.js.map +1 -0
  132. package/dist/mcp/tools.d.ts +53 -0
  133. package/dist/mcp/tools.js +372 -0
  134. package/dist/mcp/tools.js.map +1 -0
  135. package/dist/mcp-repo-root.d.ts +16 -0
  136. package/dist/mcp-repo-root.js +322 -0
  137. package/dist/mcp-repo-root.js.map +1 -0
  138. package/dist/mcp-tool-catalog.d.ts +2 -0
  139. package/dist/mcp-tool-catalog.js +2 -0
  140. package/dist/mcp-tool-catalog.js.map +1 -0
  141. package/dist/mcp.d.ts +11 -0
  142. package/dist/mcp.js +332 -0
  143. package/dist/mcp.js.map +1 -0
  144. package/dist/outcome-ranking.d.ts +5 -0
  145. package/dist/outcome-ranking.js +115 -0
  146. package/dist/outcome-ranking.js.map +1 -0
  147. package/dist/parser/context.d.ts +28 -0
  148. package/dist/parser/context.js +2 -0
  149. package/dist/parser/context.js.map +1 -0
  150. package/dist/parser/ecma.d.ts +5 -0
  151. package/dist/parser/ecma.js +388 -0
  152. package/dist/parser/ecma.js.map +1 -0
  153. package/dist/parser/facts.d.ts +12 -0
  154. package/dist/parser/facts.js +137 -0
  155. package/dist/parser/facts.js.map +1 -0
  156. package/dist/parser/json.d.ts +3 -0
  157. package/dist/parser/json.js +318 -0
  158. package/dist/parser/json.js.map +1 -0
  159. package/dist/parser/markdown.d.ts +3 -0
  160. package/dist/parser/markdown.js +180 -0
  161. package/dist/parser/markdown.js.map +1 -0
  162. package/dist/parser/nodes.d.ts +5 -0
  163. package/dist/parser/nodes.js +75 -0
  164. package/dist/parser/nodes.js.map +1 -0
  165. package/dist/parser/python.d.ts +2 -0
  166. package/dist/parser/python.js +307 -0
  167. package/dist/parser/python.js.map +1 -0
  168. package/dist/parser/references.d.ts +3 -0
  169. package/dist/parser/references.js +204 -0
  170. package/dist/parser/references.js.map +1 -0
  171. package/dist/parser/risks.d.ts +4 -0
  172. package/dist/parser/risks.js +62 -0
  173. package/dist/parser/risks.js.map +1 -0
  174. package/dist/parser/routes.d.ts +5 -0
  175. package/dist/parser/routes.js +97 -0
  176. package/dist/parser/routes.js.map +1 -0
  177. package/dist/parser/shallow.d.ts +3 -0
  178. package/dist/parser/shallow.js +545 -0
  179. package/dist/parser/shallow.js.map +1 -0
  180. package/dist/parser/source.d.ts +4 -0
  181. package/dist/parser/source.js +127 -0
  182. package/dist/parser/source.js.map +1 -0
  183. package/dist/parser.d.ts +2 -0
  184. package/dist/parser.js +2 -0
  185. package/dist/parser.js.map +1 -0
  186. package/dist/placeholder-signals.d.ts +15 -0
  187. package/dist/placeholder-signals.js +511 -0
  188. package/dist/placeholder-signals.js.map +1 -0
  189. package/dist/post-edit-outcomes.d.ts +167 -0
  190. package/dist/post-edit-outcomes.js +484 -0
  191. package/dist/post-edit-outcomes.js.map +1 -0
  192. package/dist/queries.d.ts +12 -0
  193. package/dist/queries.js +13 -0
  194. package/dist/queries.js.map +1 -0
  195. package/dist/query/change-plan.d.ts +48 -0
  196. package/dist/query/change-plan.js +858 -0
  197. package/dist/query/change-plan.js.map +1 -0
  198. package/dist/query/compact-data.d.ts +25 -0
  199. package/dist/query/compact-data.js +74 -0
  200. package/dist/query/compact-data.js.map +1 -0
  201. package/dist/query/context.d.ts +5 -0
  202. package/dist/query/context.js +1162 -0
  203. package/dist/query/context.js.map +1 -0
  204. package/dist/query/diff.d.ts +5 -0
  205. package/dist/query/diff.js +111 -0
  206. package/dist/query/diff.js.map +1 -0
  207. package/dist/query/edge-evidence.d.ts +3 -0
  208. package/dist/query/edge-evidence.js +36 -0
  209. package/dist/query/edge-evidence.js.map +1 -0
  210. package/dist/query/formatting.d.ts +14 -0
  211. package/dist/query/formatting.js +67 -0
  212. package/dist/query/formatting.js.map +1 -0
  213. package/dist/query/graph-traversal.d.ts +22 -0
  214. package/dist/query/graph-traversal.js +218 -0
  215. package/dist/query/graph-traversal.js.map +1 -0
  216. package/dist/query/graph.d.ts +14 -0
  217. package/dist/query/graph.js +102 -0
  218. package/dist/query/graph.js.map +1 -0
  219. package/dist/query/impact.d.ts +28 -0
  220. package/dist/query/impact.js +568 -0
  221. package/dist/query/impact.js.map +1 -0
  222. package/dist/query/inspection.d.ts +9 -0
  223. package/dist/query/inspection.js +290 -0
  224. package/dist/query/inspection.js.map +1 -0
  225. package/dist/query/next-tools.d.ts +3 -0
  226. package/dist/query/next-tools.js +25 -0
  227. package/dist/query/next-tools.js.map +1 -0
  228. package/dist/query/placeholders.d.ts +24 -0
  229. package/dist/query/placeholders.js +121 -0
  230. package/dist/query/placeholders.js.map +1 -0
  231. package/dist/query/post-edit/decision.d.ts +49 -0
  232. package/dist/query/post-edit/decision.js +130 -0
  233. package/dist/query/post-edit/decision.js.map +1 -0
  234. package/dist/query/post-edit/dirty-scope.d.ts +16 -0
  235. package/dist/query/post-edit/dirty-scope.js +21 -0
  236. package/dist/query/post-edit/dirty-scope.js.map +1 -0
  237. package/dist/query/post-edit/next-actions.d.ts +22 -0
  238. package/dist/query/post-edit/next-actions.js +44 -0
  239. package/dist/query/post-edit/next-actions.js.map +1 -0
  240. package/dist/query/post-edit/snapshot-contract.d.ts +8 -0
  241. package/dist/query/post-edit/snapshot-contract.js +111 -0
  242. package/dist/query/post-edit/snapshot-contract.js.map +1 -0
  243. package/dist/query/post-edit.d.ts +5 -0
  244. package/dist/query/post-edit.js +1108 -0
  245. package/dist/query/post-edit.js.map +1 -0
  246. package/dist/query/quality.d.ts +43 -0
  247. package/dist/query/quality.js +134 -0
  248. package/dist/query/quality.js.map +1 -0
  249. package/dist/query/raw-search.d.ts +23 -0
  250. package/dist/query/raw-search.js +147 -0
  251. package/dist/query/raw-search.js.map +1 -0
  252. package/dist/query/runtime.d.ts +11 -0
  253. package/dist/query/runtime.js +79 -0
  254. package/dist/query/runtime.js.map +1 -0
  255. package/dist/query/search.d.ts +25 -0
  256. package/dist/query/search.js +429 -0
  257. package/dist/query/search.js.map +1 -0
  258. package/dist/query/session-memory.d.ts +3 -0
  259. package/dist/query/session-memory.js +108 -0
  260. package/dist/query/session-memory.js.map +1 -0
  261. package/dist/query/session.d.ts +41 -0
  262. package/dist/query/session.js +90 -0
  263. package/dist/query/session.js.map +1 -0
  264. package/dist/query/targets.d.ts +25 -0
  265. package/dist/query/targets.js +97 -0
  266. package/dist/query/targets.js.map +1 -0
  267. package/dist/query/test-commands.d.ts +10 -0
  268. package/dist/query/test-commands.js +110 -0
  269. package/dist/query/test-commands.js.map +1 -0
  270. package/dist/query/test-plan.d.ts +6 -0
  271. package/dist/query/test-plan.js +104 -0
  272. package/dist/query/test-plan.js.map +1 -0
  273. package/dist/query/tests.d.ts +48 -0
  274. package/dist/query/tests.js +444 -0
  275. package/dist/query/tests.js.map +1 -0
  276. package/dist/query/verification/shell.d.ts +20 -0
  277. package/dist/query/verification/shell.js +164 -0
  278. package/dist/query/verification/shell.js.map +1 -0
  279. package/dist/query/verification.d.ts +47 -0
  280. package/dist/query/verification.js +1123 -0
  281. package/dist/query/verification.js.map +1 -0
  282. package/dist/query/workflow.d.ts +17 -0
  283. package/dist/query/workflow.js +252 -0
  284. package/dist/query/workflow.js.map +1 -0
  285. package/dist/query/workspace-guidance.d.ts +26 -0
  286. package/dist/query/workspace-guidance.js +214 -0
  287. package/dist/query/workspace-guidance.js.map +1 -0
  288. package/dist/query/worktree-state.d.ts +22 -0
  289. package/dist/query/worktree-state.js +32 -0
  290. package/dist/query/worktree-state.js.map +1 -0
  291. package/dist/query/worktree.d.ts +16 -0
  292. package/dist/query/worktree.js +194 -0
  293. package/dist/query/worktree.js.map +1 -0
  294. package/dist/query-data.d.ts +4 -0
  295. package/dist/query-data.js +112 -0
  296. package/dist/query-data.js.map +1 -0
  297. package/dist/repo-files.d.ts +24 -0
  298. package/dist/repo-files.js +105 -0
  299. package/dist/repo-files.js.map +1 -0
  300. package/dist/resolver.d.ts +9 -0
  301. package/dist/resolver.js +555 -0
  302. package/dist/resolver.js.map +1 -0
  303. package/dist/retrieval.d.ts +46 -0
  304. package/dist/retrieval.js +783 -0
  305. package/dist/retrieval.js.map +1 -0
  306. package/dist/risk-ingest.d.ts +16 -0
  307. package/dist/risk-ingest.js +458 -0
  308. package/dist/risk-ingest.js.map +1 -0
  309. package/dist/rules.d.ts +10 -0
  310. package/dist/rules.js +107 -0
  311. package/dist/rules.js.map +1 -0
  312. package/dist/semantic/python.d.ts +9 -0
  313. package/dist/semantic/python.js +817 -0
  314. package/dist/semantic/python.js.map +1 -0
  315. package/dist/semantic/typescript.d.ts +10 -0
  316. package/dist/semantic/typescript.js +714 -0
  317. package/dist/semantic/typescript.js.map +1 -0
  318. package/dist/semantic-retrieval.d.ts +53 -0
  319. package/dist/semantic-retrieval.js +673 -0
  320. package/dist/semantic-retrieval.js.map +1 -0
  321. package/dist/session-memory/derivation.d.ts +6 -0
  322. package/dist/session-memory/derivation.js +400 -0
  323. package/dist/session-memory/derivation.js.map +1 -0
  324. package/dist/session-memory/event-log.d.ts +23 -0
  325. package/dist/session-memory/event-log.js +126 -0
  326. package/dist/session-memory/event-log.js.map +1 -0
  327. package/dist/session-memory/formatting.d.ts +7 -0
  328. package/dist/session-memory/formatting.js +86 -0
  329. package/dist/session-memory/formatting.js.map +1 -0
  330. package/dist/session-memory/model.d.ts +94 -0
  331. package/dist/session-memory/model.js +17 -0
  332. package/dist/session-memory/model.js.map +1 -0
  333. package/dist/session-memory/runtime.d.ts +24 -0
  334. package/dist/session-memory/runtime.js +289 -0
  335. package/dist/session-memory/runtime.js.map +1 -0
  336. package/dist/session-memory/store.d.ts +27 -0
  337. package/dist/session-memory/store.js +447 -0
  338. package/dist/session-memory/store.js.map +1 -0
  339. package/dist/session-memory.d.ts +1 -0
  340. package/dist/session-memory.js +2 -0
  341. package/dist/session-memory.js.map +1 -0
  342. package/dist/static-analysis.d.ts +36 -0
  343. package/dist/static-analysis.js +505 -0
  344. package/dist/static-analysis.js.map +1 -0
  345. package/dist/symbol-report-ingest.d.ts +8 -0
  346. package/dist/symbol-report-ingest.js +504 -0
  347. package/dist/symbol-report-ingest.js.map +1 -0
  348. package/dist/task-snapshots.d.ts +41 -0
  349. package/dist/task-snapshots.js +430 -0
  350. package/dist/task-snapshots.js.map +1 -0
  351. package/dist/types.d.ts +848 -0
  352. package/dist/types.js +12 -0
  353. package/dist/types.js.map +1 -0
  354. package/dist/util.d.ts +11 -0
  355. package/dist/util.js +63 -0
  356. package/dist/util.js.map +1 -0
  357. package/dist/version.d.ts +1 -0
  358. package/dist/version.js +5 -0
  359. package/dist/version.js.map +1 -0
  360. package/package.json +81 -0
  361. package/plugins/codexa/.codex-plugin/plugin.json +38 -0
  362. package/plugins/codexa/.mcp.json +20 -0
  363. package/plugins/codexa/scripts/codexa-mcp.js +100 -0
  364. package/plugins/codexa/skills/codexa/SKILL.md +48 -0
@@ -0,0 +1,848 @@
1
+ export type LanguageId = "typescript" | "javascript" | "python" | "json" | "markdown" | "rust" | "go" | "java" | "csharp" | "cpp" | "c" | "ruby" | "php" | "unknown";
2
+ export type FactSource = "tree-sitter" | "typescript-syntax" | "typescript-compiler" | "git" | "manifest" | "markdown" | "heuristic" | "static-analysis" | "lsp" | "mcp-tool" | "codex-agent" | "codexa-cache";
3
+ export type Confidence = "authoritative" | "derived" | "heuristic";
4
+ export type EvidenceTier = "authoritative" | "derived" | "heuristic" | "fallback";
5
+ export type FactType = "RepoSnapshot" | "File" | "Symbol" | "UsageSite" | "ImportEdge" | "TestEdge" | "GraphEdge" | "WorkflowTrace" | "ModuleCluster" | "RiskSignal" | "ParserError" | "SessionMemoryEntry";
6
+ export type GraphEdgeKind = "DEFINES" | "IMPORTS" | "CALLS" | "REFERENCES" | "TESTS" | "ROUTE" | "JOB" | "RISK" | "ROUTE_HANDLES" | "ROUTE_CALLS_STORE" | "STORE_DISPATCHES_ADAPTER" | "ADAPTER_REFERENCED_BY_MANIFEST" | "UI_CALLS_ENDPOINT" | "TEST_COVERS_WORKFLOW" | "IMPLEMENTS" | "EXTENDS" | "EXPORTS" | "TYPE_EXPORTS";
7
+ export type GraphNodeKind = "file" | "symbol" | "usage" | "test" | "risk" | "workflow" | "endpoint";
8
+ export interface Range {
9
+ startLine: number;
10
+ endLine: number;
11
+ startByte: number;
12
+ endByte: number;
13
+ }
14
+ export interface BaseFact {
15
+ id: string;
16
+ type: FactType;
17
+ path?: string;
18
+ range?: Range;
19
+ source: FactSource;
20
+ confidence: Confidence;
21
+ snapshotId: string;
22
+ indexedAt: string;
23
+ }
24
+ export interface RepoSnapshotFact extends BaseFact {
25
+ type: "RepoSnapshot";
26
+ repoRoot: string;
27
+ gitRoot: string | null;
28
+ headCommit: string | null;
29
+ dirtyFiles: string[];
30
+ }
31
+ export interface FileFact extends BaseFact {
32
+ type: "File";
33
+ path: string;
34
+ language: LanguageId;
35
+ sizeBytes: number;
36
+ dirty: boolean;
37
+ generated: boolean;
38
+ test: boolean;
39
+ rank: number;
40
+ rankReasons: Record<string, number>;
41
+ symbolCount: number;
42
+ usageCount: number;
43
+ importCount: number;
44
+ riskScore: number;
45
+ }
46
+ export interface SymbolFact extends BaseFact {
47
+ type: "Symbol";
48
+ path: string;
49
+ name: string;
50
+ qualifiedName: string;
51
+ kind: "module" | "class" | "interface" | "type" | "enum" | "function" | "method" | "variable" | "route" | "fixture" | "test" | "node" | "unknown";
52
+ language: LanguageId;
53
+ exported: boolean;
54
+ decorators: string[];
55
+ parentSymbolId?: string;
56
+ }
57
+ export interface UsageSiteFact extends BaseFact {
58
+ type: "UsageSite";
59
+ path: string;
60
+ name: string;
61
+ kind: "call" | "import" | "reference" | "type_reference" | "endpoint_reference" | "route_handler" | "test_reference" | "decorator";
62
+ targetSymbolId?: string;
63
+ usedBySymbolId?: string;
64
+ text: string;
65
+ }
66
+ export interface ImportEdgeFact extends BaseFact {
67
+ type: "ImportEdge";
68
+ path: string;
69
+ specifier: string;
70
+ importedName?: string;
71
+ localName?: string;
72
+ reExport?: boolean;
73
+ typeOnly?: boolean;
74
+ resolvedPath?: string;
75
+ }
76
+ export interface TestEdgeFact extends BaseFact {
77
+ type: "TestEdge";
78
+ path: string;
79
+ targetPath?: string;
80
+ reason: string;
81
+ }
82
+ export interface GraphEdgeFact extends BaseFact {
83
+ type: "GraphEdge";
84
+ edgeKind: GraphEdgeKind;
85
+ fromId: string;
86
+ toId: string;
87
+ fromKind: GraphNodeKind;
88
+ toKind: GraphNodeKind;
89
+ fromPath?: string;
90
+ toPath?: string;
91
+ fromSymbolId?: string;
92
+ toSymbolId?: string;
93
+ reason: string;
94
+ weight: number;
95
+ }
96
+ export interface EdgeEvidenceV1 {
97
+ schemaVersion: 1;
98
+ id: string;
99
+ edgeKind: GraphEdgeKind;
100
+ fromId: string;
101
+ toId: string;
102
+ fromPath?: string;
103
+ toPath?: string;
104
+ fromSymbolId?: string;
105
+ toSymbolId?: string;
106
+ source: FactSource;
107
+ confidence: Confidence;
108
+ reason: string;
109
+ range?: Range;
110
+ degraded: boolean;
111
+ stale: boolean;
112
+ }
113
+ export interface CodexaSymbolReportSymbolV1 {
114
+ id?: string;
115
+ name: string;
116
+ qualifiedName?: string;
117
+ kind?: SymbolFact["kind"];
118
+ path: string;
119
+ line?: number;
120
+ endLine?: number;
121
+ exported?: boolean;
122
+ parentId?: string;
123
+ confidence?: Confidence;
124
+ reason?: string;
125
+ }
126
+ export interface CodexaSymbolReportRelationshipV1 {
127
+ kind: Extract<GraphEdgeKind, "DEFINES" | "CALLS" | "REFERENCES" | "IMPORTS" | "IMPLEMENTS" | "EXTENDS" | "EXPORTS" | "TYPE_EXPORTS">;
128
+ fromSymbol?: string;
129
+ fromPath?: string;
130
+ toSymbol?: string;
131
+ toPath?: string;
132
+ line?: number;
133
+ endLine?: number;
134
+ confidence?: Confidence;
135
+ reason?: string;
136
+ }
137
+ export interface CodexaSymbolReportV1 {
138
+ schemaVersion: 1;
139
+ tool: string;
140
+ language: string;
141
+ symbols: CodexaSymbolReportSymbolV1[];
142
+ relationships?: CodexaSymbolReportRelationshipV1[];
143
+ }
144
+ export interface WorkflowStep {
145
+ kind: "entry" | "call" | "reference" | "import" | "risk" | "test" | "endpoint" | "ui" | "store" | "adapter" | "manifest" | "type";
146
+ label: string;
147
+ path: string;
148
+ line?: number;
149
+ symbolId?: string;
150
+ targetSymbolId?: string;
151
+ targetPath?: string;
152
+ confidence: Confidence;
153
+ reason: string;
154
+ }
155
+ export interface WorkflowTraceFact extends BaseFact {
156
+ type: "WorkflowTrace";
157
+ workflowKind: "route" | "job" | "test" | "manifest" | "module";
158
+ title: string;
159
+ entryPath: string;
160
+ entrySymbolId?: string;
161
+ relatedFiles: string[];
162
+ tests: string[];
163
+ steps: WorkflowStep[];
164
+ summary: string;
165
+ rank: number;
166
+ }
167
+ export interface ModuleClusterFact extends BaseFact {
168
+ type: "ModuleCluster";
169
+ name: string;
170
+ files: string[];
171
+ summary: string;
172
+ rank: number;
173
+ }
174
+ export interface RiskSignalFact extends BaseFact {
175
+ type: "RiskSignal";
176
+ path: string;
177
+ signal: string;
178
+ score: number;
179
+ reason: string;
180
+ }
181
+ export interface ParserErrorFact extends BaseFact {
182
+ type: "ParserError";
183
+ path: string;
184
+ message: string;
185
+ }
186
+ export type SessionMemoryKind = "viewed" | "claim" | "ruled_out" | "open_question" | "next_read" | "decision" | "verification" | "risk" | "constraint";
187
+ export type SessionMemoryProvenance = "codexa-derived" | "agent-asserted" | "user-asserted";
188
+ export type SessionMemoryStatus = "active" | "stale" | "superseded" | "rejected" | "resolved";
189
+ export interface SessionMemoryRef {
190
+ kind: "file" | "symbol" | "workflow" | "endpoint" | "test" | "graph_edge" | "outcome" | "snapshot";
191
+ id: string;
192
+ path?: string;
193
+ edgeKind?: GraphEdgeKind;
194
+ fromId?: string;
195
+ toId?: string;
196
+ evidenceTier: EvidenceTier;
197
+ confidence: Confidence;
198
+ }
199
+ export interface SessionMemoryScope {
200
+ files: string[];
201
+ symbols: string[];
202
+ tests: string[];
203
+ workflows: string[];
204
+ topics: string[];
205
+ refs: SessionMemoryRef[];
206
+ }
207
+ export interface SessionMemoryEvidence {
208
+ id: string;
209
+ provenance: SessionMemoryProvenance;
210
+ source: "agent" | "mcp_tool" | "task_snapshot" | "post_edit_outcome" | "hook_event" | "index_fact" | "codexa_cache";
211
+ sourceRef: string;
212
+ toolName?: string;
213
+ callId?: string;
214
+ taskId?: string;
215
+ path?: string;
216
+ range?: Range;
217
+ factType?: FactType;
218
+ edgeKind?: GraphEdgeKind;
219
+ evidenceTier: EvidenceTier;
220
+ confidence: Confidence;
221
+ snapshotId: string;
222
+ indexedAt: string;
223
+ headCommit: string | null;
224
+ note?: string;
225
+ }
226
+ export interface SessionMemoryEntryFact extends BaseFact {
227
+ type: "SessionMemoryEntry";
228
+ sessionId: string;
229
+ taskId?: string;
230
+ kind: SessionMemoryKind;
231
+ key: string;
232
+ summary: string;
233
+ details?: string;
234
+ provenance: SessionMemoryProvenance;
235
+ status: SessionMemoryStatus;
236
+ evidenceTier: EvidenceTier;
237
+ scope: SessionMemoryScope;
238
+ evidence: SessionMemoryEvidence[];
239
+ createdAt: string;
240
+ updatedAt: string;
241
+ supersedes: string[];
242
+ supersededBy?: string;
243
+ staleBecause: string[];
244
+ }
245
+ export interface SessionMemoryStore {
246
+ schemaVersion: 1;
247
+ sessionId: string;
248
+ repoRoot: ".";
249
+ createdAt: string;
250
+ updatedAt: string;
251
+ revision: number;
252
+ activeTaskId?: string;
253
+ entries: SessionMemoryEntryFact[];
254
+ compaction: {
255
+ compactedAt?: string;
256
+ sourceEventCount: number;
257
+ retainedEntryCount: number;
258
+ droppedEntryCount: number;
259
+ };
260
+ }
261
+ export type CodexaFact = RepoSnapshotFact | FileFact | SymbolFact | UsageSiteFact | ImportEdgeFact | TestEdgeFact | GraphEdgeFact | WorkflowTraceFact | ModuleClusterFact | RiskSignalFact | ParserErrorFact;
262
+ export interface FreshnessInfo {
263
+ schemaVersion: 1;
264
+ snapshotId: string;
265
+ repoRoot: string;
266
+ gitRoot: string | null;
267
+ headCommit: string | null;
268
+ indexedAt: string;
269
+ dirtyFiles: string[];
270
+ dirtyFileHashes: Record<string, string>;
271
+ indexedDirtyFileHashes: Record<string, string>;
272
+ indexedDirtyFiles: string[];
273
+ missing: boolean;
274
+ stale: boolean;
275
+ reason: string;
276
+ parserErrorCount: number;
277
+ externalRiskReportHashes?: Record<string, string>;
278
+ indexedExternalRiskReportHashes?: Record<string, string>;
279
+ externalRiskReportDiagnostics?: Array<{
280
+ path: string;
281
+ reason: string;
282
+ sizeBytes?: number;
283
+ limitBytes?: number;
284
+ }>;
285
+ }
286
+ export interface CodexaIndex {
287
+ schemaVersion: 1;
288
+ snapshot: RepoSnapshotFact;
289
+ freshness: FreshnessInfo;
290
+ files: FileFact[];
291
+ symbols: SymbolFact[];
292
+ usageSites: UsageSiteFact[];
293
+ imports: ImportEdgeFact[];
294
+ testEdges: TestEdgeFact[];
295
+ graphEdges: GraphEdgeFact[];
296
+ workflows: WorkflowTraceFact[];
297
+ modules: ModuleClusterFact[];
298
+ risks: RiskSignalFact[];
299
+ parserErrors: ParserErrorFact[];
300
+ }
301
+ export interface ParseResult {
302
+ file: Omit<FileFact, "rank" | "rankReasons" | "riskScore" | "symbolCount" | "usageCount" | "importCount">;
303
+ symbols: SymbolFact[];
304
+ usageSites: UsageSiteFact[];
305
+ imports: ImportEdgeFact[];
306
+ testEdges: TestEdgeFact[];
307
+ risks: RiskSignalFact[];
308
+ parserErrors: ParserErrorFact[];
309
+ }
310
+ export interface IndexOptions {
311
+ repoRoot: string;
312
+ outputDir?: string;
313
+ writeArtifacts?: boolean;
314
+ }
315
+ export interface QueryResult {
316
+ freshness: FreshnessInfo;
317
+ text: string;
318
+ data: unknown;
319
+ refresh?: RefreshInfo;
320
+ }
321
+ export interface RefreshInfo {
322
+ refreshed: boolean;
323
+ reason?: string;
324
+ indexedAt?: string;
325
+ }
326
+ export interface QueryOptions {
327
+ autoRefresh?: boolean;
328
+ sessionMemory?: "auto" | "off";
329
+ commandBudgetMs?: number;
330
+ maxResultBytes?: number;
331
+ maxResults?: number;
332
+ lsp?: boolean;
333
+ lspTimeoutMs?: number;
334
+ lspMaxFiles?: number;
335
+ lspServers?: Partial<Record<LanguageId, {
336
+ command: string;
337
+ args?: string[];
338
+ cwd?: string;
339
+ }>>;
340
+ semantic?: boolean;
341
+ semanticProvider?: "openai" | "local-command";
342
+ semanticModel?: string;
343
+ semanticDimensions?: number;
344
+ semanticCommand?: string;
345
+ semanticArgs?: string[];
346
+ semanticTimeoutMs?: number;
347
+ semanticBatchSize?: number;
348
+ semanticMaxFiles?: number;
349
+ workspaceFocusFile?: string;
350
+ workspaceSessionId?: string;
351
+ }
352
+ export interface GuidedNextToolV1 {
353
+ schemaVersion: 1;
354
+ tool: string;
355
+ reason: string;
356
+ requiredInputs?: Record<string, unknown>;
357
+ readOnly: boolean;
358
+ writes: string[];
359
+ }
360
+ export type QueryPrimitive = string | number | boolean | null;
361
+ export type QueryValue = QueryPrimitive | VerificationProvenance | QueryValue[] | {
362
+ [key: string]: QueryValue | undefined;
363
+ };
364
+ export type QueryObject = {
365
+ [key: string]: QueryValue | undefined;
366
+ };
367
+ export type CompactFileFact = Pick<FileFact, "path" | "language" | "dirty" | "generated" | "test" | "rank" | "symbolCount" | "usageCount" | "importCount" | "riskScore">;
368
+ export type CompactSymbolFact = Pick<SymbolFact, "path" | "name" | "qualifiedName" | "kind" | "language" | "range" | "confidence">;
369
+ export interface CompactChangedSymbol {
370
+ symbol: CompactSymbolFact;
371
+ changedLines: string[];
372
+ }
373
+ export interface CompactDiffImpactGroup extends Omit<DiffImpactGroup, "changedSymbols"> {
374
+ changedSymbols: CompactChangedSymbol[];
375
+ }
376
+ export type ContextSourceKind = "explicit_target" | "natural_retrieval" | "lexical_query" | "dirty_worktree" | "graph_impact" | "workflow_trace" | "test_evidence" | "rank_fallback";
377
+ export interface ContextSourceSummaryData {
378
+ source: ContextSourceKind;
379
+ fileCount: number;
380
+ evidenceTierCounts: Record<EvidenceTier, number>;
381
+ sampleFiles: string[];
382
+ sampleReasons: string[];
383
+ }
384
+ export interface ContextPacketFocusFile {
385
+ file: CompactFileFact;
386
+ reasons: string[];
387
+ rank: number;
388
+ tier: EvidenceTier;
389
+ }
390
+ export interface RetrievalSummaryData extends QueryObject {
391
+ query?: string;
392
+ intents?: string[];
393
+ terms?: string[];
394
+ broad?: boolean;
395
+ matches?: QueryObject[];
396
+ workflows?: QueryObject[];
397
+ modules?: QueryObject[];
398
+ diagnostics?: string[];
399
+ }
400
+ export interface NextCallData extends QueryObject {
401
+ tool?: string;
402
+ reason?: string;
403
+ }
404
+ export interface SnapshotLoadData extends QueryObject {
405
+ latestTaskId?: string;
406
+ missingReason?: string;
407
+ error?: string;
408
+ ambiguousLatest?: boolean;
409
+ ambiguityReason?: string;
410
+ }
411
+ export interface PostEditOutcomeData extends QueryObject {
412
+ schemaVersion?: 1;
413
+ outcomeId?: string;
414
+ persisted?: boolean;
415
+ verdict?: string;
416
+ inspectMode?: "none" | "advisory" | "blocking";
417
+ inspectReasons?: string[];
418
+ completionAuthority?: "complete" | "tests_required" | "advisory_inspect" | "blocking_inspect" | "replan_required";
419
+ path?: string;
420
+ driftReasons?: string[];
421
+ ranTests?: string[];
422
+ ranCommands?: string[];
423
+ verificationProvenance?: VerificationProvenance;
424
+ }
425
+ export type QueryResultMode = "context_pack" | "task_brief" | "focus_brief" | "session_context" | "change_plan" | "post_edit_review" | "test_plan" | "repo_map" | "search" | "find_context" | "symbol_context" | "impact" | "diff_impact" | "callers" | "callees" | "dependency_path" | "workflow_path" | "placeholder_report" | "session_memory" | "freshness";
426
+ export interface BaseQueryData {
427
+ mode: QueryResultMode;
428
+ task?: string;
429
+ quality?: QueryObject;
430
+ worktree?: QueryObject;
431
+ worktreeDegradationReasons?: string[];
432
+ gaps?: string[];
433
+ warnings?: string[];
434
+ diagnostics?: string[];
435
+ nextTools?: Array<GuidedNextToolV1 | string>;
436
+ systemMessage?: string;
437
+ sessionMemory?: QueryObject;
438
+ workspaceGuidance?: QueryObject;
439
+ priorSessionMemory?: QueryObject;
440
+ runtime?: QueryObject;
441
+ session?: QueryObject;
442
+ truncation?: Record<string, {
443
+ total: number;
444
+ returned: number;
445
+ }>;
446
+ verificationProvenance?: VerificationProvenance;
447
+ }
448
+ export interface ContextPacketData extends BaseQueryData {
449
+ mode: "context_pack" | "task_brief";
450
+ changeType?: ChangeType;
451
+ actionability?: string;
452
+ tokenBudget?: number;
453
+ packetVerdict?: string;
454
+ focusFiles?: ContextPacketFocusFile[];
455
+ changedFiles?: string[];
456
+ changedEntries?: ChangedFileEntry[];
457
+ changedSymbols?: CompactChangedSymbol[];
458
+ unindexedChanged?: string[];
459
+ groups?: CompactDiffImpactGroup[];
460
+ tests?: TestRecommendation[];
461
+ snippets?: string[];
462
+ contextSources?: ContextSourceSummaryData[];
463
+ nextReads?: string[];
464
+ baseline?: QueryObject;
465
+ retrieval?: RetrievalSummaryData;
466
+ recipes?: string[];
467
+ verificationCommands?: string[];
468
+ verificationCoverage?: VerificationCoverage[];
469
+ verificationCommandPlan?: VerificationCommandPlanEntry[];
470
+ value?: QueryObject;
471
+ }
472
+ export interface FocusBriefData extends BaseQueryData {
473
+ mode: "focus_brief" | "session_context";
474
+ actionability?: string;
475
+ retrieval?: RetrievalSummaryData;
476
+ packetVerdict?: string;
477
+ focusFiles?: CompactFileFact[];
478
+ workflows?: QueryObject[];
479
+ modules?: QueryObject[];
480
+ groups?: CompactDiffImpactGroup[];
481
+ tests?: TestRecommendation[];
482
+ nextCall?: NextCallData;
483
+ }
484
+ export interface ChangePlanData extends BaseQueryData {
485
+ mode: "change_plan";
486
+ editReadiness?: QueryObject;
487
+ followCandidate?: QueryObject;
488
+ snapshotBlock?: QueryObject;
489
+ targetCandidates?: QueryObject[];
490
+ steps?: string[];
491
+ focus?: FocusBriefData | QueryObject;
492
+ context?: ContextPacketData | QueryObject;
493
+ files?: string[];
494
+ plannedEditTargets?: string[];
495
+ tests?: TestRecommendation[];
496
+ recipes?: string[];
497
+ requiredWorkflowChecks?: TaskSnapshotRequiredCheck[];
498
+ requiredDependencyChecks?: TaskSnapshotRequiredCheck[];
499
+ snapshot?: TaskSnapshot | QueryObject;
500
+ }
501
+ export interface PostEditReviewData extends BaseQueryData {
502
+ mode: "post_edit_review";
503
+ verdict?: string;
504
+ inspectMode?: "none" | "advisory" | "blocking";
505
+ inspectReasons?: string[];
506
+ completionAuthority?: "complete" | "tests_required" | "advisory_inspect" | "blocking_inspect" | "replan_required";
507
+ files?: string[];
508
+ reviewTargets?: string[];
509
+ changedSinceSnapshot?: string[];
510
+ changedGroups?: CompactDiffImpactGroup[];
511
+ resolvedBaselineFiles?: string[];
512
+ unplannedEditedFiles?: string[];
513
+ plannedRenames?: QueryObject[];
514
+ unplannedChangedSymbols?: CompactChangedSymbol[];
515
+ plannedButUntouchedFiles?: string[];
516
+ headChanged?: boolean;
517
+ symbolDeltas?: QueryObject[];
518
+ modifiedSymbols?: string[];
519
+ modifiedPublicSymbols?: string[];
520
+ riskDeltas?: QueryObject[];
521
+ affectedEdges?: GraphEdgeFact[];
522
+ affectedTests?: TestRecommendation[];
523
+ tests?: TestRecommendation[];
524
+ degradedSnapshotTests?: TestRecommendation[];
525
+ supersededDegradedSnapshotTests?: TestRecommendation[];
526
+ testsNotRun?: TestRecommendation[];
527
+ missedLikelyTests?: TestRecommendation[];
528
+ ranTests?: string[];
529
+ ranCommands?: string[];
530
+ ranCommandReports?: VerificationCommandReport[];
531
+ commandEnvelopes?: VerificationCommandEnvelope[];
532
+ waivedChecks?: string[];
533
+ waivers?: VerificationWaiver[];
534
+ verificationCoverage?: VerificationCoverage[];
535
+ verificationLedger?: VerificationLedgerEntry[];
536
+ waivedVerification?: VerificationLedgerEntry[];
537
+ unindexedEditedFiles?: string[];
538
+ riskEscalations?: QueryObject[];
539
+ riskEscalationsCoveredByVerification?: boolean;
540
+ riskEscalationsNeedInspection?: boolean;
541
+ workflows?: WorkflowTraceFact[];
542
+ workflowChecks?: TaskSnapshotRequiredCheck[];
543
+ dependencyChecks?: TaskSnapshotRequiredCheck[];
544
+ driftReasons?: string[];
545
+ nextActions?: string[];
546
+ snapshotLoad?: SnapshotLoadData;
547
+ snapshot?: TaskSnapshot | QueryObject;
548
+ outcome?: PostEditOutcomeData;
549
+ context?: ContextPacketData | QueryObject;
550
+ autoVerifyCandidates?: QueryObject[];
551
+ autoVerifyRunnerEvidence?: QueryObject[];
552
+ }
553
+ export interface TestPlanData extends BaseQueryData {
554
+ mode: "test_plan";
555
+ changedFiles?: string[];
556
+ changedEntries?: ChangedFileEntry[];
557
+ changedSymbols?: CompactChangedSymbol[];
558
+ unindexedChanged?: string[];
559
+ groups?: CompactDiffImpactGroup[];
560
+ tests?: TestRecommendation[];
561
+ outcomeLearning?: QueryObject[];
562
+ verificationCommands?: string[];
563
+ verificationCoverage?: VerificationCoverage[];
564
+ verificationCommandPlan?: VerificationCommandPlanEntry[];
565
+ commandEnvelopes?: VerificationCommandEnvelope[];
566
+ verificationLedgerPreview?: VerificationLedgerEntry[];
567
+ verificationLedger?: VerificationLedgerEntry[];
568
+ testsNotRun?: TestRecommendation[];
569
+ }
570
+ export type CodexaQueryData = ContextPacketData | FocusBriefData | ChangePlanData | PostEditReviewData | TestPlanData;
571
+ export type ChangeType = "style" | "api" | "behavior" | "rename" | "delete" | "unknown";
572
+ export interface ContextPackInput {
573
+ task?: string;
574
+ files?: string[];
575
+ symbols?: string[];
576
+ query?: string;
577
+ diff?: boolean;
578
+ tokenBudget?: number;
579
+ limit?: number;
580
+ includeSnippets?: boolean;
581
+ changeType?: ChangeType;
582
+ }
583
+ export interface ChangePlanInput extends ContextPackInput {
584
+ saveSnapshot?: boolean;
585
+ taskId?: string;
586
+ followCandidate?: string;
587
+ }
588
+ export interface SessionMemoryInput {
589
+ action?: "read" | "remember" | "summary" | "compact";
590
+ sessionId?: string;
591
+ taskId?: string;
592
+ task?: string;
593
+ kinds?: SessionMemoryKind[];
594
+ refs?: SessionMemoryRef[];
595
+ files?: string[];
596
+ symbols?: string[];
597
+ topics?: string[];
598
+ limit?: number;
599
+ tokenBudget?: number;
600
+ includeStale?: boolean;
601
+ entries?: Array<{
602
+ kind: SessionMemoryKind;
603
+ key?: string;
604
+ summary: string;
605
+ details?: string;
606
+ provenance?: SessionMemoryProvenance;
607
+ status?: SessionMemoryStatus;
608
+ confidence: Confidence;
609
+ evidenceTier: EvidenceTier;
610
+ scope?: Partial<SessionMemoryScope>;
611
+ evidence?: SessionMemoryEvidence[];
612
+ supersedes?: string[];
613
+ }>;
614
+ }
615
+ export interface PostEditReviewInput {
616
+ task?: string;
617
+ taskId?: string;
618
+ files?: string[];
619
+ symbols?: string[];
620
+ changeType?: ChangeType;
621
+ tokenBudget?: number;
622
+ limit?: number;
623
+ includeSnippets?: boolean;
624
+ ranTests?: string[];
625
+ ranCommands?: string[];
626
+ ranCommandReports?: VerificationCommandReport[];
627
+ waivedChecks?: string[];
628
+ waivers?: VerificationWaiver[];
629
+ persistOutcome?: boolean;
630
+ }
631
+ export interface AutoVerifyCandidate {
632
+ schemaVersion: 1;
633
+ taskId: string;
634
+ snapshotDigest: string;
635
+ commandId: string;
636
+ command: string;
637
+ commandExecutable: string;
638
+ commandArgs: string[];
639
+ commandCwd: string;
640
+ targetPaths: string[];
641
+ source: "explicit" | "authoritative-test-edge" | "derived-impact" | "heuristic" | "legacy";
642
+ rank: number;
643
+ }
644
+ export interface FocusBriefInput {
645
+ task?: string;
646
+ tokenBudget?: number;
647
+ limit?: number;
648
+ diff?: boolean;
649
+ }
650
+ export interface TestRecommendation {
651
+ path: string;
652
+ reason: string;
653
+ rank: number;
654
+ evidenceTier?: EvidenceTier;
655
+ provenance?: TestRecommendationProvenance;
656
+ command?: string;
657
+ commandCwd?: string;
658
+ commandExecutable?: string;
659
+ commandArgs?: string[];
660
+ commandSource?: string;
661
+ commandConfidence?: Confidence;
662
+ }
663
+ export type TestRecommendationProvenanceSource = "explicit_target" | "authoritative_test_edge" | "derived_import" | "derived_impact_expansion" | "heuristic_match" | "package_import" | "natural_retrieval" | "snapshot_legacy" | "outcome_history";
664
+ export type TestRecommendationProvenanceOrigin = "current" | "context" | "snapshot" | "outcome";
665
+ export interface TestRecommendationProvenance {
666
+ schemaVersion: 1;
667
+ origin: TestRecommendationProvenanceOrigin;
668
+ sources: TestRecommendationProvenanceSource[];
669
+ targetPaths: string[];
670
+ evidence: string[];
671
+ degraded?: boolean;
672
+ degradedReason?: string;
673
+ }
674
+ export type VerificationCoverageKind = "javascript-tests" | "python-tests" | "typescript-syntax" | "build" | "lint" | "privacy" | "audit" | "targeted-test" | "unknown";
675
+ export type VerificationLedgerStatus = "covered" | "missing" | "waived" | "not_applicable" | "would_cover";
676
+ export declare const VERIFICATION_PROVENANCE_SCHEMA_VERSION: 1;
677
+ export declare const VERIFICATION_COMMAND_COVERAGE_CLASSIFIER_VERSION = "command-coverage-v3";
678
+ export declare const VERIFICATION_COMMAND_ENVELOPE_RULESET_VERSION = "command-envelope-v2";
679
+ export declare const VERIFICATION_LEDGER_VERSION = "verification-ledger-v2";
680
+ export interface VerificationProvenance {
681
+ schemaVersion: typeof VERIFICATION_PROVENANCE_SCHEMA_VERSION;
682
+ commandCoverageClassifier: "codexa-command-coverage";
683
+ commandCoverageClassifierVersion: string;
684
+ commandEnvelopeRulesetVersion: string;
685
+ verificationLedgerVersion: string;
686
+ }
687
+ export declare const CURRENT_VERIFICATION_PROVENANCE: VerificationProvenance;
688
+ export interface VerificationCoverage {
689
+ kind: VerificationCoverageKind;
690
+ command: string;
691
+ source: string;
692
+ confidence: Confidence;
693
+ scope?: string;
694
+ targetPath?: string;
695
+ details: string[];
696
+ exitCode?: number;
697
+ durationMs?: number;
698
+ outputSummary?: string;
699
+ commandEnvelope?: VerificationCommandEnvelope;
700
+ }
701
+ export interface VerificationCommandReport {
702
+ command: string;
703
+ cwd?: string;
704
+ packageManager?: string;
705
+ workspace?: string;
706
+ packageRoot?: string;
707
+ packageName?: string;
708
+ scriptName?: string;
709
+ args?: string[];
710
+ exitCode?: number;
711
+ durationMs?: number;
712
+ stdoutSummary?: string;
713
+ stderrSummary?: string;
714
+ outputSummary?: string;
715
+ }
716
+ export type VerificationCommandEnvelopeSource = "reported" | "derived-from-report" | "derived-from-raw-command";
717
+ export type VerificationCommandEnvelopeScopeStatus = "repo" | "missing-cwd" | "outside-repo" | "unresolved-package" | "unknown";
718
+ export interface VerificationCommandEnvelope {
719
+ command: string;
720
+ cwd?: string;
721
+ packageManager?: string;
722
+ workspace?: string;
723
+ packageRoot?: string;
724
+ packageName?: string;
725
+ scriptName?: string;
726
+ args: string[];
727
+ exitCode?: number;
728
+ durationMs?: number;
729
+ stdoutSummary?: string;
730
+ stderrSummary?: string;
731
+ outputSummary?: string;
732
+ source: VerificationCommandEnvelopeSource;
733
+ scopeStatus: VerificationCommandEnvelopeScopeStatus;
734
+ classifierVersion: string;
735
+ }
736
+ export interface VerificationCommandPlanEntry {
737
+ command: string;
738
+ covers: VerificationCoverageKind[];
739
+ targetPaths: string[];
740
+ scopes: string[];
741
+ sources: string[];
742
+ confidence: Confidence;
743
+ }
744
+ export interface VerificationLedgerEntry {
745
+ kind: "test" | "workflow" | "dependency";
746
+ recommended: string;
747
+ target: string;
748
+ status: VerificationLedgerStatus;
749
+ evidence: string[];
750
+ missingReason?: string;
751
+ waiverReason?: string;
752
+ notApplicableReason?: string;
753
+ coverageKinds: VerificationCoverageKind[];
754
+ command?: string;
755
+ source?: string;
756
+ }
757
+ export interface VerificationWaiver {
758
+ kind: "test" | "workflow" | "dependency";
759
+ target: string;
760
+ reason: string;
761
+ }
762
+ export interface ChangedSymbol {
763
+ symbol: SymbolFact;
764
+ changedLines: string[];
765
+ }
766
+ export interface ChangedFileEntry {
767
+ path: string;
768
+ oldPath?: string;
769
+ status: string;
770
+ kind: "added" | "modified" | "deleted" | "renamed" | "copied" | "untracked" | "unknown";
771
+ staged: boolean;
772
+ worktree: boolean;
773
+ }
774
+ export interface DiffImpactGroup {
775
+ key: string;
776
+ module: string;
777
+ kind: "source" | "test" | "config" | "docs" | "generated" | "unknown";
778
+ language: LanguageId;
779
+ files: string[];
780
+ diffKinds: ChangedFileEntry["kind"][];
781
+ changedSymbols: ChangedSymbol[];
782
+ unindexedFiles: string[];
783
+ rank: number;
784
+ risk: number;
785
+ }
786
+ export interface TaskSnapshotFocusFile {
787
+ path: string;
788
+ tier: EvidenceTier;
789
+ reasons: string[];
790
+ rank: number;
791
+ riskScore: number;
792
+ }
793
+ export interface TaskSnapshotSymbol {
794
+ id: string;
795
+ path: string;
796
+ name: string;
797
+ qualifiedName: string;
798
+ kind: SymbolFact["kind"];
799
+ range?: Range;
800
+ }
801
+ export interface TaskSnapshotRiskFile {
802
+ riskScore: number;
803
+ signals: string[];
804
+ }
805
+ export interface TaskSnapshotRequiredCheck {
806
+ kind: "workflow" | "dependency";
807
+ target: string;
808
+ reason: string;
809
+ evidenceTier: EvidenceTier;
810
+ confidence: Confidence;
811
+ paths: string[];
812
+ }
813
+ export interface TaskSnapshot {
814
+ schemaVersion: 1;
815
+ taskId: string;
816
+ repoRoot: string;
817
+ task?: string;
818
+ changeType: ChangeType;
819
+ createdAt: string;
820
+ snapshotFreshness: FreshnessInfo;
821
+ input: ChangePlanInput;
822
+ plannedEditTargets: string[];
823
+ plannedFiles: string[];
824
+ focusFiles: TaskSnapshotFocusFile[];
825
+ plannedTests: TestRecommendation[];
826
+ sessionMemory?: SessionMemoryPointer;
827
+ requiredWorkflowChecks: TaskSnapshotRequiredCheck[];
828
+ requiredDependencyChecks: TaskSnapshotRequiredCheck[];
829
+ symbolBaseline?: Record<string, TaskSnapshotSymbol[]>;
830
+ riskBaseline?: Record<string, TaskSnapshotRiskFile>;
831
+ recipes: string[];
832
+ dirtyBaseline: {
833
+ changedEntries: ChangedFileEntry[];
834
+ dirtyFiles: string[];
835
+ dirtyFileHashes: Record<string, string>;
836
+ headCommit: string | null;
837
+ indexedAt: string;
838
+ };
839
+ quality?: unknown;
840
+ gaps: string[];
841
+ warnings: string[];
842
+ }
843
+ export interface SessionMemoryPointer {
844
+ sessionId: string;
845
+ revision: number;
846
+ entryIds: string[];
847
+ summaryHash: string;
848
+ }