local-triage 0.0.0-stage → 0.10.0-dev.32

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 (223) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -2
  3. package/THIRD-PARTY-NOTICES.md +48 -0
  4. package/app/__init__.py +3 -0
  5. package/app/affiliation.py +137 -0
  6. package/app/ask.py +300 -0
  7. package/app/build_info.py +98 -0
  8. package/app/capec.py +168 -0
  9. package/app/capec_view.py +27 -0
  10. package/app/codecmp.py +59 -0
  11. package/app/config.py +411 -0
  12. package/app/context.py +1451 -0
  13. package/app/cvss.py +357 -0
  14. package/app/db.py +6234 -0
  15. package/app/defect.py +670 -0
  16. package/app/defect_check.py +323 -0
  17. package/app/defect_drafts.py +612 -0
  18. package/app/defect_dto.py +149 -0
  19. package/app/defect_fields.py +248 -0
  20. package/app/defect_form.py +124 -0
  21. package/app/defect_links.py +107 -0
  22. package/app/defect_local_text.py +103 -0
  23. package/app/defect_references.py +164 -0
  24. package/app/defect_where.py +147 -0
  25. package/app/ecosystem.py +51 -0
  26. package/app/executors.py +660 -0
  27. package/app/feeds.py +1231 -0
  28. package/app/guard.py +164 -0
  29. package/app/hub_block_builder.py +200 -0
  30. package/app/hub_block_version.py +220 -0
  31. package/app/hub_defects.py +4469 -0
  32. package/app/hub_effects.py +421 -0
  33. package/app/hub_entity_versions.py +108 -0
  34. package/app/hub_import.py +2054 -0
  35. package/app/hub_onboarding.py +114 -0
  36. package/app/hub_ops.py +330 -0
  37. package/app/hub_pull.py +1195 -0
  38. package/app/hub_state.py +255 -0
  39. package/app/hub_status.py +237 -0
  40. package/app/hub_sync.py +619 -0
  41. package/app/hub_sync_api.py +241 -0
  42. package/app/hub_sync_compare.py +1054 -0
  43. package/app/hub_sync_contract.py +75 -0
  44. package/app/hub_template_model.py +74 -0
  45. package/app/hub_text_scale.py +159 -0
  46. package/app/journal.py +250 -0
  47. package/app/llm.py +850 -0
  48. package/app/llm_chat.py +596 -0
  49. package/app/llm_http.py +319 -0
  50. package/app/llm_messages.py +401 -0
  51. package/app/llm_net.py +764 -0
  52. package/app/llm_ollama.py +571 -0
  53. package/app/lockfile.py +505 -0
  54. package/app/logsafe.py +54 -0
  55. package/app/main.py +367 -0
  56. package/app/mask_display.py +132 -0
  57. package/app/masking.py +814 -0
  58. package/app/metrics.py +194 -0
  59. package/app/model_traffic.py +519 -0
  60. package/app/models.py +483 -0
  61. package/app/navigation.py +121 -0
  62. package/app/osv.py +279 -0
  63. package/app/package_identity.py +189 -0
  64. package/app/package_transition.py +824 -0
  65. package/app/profile_gate.py +71 -0
  66. package/app/prompts.py +1108 -0
  67. package/app/provider_keys.py +189 -0
  68. package/app/providers.py +511 -0
  69. package/app/routes/__init__.py +10 -0
  70. package/app/routes/api.py +153 -0
  71. package/app/routes/capec.py +186 -0
  72. package/app/routes/common.py +407 -0
  73. package/app/routes/components.py +1499 -0
  74. package/app/routes/cwe.py +168 -0
  75. package/app/routes/decision_selected.py +153 -0
  76. package/app/routes/defect_add.py +223 -0
  77. package/app/routes/defect_card_routes.py +363 -0
  78. package/app/routes/defect_selected.py +342 -0
  79. package/app/routes/feeds.py +155 -0
  80. package/app/routes/findings.py +2736 -0
  81. package/app/routes/hub.py +402 -0
  82. package/app/routes/hub_bulk.py +288 -0
  83. package/app/routes/hub_defect_routes.py +1945 -0
  84. package/app/routes/hub_status_routes.py +1132 -0
  85. package/app/routes/hub_sync_routes.py +463 -0
  86. package/app/routes/journal.py +132 -0
  87. package/app/routes/projects.py +1601 -0
  88. package/app/routes/providers.py +336 -0
  89. package/app/routes/references.py +26 -0
  90. package/app/routes/runs.py +219 -0
  91. package/app/routes/sca.py +2722 -0
  92. package/app/routes/settings.py +163 -0
  93. package/app/run_errors.py +151 -0
  94. package/app/sca.py +1662 -0
  95. package/app/sca_contract.py +1289 -0
  96. package/app/sca_research.py +1089 -0
  97. package/app/sca_research_net.py +1007 -0
  98. package/app/sca_text.py +965 -0
  99. package/app/serve.py +70 -0
  100. package/app/settings_store.py +262 -0
  101. package/app/static/app.css +2802 -0
  102. package/app/static/app.js +3772 -0
  103. package/app/static/capec-license.txt +9 -0
  104. package/app/static/favicon.svg +1 -0
  105. package/app/static/fonts/Golos-Text_DemiBold.woff2 +0 -0
  106. package/app/static/fonts/Golos-Text_Regular.woff2 +0 -0
  107. package/app/static/fonts/OFL.txt +90 -0
  108. package/app/static/navigation.js +234 -0
  109. package/app/static/observability.js +121 -0
  110. package/app/static/theme.js +49 -0
  111. package/app/storage/__init__.py +16 -0
  112. package/app/storage/local_state.py +246 -0
  113. package/app/storage/migrate.py +110 -0
  114. package/app/storage/migrations/postgresql/0001_baseline.sql +896 -0
  115. package/app/storage/migrations/postgresql/0002_feeds_and_secrets.sql +55 -0
  116. package/app/storage/migrations/postgresql/0003_project_mask_display.sql +5 -0
  117. package/app/storage/migrations/postgresql/0004_package_identity.sql +36 -0
  118. package/app/storage/postgresql.py +573 -0
  119. package/app/storage/schema.py +619 -0
  120. package/app/storage/sql.py +57 -0
  121. package/app/storage/tools.py +254 -0
  122. package/app/telemetry.py +307 -0
  123. package/app/templates/base.html +91 -0
  124. package/app/templates/capec/context.html +3 -0
  125. package/app/templates/capec/detail.html +27 -0
  126. package/app/templates/capec/index.html +128 -0
  127. package/app/templates/components/_archive.html +11 -0
  128. package/app/templates/components/archived.html +19 -0
  129. package/app/templates/components/batch.html +35 -0
  130. package/app/templates/components/detail.html +332 -0
  131. package/app/templates/components/index.html +338 -0
  132. package/app/templates/components/research_preview.html +80 -0
  133. package/app/templates/components/research_run.html +54 -0
  134. package/app/templates/cwe/bdu.html +56 -0
  135. package/app/templates/cwe/detail.html +233 -0
  136. package/app/templates/cwe/index.html +97 -0
  137. package/app/templates/error.html +8 -0
  138. package/app/templates/feeds/index.html +65 -0
  139. package/app/templates/findings/card.html +639 -0
  140. package/app/templates/findings/decision_selected.html +41 -0
  141. package/app/templates/findings/defect_add.html +46 -0
  142. package/app/templates/findings/defect_selected.html +47 -0
  143. package/app/templates/findings/list.html +153 -0
  144. package/app/templates/findings/send_selected.html +53 -0
  145. package/app/templates/findings/trace.html +72 -0
  146. package/app/templates/journal/detail.html +19 -0
  147. package/app/templates/journal/index.html +19 -0
  148. package/app/templates/macros.html +440 -0
  149. package/app/templates/navigation-fields.html +1 -0
  150. package/app/templates/navigation.html +11 -0
  151. package/app/templates/projects/_identity_summary.html +42 -0
  152. package/app/templates/projects/defect_card.html +153 -0
  153. package/app/templates/projects/defect_create_preview.html +17 -0
  154. package/app/templates/projects/defect_fields_diff.html +6 -0
  155. package/app/templates/projects/defect_fields_form.html +40 -0
  156. package/app/templates/projects/defect_references.html +17 -0
  157. package/app/templates/projects/defect_sync_preview.html +28 -0
  158. package/app/templates/projects/defect_update_actions.html +6 -0
  159. package/app/templates/projects/defect_update_preview.html +24 -0
  160. package/app/templates/projects/defects.html +126 -0
  161. package/app/templates/projects/delete.html +31 -0
  162. package/app/templates/projects/external.html +61 -0
  163. package/app/templates/projects/folders.html +64 -0
  164. package/app/templates/projects/hub_accepted.html +10 -0
  165. package/app/templates/projects/hub_assignment.html +50 -0
  166. package/app/templates/projects/hub_pending.html +20 -0
  167. package/app/templates/projects/hub_pending_list.html +17 -0
  168. package/app/templates/projects/hub_state_note.html +23 -0
  169. package/app/templates/projects/hub_step_note.html +5 -0
  170. package/app/templates/projects/hub_sync.html +105 -0
  171. package/app/templates/projects/hub_sync_confirm.html +32 -0
  172. package/app/templates/projects/hub_sync_worker.html +5 -0
  173. package/app/templates/projects/hub_text_rules.html +64 -0
  174. package/app/templates/projects/identity_report.html +74 -0
  175. package/app/templates/projects/list.html +90 -0
  176. package/app/templates/projects/project.html +433 -0
  177. package/app/templates/reference-missing.html +14 -0
  178. package/app/templates/runs/run.html +166 -0
  179. package/app/templates/sca/card.html +476 -0
  180. package/app/templates/sca/index.html +321 -0
  181. package/app/templates/settings/hub_url.html +31 -0
  182. package/app/templates/settings/index.html +216 -0
  183. package/app/templates/settings/provider.html +229 -0
  184. package/app/templates/settings/providers.html +37 -0
  185. package/app/templates/worklists.html +52 -0
  186. package/app/textsafe.py +117 -0
  187. package/app/timing.py +245 -0
  188. package/app/triage.py +1743 -0
  189. package/app/view.py +430 -0
  190. package/app/worklists.py +204 -0
  191. package/examples/demo/demo-hub-report-v2.xlsx +0 -0
  192. package/examples/demo/demo-hub-report.xlsx +0 -0
  193. package/examples/demo/repos/billing-core/pom.xml +30 -0
  194. package/examples/demo/repos/billing-core/src/main/java/org/example/billing/Invoice.java +9 -0
  195. package/examples/demo/repos/billing-core/src/main/java/org/example/billing/InvoiceRepository.java +51 -0
  196. package/examples/demo/repos/billing-core/src/main/java/org/example/billing/InvoiceStatus.java +11 -0
  197. package/examples/demo/repos/billing-core/src/main/java/org/example/billing/config/DatabaseSettings.java +18 -0
  198. package/examples/demo/repos/billing-core/src/main/java/org/example/billing/payment/PaymentTokenService.java +35 -0
  199. package/examples/demo/repos/billing-core/src/main/java/org/example/billing/web/InvoiceExportController.java +57 -0
  200. package/examples/demo/repos/catalog-api/catalog_api/__init__.py +1 -0
  201. package/examples/demo/repos/catalog-api/catalog_api/products.py +24 -0
  202. package/examples/demo/repos/catalog-api/catalog_api/tasks.py +24 -0
  203. package/examples/demo/repos/catalog-api/catalog_api/views.py +17 -0
  204. package/examples/demo/repos/catalog-api/requirements.txt +3 -0
  205. package/npm/build.json +5 -0
  206. package/npm/cli.js +346 -0
  207. package/npm/files.manifest +224 -0
  208. package/npm/lib/binding.js +64 -0
  209. package/npm/lib/cluster.js +330 -0
  210. package/npm/lib/env.js +88 -0
  211. package/npm/lib/fsx.js +125 -0
  212. package/npm/lib/http.js +53 -0
  213. package/npm/lib/metrics.js +73 -0
  214. package/npm/lib/paths.js +150 -0
  215. package/npm/lib/pg.js +351 -0
  216. package/npm/lib/proc.js +101 -0
  217. package/npm/lib/python.js +133 -0
  218. package/npm/lib/stand.js +46 -0
  219. package/npm/lib/supervisor.js +1141 -0
  220. package/npm/lib/version.js +21 -0
  221. package/npm/requirements.txt +476 -0
  222. package/npm-shrinkwrap.json +111 -0
  223. package/package.json +37 -4
@@ -0,0 +1,619 @@
1
+ """Манифест схемы 33 (S): таблицы, колонки, ключи и порядок загрузки, по которому база переносилась из SQLite (инструменты
2
+ переноса удалены в 0.10.0.dev8).
3
+
4
+ Не меняется при новых миграциях; совпадение с базовой схемой проверяет tests/test_storage_store.py::test_manifest_matches_catalog."""
5
+
6
+ from __future__ import annotations
7
+
8
+ SCHEMA_VERSION = 36
9
+
10
+ # Колонки, добавленные миграциями после базовой схемы: базовый манифест TABLES не меняется (переносы из SQLite опирались
11
+ # на него), ожидаемая текущая структура – TABLES плюс эти колонки (app.db._expected_layout).
12
+ ADDED_COLUMNS: dict[str, tuple[tuple[str, str], ...]] = {
13
+ 'projects': (('mask_secrets', 'BIGINT'), ('identity_rev', 'BIGINT')), # 0003 – схема 35; 0004 – схема 36
14
+ 'findings': (('pkg_ecosystem', 'TEXT'), ('pkg_name', 'TEXT'), ('pkg_source', 'TEXT'), ('pkg_note', 'TEXT'),
15
+ ('pkg_scope', 'TEXT'), ('pkg_rev', 'BIGINT')), # 0004, схема 36
16
+ 'sca2_research': (('origin_ref', 'TEXT'),), # 0004, схема 36
17
+ 'sca_set_members': (('pending_reason', 'TEXT'),), # 0004, схема 36
18
+ }
19
+
20
+ # Таблицы, созданные миграциями после базовой схемы (формат – как у TABLES): базовый манифест не меняется.
21
+ ADDED_TABLES: dict[str, dict] = {
22
+ 'sca_identity_archive': { # 0004, схема 36: история сущностей, снятых переходом идентичности пакета
23
+ 'columns': ('id', 'project_id', 'run_id', 'archived_at', 'source_table', 'key_json', 'row_json',
24
+ 'moved_to_ref', 'reason'),
25
+ 'types': ('BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'),
26
+ 'pk': ('id',),
27
+ 'identity': 'id',
28
+ 'refs': ('projects',),
29
+ 'autoincrement': True,
30
+ },
31
+ }
32
+
33
+ TABLES: dict[str, dict] = {
34
+ 'ast_map': {
35
+ 'columns': ('ast_id', 'vuln_id', 'source', 'created_at'),
36
+ 'types': ('TEXT', 'TEXT', 'TEXT', 'TEXT'),
37
+ 'pk': ('ast_id', 'vuln_id'),
38
+ 'identity': None,
39
+ 'refs': (),
40
+ 'autoincrement': False,
41
+ },
42
+ 'cases': {
43
+ 'columns': ('project_id', 'hub_id', 'case_hash', 'context_json', 'verdict_id', 'updated_at', 'code_cmp'),
44
+ 'types': ('BIGINT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT'),
45
+ 'pk': ('project_id', 'hub_id'),
46
+ 'identity': None,
47
+ 'refs': ('projects', 'verdicts'),
48
+ 'autoincrement': False,
49
+ },
50
+ 'codebase_map': {
51
+ 'columns': ('project_id', 'codebase', 'folder', 'manual', 'updated_at'),
52
+ 'types': ('BIGINT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT'),
53
+ 'pk': ('project_id', 'codebase'),
54
+ 'identity': None,
55
+ 'refs': ('projects',),
56
+ 'autoincrement': False,
57
+ },
58
+ 'defects': {
59
+ 'columns': ('project_id', 'defect_key', 'number', 'updated_at', 'assigned_at'),
60
+ 'types': ('BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT'),
61
+ 'pk': ('project_id', 'defect_key'),
62
+ 'identity': None,
63
+ 'refs': ('projects',),
64
+ 'autoincrement': False,
65
+ },
66
+ 'findings': {
67
+ 'columns': (
68
+ 'id', 'project_id', 'hub_id', 'import_id', 'pos', 'kind', 'severity', 'cvss', 'urgent', 'codebase',
69
+ 'group_key', 'data_json', 'missing', 'missing_since', 'group_key2', 'g2_cat', 'g2_file', 'g2_line',
70
+ 'file_import_id', 'file_checked_import_id', 'file_presence', 'file_missing_since', 'file_data_json',
71
+ ),
72
+ 'types': (
73
+ 'BIGINT', 'BIGINT', 'TEXT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'DOUBLE PRECISION', 'BIGINT', 'TEXT',
74
+ 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT',
75
+ 'TEXT', 'TEXT',
76
+ ),
77
+ 'pk': ('id',),
78
+ 'identity': 'id',
79
+ 'refs': ('projects',),
80
+ 'autoincrement': True,
81
+ },
82
+ 'hub_attempts': {
83
+ 'columns': (
84
+ 'id', 'op_id', 'worker_id', 'lease_token', 'taken_at', 'taken_until', 'result_json', 'error',
85
+ 'received_at', 'late',
86
+ ),
87
+ 'types': ('BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT'),
88
+ 'pk': ('id',),
89
+ 'identity': 'id',
90
+ 'refs': ('hub_ops',),
91
+ 'autoincrement': True,
92
+ },
93
+ 'hub_defect_history': {
94
+ 'columns': (
95
+ 'id', 'defect_id', 'row_id', 'revision', 'event', 'summary', 'command_text', 'details_json', 'op_id',
96
+ 'created_at',
97
+ ),
98
+ 'types': ('BIGINT', 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT'),
99
+ 'pk': ('id',),
100
+ 'identity': 'id',
101
+ 'refs': ('hub_defects',),
102
+ 'autoincrement': True,
103
+ },
104
+ 'hub_defect_reference_loads': {
105
+ 'columns': ('id', 'project_id', 'hub_url', 'app_id', 'state', 'load_json', 'created_at', 'closed_at'),
106
+ 'types': ('BIGINT', 'BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'),
107
+ 'pk': ('id',),
108
+ 'identity': 'id',
109
+ 'refs': ('projects',),
110
+ 'autoincrement': True,
111
+ },
112
+ 'hub_defect_sync_runs': {
113
+ 'columns': (
114
+ 'id', 'project_id', 'hub_url', 'app_id', 'state', 'run_json', 'created_at', 'closed_at', 'revision',
115
+ 'generation', 'snapshot_hash', 'applied_at', 'result_json',
116
+ ),
117
+ 'types': (
118
+ 'BIGINT', 'BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'BIGINT', 'TEXT',
119
+ 'TEXT', 'TEXT',
120
+ ),
121
+ 'pk': ('id',),
122
+ 'identity': 'id',
123
+ 'refs': ('projects',),
124
+ 'autoincrement': True,
125
+ },
126
+ 'hub_defects': {
127
+ 'columns': (
128
+ 'id', 'project_id', 'kind', 'number', 'summary', 'anchor_hub_id', 'targets_json', 'left_out_json',
129
+ 'warnings_json', 'number_keys_json', 'command_text', 'source_fingerprint', 'body_html', 'blank_json',
130
+ 'priority', 'severity', 'hub_url', 'app_id', 'hub_defect_id', 'hub_link', 'blank_op_id',
131
+ 'create_op_id', 'read_op_id', 'link_op_id', 'verify_json', 'verify_op_id', 'confirm_op_id',
132
+ 'effects_done', 'state', 'error', 'created_by', 'created_at', 'updated_at', 'closed_at', 'origin',
133
+ 'import_json', 'sync_op_id', 'sync_json', 'update_op_id', 'update_json', 'text_generation',
134
+ 'draft_owner_id', 'draft_summary', 'draft_command_text', 'draft_fields_json',
135
+ 'confirmed_object_json', 'conflicts_json', 'draft_revision', 'sca_set_key',
136
+ 'draft_fields_basis_json',
137
+ ),
138
+ 'types': (
139
+ 'BIGINT', 'BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
140
+ 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'BIGINT', 'BIGINT', 'BIGINT',
141
+ 'BIGINT', 'TEXT', 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
142
+ 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT',
143
+ 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT',
144
+ ),
145
+ 'pk': ('id',),
146
+ 'identity': 'id',
147
+ 'refs': ('projects',),
148
+ 'autoincrement': True,
149
+ },
150
+ 'hub_entity_versions': {
151
+ 'columns': (
152
+ 'project_id', 'hub_url', 'app_id', 'entity_kind', 'entity_key', 'accepted_epoch', 'accepted_hash',
153
+ 'accepted_source_json',
154
+ ),
155
+ 'types': ('BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT'),
156
+ 'pk': ('project_id', 'hub_url', 'app_id', 'entity_kind', 'entity_key'),
157
+ 'identity': None,
158
+ 'refs': ('projects',),
159
+ 'autoincrement': False,
160
+ },
161
+ 'hub_issue_states': {
162
+ 'columns': (
163
+ 'project_id', 'hub_url', 'app_id', 'issue_type', 'issue_id', 'finding_id', 'confirmed_json',
164
+ 'confirmed_run_id', 'confirmed_presence', 'observed_json', 'observed_run_id', 'base_local_signature',
165
+ 'alignment', 'pending_local_signature', 'pending_base_epoch', 'conflicts_json', 'revision',
166
+ ),
167
+ 'types': (
168
+ 'BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'BIGINT',
169
+ 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'BIGINT',
170
+ ),
171
+ 'pk': ('project_id', 'hub_url', 'app_id', 'issue_type', 'issue_id'),
172
+ 'identity': None,
173
+ 'refs': ('projects',),
174
+ 'autoincrement': False,
175
+ },
176
+ 'hub_ops': {
177
+ 'columns': (
178
+ 'id', 'project_id', 'purpose', 'op_key', 'lock_keys', 'targets_json', 'request_json', 'hub_url',
179
+ 'app_id', 'text_hash', 'text_norm', 'state', 'result_json', 'hub_object_id', 'error', 'created_at',
180
+ 'updated_at', 'closed_at',
181
+ ),
182
+ 'types': (
183
+ 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT',
184
+ 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
185
+ ),
186
+ 'pk': ('id',),
187
+ 'identity': 'id',
188
+ 'refs': ('projects',),
189
+ 'autoincrement': True,
190
+ },
191
+ 'hub_sync_applications': {
192
+ 'columns': (
193
+ 'run_id', 'entity_kind', 'entity_key', 'before_json', 'hub_json', 'presence', 'accepted_epoch',
194
+ 'accepted_hash',
195
+ ),
196
+ 'types': ('BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT'),
197
+ 'pk': ('run_id', 'entity_kind', 'entity_key'),
198
+ 'identity': None,
199
+ 'refs': ('hub_defect_sync_runs',),
200
+ 'autoincrement': False,
201
+ },
202
+ 'hub_sync_items': {
203
+ 'columns': (
204
+ 'run_id', 'entity_kind', 'entity_key', 'hub_json', 'source_ops_json', 'coverage_json', 'base_json',
205
+ 'base_epoch', 'local_json', 'local_signature', 'diff_json', 'choice_json', 'choice_revision',
206
+ 'observed_from', 'observed_to', 'stale_reason',
207
+ ),
208
+ 'types': (
209
+ 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
210
+ 'BIGINT', 'TEXT', 'TEXT', 'TEXT',
211
+ ),
212
+ 'pk': ('run_id', 'entity_kind', 'entity_key'),
213
+ 'identity': None,
214
+ 'refs': ('hub_defect_sync_runs',),
215
+ 'autoincrement': False,
216
+ },
217
+ 'hub_sync_pending': {
218
+ 'columns': (
219
+ 'id', 'project_id', 'hub_url', 'app_id', 'entity_kind', 'entity_key', 'signature', 'payload_json',
220
+ 'created_run_id', 'created_at', 'state', 'resolved_at',
221
+ ),
222
+ 'types': (
223
+ 'BIGINT', 'BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT',
224
+ 'TEXT',
225
+ ),
226
+ 'pk': ('id',),
227
+ 'identity': 'id',
228
+ 'refs': ('hub_defect_sync_runs', 'projects'),
229
+ 'autoincrement': True,
230
+ },
231
+ 'hub_sync_requests': {
232
+ 'columns': (
233
+ 'id', 'run_id', 'generation', 'request_key', 'op_id', 'entity_kind', 'entity_key', 'state',
234
+ 'request_json', 'base_epoch', 'base_hash', 'result_hash', 'processed_at',
235
+ ),
236
+ 'types': (
237
+ 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT',
238
+ 'TEXT', 'TEXT',
239
+ ),
240
+ 'pk': ('id',),
241
+ 'identity': 'id',
242
+ 'refs': ('hub_defect_sync_runs', 'hub_ops'),
243
+ 'autoincrement': True,
244
+ },
245
+ 'imports': {
246
+ 'columns': (
247
+ 'id', 'project_id', 'filename', 'format', 'total', 'stats_json', 'sheets_json', 'summary_json',
248
+ 'warnings_json', 'created_at', 'source_kind', 'sync_run_id',
249
+ ),
250
+ 'types': (
251
+ 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
252
+ 'BIGINT',
253
+ ),
254
+ 'pk': ('id',),
255
+ 'identity': 'id',
256
+ 'refs': ('projects',),
257
+ 'autoincrement': True,
258
+ },
259
+ 'llm_executions': {
260
+ 'columns': (
261
+ 'id', 'provider_id', 'provider_version', 'kind', 'base_url', 'trust', 'purpose', 'model',
262
+ 'options_json', 'schema_mode', 'digest', 'note', 'created_at',
263
+ ),
264
+ 'types': (
265
+ 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
266
+ 'TEXT',
267
+ ),
268
+ 'pk': ('id',),
269
+ 'identity': 'id',
270
+ 'refs': ('llm_providers',),
271
+ 'autoincrement': True,
272
+ },
273
+ 'llm_providers': {
274
+ 'columns': (
275
+ 'id', 'name', 'kind', 'base_url', 'trust', 'auth', 'purposes_json', 'enabled', 'version',
276
+ 'default_model', 'models_json', 'capabilities_json', 'confirmed_addresses_json', 'generation_json',
277
+ 'created_at', 'updated_at',
278
+ ),
279
+ 'types': (
280
+ 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT',
281
+ 'TEXT', 'TEXT', 'TEXT', 'TEXT',
282
+ ),
283
+ 'pk': ('id',),
284
+ 'identity': 'id',
285
+ 'refs': (),
286
+ 'autoincrement': True,
287
+ },
288
+ 'meta': {
289
+ 'columns': ('key', 'value'),
290
+ 'types': ('TEXT', 'TEXT'),
291
+ 'pk': ('key',),
292
+ 'identity': None,
293
+ 'refs': (),
294
+ 'autoincrement': False,
295
+ },
296
+ 'projects': {
297
+ 'columns': (
298
+ 'id', 'name', 'repos_dir', 'created_at', 'updated_at', 'model', 'archived', 'archived_at',
299
+ 'last_activity', 'provider_id', 'research_provider_id', 'external_allowed', 'external_reason',
300
+ 'external_confirmed_at', 'hub_app_id',
301
+ ),
302
+ 'types': (
303
+ 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'BIGINT', 'BIGINT',
304
+ 'BIGINT', 'TEXT', 'TEXT', 'BIGINT',
305
+ ),
306
+ 'pk': ('id',),
307
+ 'identity': 'id',
308
+ 'refs': ('llm_providers',),
309
+ 'autoincrement': True,
310
+ },
311
+ 'questions': {
312
+ 'columns': (
313
+ 'id', 'project_id', 'hub_id', 'question', 'answer', 'answer_json', 'model', 'case_hash',
314
+ 'verdict_id', 'state', 'error', 'stats_json', 'created_at', 'answered_at', 'execution_id',
315
+ ),
316
+ 'types': (
317
+ 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT',
318
+ 'TEXT', 'TEXT', 'BIGINT',
319
+ ),
320
+ 'pk': ('id',),
321
+ 'identity': 'id',
322
+ 'refs': ('llm_executions', 'projects'),
323
+ 'autoincrement': True,
324
+ },
325
+ 'review_texts': {
326
+ 'columns': (
327
+ 'id', 'project_id', 'hub_id', 'decision', 'final_verdict', 'final_comment', 'final_fix',
328
+ 'decided_at', 'replaced_at',
329
+ ),
330
+ 'types': ('BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'),
331
+ 'pk': ('id',),
332
+ 'identity': 'id',
333
+ 'refs': ('projects',),
334
+ 'autoincrement': False,
335
+ },
336
+ 'reviews': {
337
+ 'columns': (
338
+ 'project_id', 'hub_id', 'decision', 'final_verdict', 'final_comment', 'reviewed', 'reviewed_at',
339
+ 'copied_at', 'verdict_id', 'finding_sig', 'revision', 'updated_at', 'entered_hub', 'entered_hub_at',
340
+ 'code_hash', 'code_chars', 'entered_text_hash', 'answer_sig', 'kapo_state', 'decided_at',
341
+ 'final_fix', 'entered_parts', 'entered_origin', 'entered_defect_id', 'entered_op_id',
342
+ 'entered_defect_revision', 'entered_decision_hash', 'decision_origin', 'decision_source_json',
343
+ 'desired_hub_expired_at', 'defect_dropped',
344
+ ),
345
+ 'types': (
346
+ 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'BIGINT',
347
+ 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
348
+ 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
349
+ ),
350
+ 'pk': ('project_id', 'hub_id'),
351
+ 'identity': None,
352
+ 'refs': ('projects',),
353
+ 'autoincrement': False,
354
+ },
355
+ 'run_items': {
356
+ 'columns': (
357
+ 'id', 'run_id', 'seq', 'hub_id', 'state', 'case_hash', 'verdict_id', 'error', 'seconds', 'eval_tps',
358
+ 'finished_at', 'stats_partial', 'sending_at',
359
+ ),
360
+ 'types': (
361
+ 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'DOUBLE PRECISION',
362
+ 'DOUBLE PRECISION', 'TEXT', 'BIGINT', 'TEXT',
363
+ ),
364
+ 'pk': ('id',),
365
+ 'identity': 'id',
366
+ 'refs': ('runs',),
367
+ 'autoincrement': True,
368
+ },
369
+ 'run_journal': {
370
+ 'columns': ('run_id', 'payload_json', 'active_seconds', 'active_since', 'incomplete'),
371
+ 'types': ('BIGINT', 'TEXT', 'DOUBLE PRECISION', 'TEXT', 'BIGINT'),
372
+ 'pk': ('run_id',),
373
+ 'identity': None,
374
+ 'refs': ('runs',),
375
+ 'autoincrement': False,
376
+ },
377
+ 'run_review_events': {
378
+ 'columns': (
379
+ 'id', 'project_id', 'hub_id', 'verdict_id', 'revision', 'decision', 'final_verdict', 'reviewed',
380
+ 'observed_at',
381
+ ),
382
+ 'types': ('BIGINT', 'BIGINT', 'TEXT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT'),
383
+ 'pk': ('id',),
384
+ 'identity': 'id',
385
+ 'refs': ('projects',),
386
+ 'autoincrement': True,
387
+ },
388
+ 'runs': {
389
+ 'columns': (
390
+ 'id', 'project_id', 'state', 'scope', 'model', 'prompt_version', 'fresh', 'total', 'done', 'failed',
391
+ 'cached', 'skipped', 'model_calls', 'model_seconds', 'output_tokens', 'eval_seconds', 'last_tps',
392
+ 'last_error', 'created_at', 'started_at', 'finished_at', 'updated_at', 'control', 'partial_stats',
393
+ 'origin', 'execution_id', 'parent_run_id',
394
+ ),
395
+ 'types': (
396
+ 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'BIGINT', 'BIGINT', 'BIGINT', 'BIGINT',
397
+ 'BIGINT', 'BIGINT', 'DOUBLE PRECISION', 'BIGINT', 'DOUBLE PRECISION', 'DOUBLE PRECISION', 'TEXT',
398
+ 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'BIGINT', 'BIGINT',
399
+ ),
400
+ 'pk': ('id',),
401
+ 'identity': 'id',
402
+ 'refs': ('llm_executions', 'projects'),
403
+ 'autoincrement': True,
404
+ },
405
+ 'sast_group_merges': {
406
+ 'columns': ('project_id', 'group_key2', 'old_keys_json', 'numbers_json', 'merged_at'),
407
+ 'types': ('BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'),
408
+ 'pk': ('project_id', 'group_key2'),
409
+ 'identity': None,
410
+ 'refs': ('projects',),
411
+ 'autoincrement': False,
412
+ },
413
+ 'saved_component_filters': {
414
+ 'columns': ('id', 'project_id', 'name', 'name_key', 'query', 'created_at', 'updated_at'),
415
+ 'types': ('BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'),
416
+ 'pk': ('id',),
417
+ 'identity': 'id',
418
+ 'refs': ('projects',),
419
+ 'autoincrement': True,
420
+ },
421
+ 'sca2_decisions': {
422
+ 'columns': (
423
+ 'id', 'project_id', 'input_ref', 'revision', 'action', 'rationale', 'target_version',
424
+ 'replacement_name', 'replacement_version', 'review_at', 'input_sig', 'research_sig', 'state',
425
+ 'decided_at', 'superseded_at',
426
+ ),
427
+ 'types': (
428
+ 'BIGINT', 'BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
429
+ 'TEXT', 'TEXT', 'TEXT',
430
+ ),
431
+ 'pk': ('id',),
432
+ 'identity': 'id',
433
+ 'refs': ('projects',),
434
+ 'autoincrement': True,
435
+ },
436
+ 'sca2_research': {
437
+ 'columns': (
438
+ 'id', 'project_id', 'task_id', 'input_ref', 'revision', 'answer_sig', 'input_sig', 'status',
439
+ 'coverage_checked', 'coverage_errors', 'findings_total', 'applicable', 'gaps_count',
440
+ 'evidence_count', 'payload_json', 'imported_at', 'content_sig', 'observation_json', 'observed_at',
441
+ 'validation_rules', 'answer_schema', 'execution_id',
442
+ ),
443
+ 'types': (
444
+ 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'BIGINT', 'BIGINT',
445
+ 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT',
446
+ ),
447
+ 'pk': ('id',),
448
+ 'identity': 'id',
449
+ 'refs': ('llm_executions', 'projects', 'sca2_tasks'),
450
+ 'autoincrement': True,
451
+ },
452
+ 'sca2_research_run_rows': {
453
+ 'columns': (
454
+ 'run_id', 'input_ref', 'position', 'state', 'revision', 'reason', 'tools_json', 'usage_json',
455
+ 'sending_at', 'updated_at',
456
+ ),
457
+ 'types': ('BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT'),
458
+ 'pk': ('run_id', 'input_ref'),
459
+ 'identity': None,
460
+ 'refs': ('sca2_research_runs',),
461
+ 'autoincrement': False,
462
+ },
463
+ 'sca2_research_runs': {
464
+ 'columns': (
465
+ 'id', 'project_id', 'task_id', 'consent_id', 'execution_id', 'state', 'reason', 'rows_total',
466
+ 'rows_saved', 'rows_unchanged', 'rows_failed', 'rows_unknown', 'usage_json', 'started_at',
467
+ 'updated_at', 'finished_at',
468
+ ),
469
+ 'types': (
470
+ 'BIGINT', 'BIGINT', 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'BIGINT', 'BIGINT', 'BIGINT',
471
+ 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
472
+ ),
473
+ 'pk': ('id',),
474
+ 'identity': 'id',
475
+ 'refs': ('llm_executions', 'projects', 'sca2_tasks', 'sca_research_consents'),
476
+ 'autoincrement': True,
477
+ },
478
+ 'sca2_task_rows': {
479
+ 'columns': (
480
+ 'task_id', 'input_ref', 'ecosystem', 'name', 'version', 'identity_kind', 'input_sig',
481
+ 'hub_fix_candidate', 'finding_count', 'codebase_count', 'position', 'vulnerability_ids',
482
+ ),
483
+ 'types': (
484
+ 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'BIGINT', 'BIGINT',
485
+ 'TEXT',
486
+ ),
487
+ 'pk': ('task_id', 'input_ref'),
488
+ 'identity': None,
489
+ 'refs': ('sca2_tasks',),
490
+ 'autoincrement': False,
491
+ },
492
+ 'sca2_tasks': {
493
+ 'columns': (
494
+ 'id', 'project_id', 'import_id', 'task_id', 'contract', 'answer_contract', 'validator_version',
495
+ 'state', 'row_count', 'ecosystems_json', 'manifest_sha256', 'components_sha256', 'created_at',
496
+ 'updated_at', 'superseded_at', 'imported_at',
497
+ ),
498
+ 'types': (
499
+ 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT',
500
+ 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
501
+ ),
502
+ 'pk': ('id',),
503
+ 'identity': 'id',
504
+ 'refs': ('projects',),
505
+ 'autoincrement': True,
506
+ },
507
+ 'sca_answers': {
508
+ 'columns': (
509
+ 'id', 'project_id', 'component', 'version', 'source', 'recommended_version', 'conclusion',
510
+ 'explanation', 'ids_json', 'links_json', 'created_at', 'updated_at', 'vulns_json', 'ecosystem',
511
+ ),
512
+ 'types': (
513
+ 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
514
+ 'TEXT', 'TEXT',
515
+ ),
516
+ 'pk': ('id',),
517
+ 'identity': 'id',
518
+ 'refs': ('projects',),
519
+ 'autoincrement': True,
520
+ },
521
+ 'sca_applicability': {
522
+ 'columns': (
523
+ 'project_id', 'input_ref', 'vuln_key', 'ids_json', 'decision', 'reason', 'research_revision',
524
+ 'revision', 'updated_at',
525
+ ),
526
+ 'types': ('BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'BIGINT', 'TEXT'),
527
+ 'pk': ('project_id', 'input_ref', 'vuln_key'),
528
+ 'identity': None,
529
+ 'refs': ('projects',),
530
+ 'autoincrement': False,
531
+ },
532
+ 'sca_defect_sets': {
533
+ 'columns': ('project_id', 'input_ref', 'set_no', 'revision', 'excluded_json', 'updated_at'),
534
+ 'types': ('BIGINT', 'TEXT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT'),
535
+ 'pk': ('project_id', 'input_ref', 'set_no'),
536
+ 'identity': None,
537
+ 'refs': ('projects',),
538
+ 'autoincrement': False,
539
+ },
540
+ 'sca_package_texts': {
541
+ 'columns': (
542
+ 'project_id', 'input_ref', 'set_no', 'revision', 'explanation', 'ast_json', 'target_version',
543
+ 'target_basis', 'version_checked_sig', 'text_checked_sig', 'text_sig', 'updated_at',
544
+ 'residual_checked_sig', 'recommendation_note',
545
+ ),
546
+ 'types': (
547
+ 'BIGINT', 'TEXT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
548
+ 'TEXT', 'TEXT',
549
+ ),
550
+ 'pk': ('project_id', 'input_ref', 'set_no'),
551
+ 'identity': None,
552
+ 'refs': ('projects',),
553
+ 'autoincrement': False,
554
+ },
555
+ 'sca_research_consents': {
556
+ 'columns': (
557
+ 'id', 'project_id', 'task_id', 'execution_id', 'components_sha256', 'cutoff_date', 'instructions',
558
+ 'instructions_sha256', 'rows_json', 'selection', 'include_unknown', 'model', 'search_mode',
559
+ 'tool_steps', 'consent_key', 'state', 'created_at', 'revoked_at',
560
+ ),
561
+ 'types': (
562
+ 'BIGINT', 'BIGINT', 'BIGINT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT',
563
+ 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT',
564
+ ),
565
+ 'pk': ('id',),
566
+ 'identity': 'id',
567
+ 'refs': ('llm_executions', 'projects', 'sca2_tasks'),
568
+ 'autoincrement': True,
569
+ },
570
+ 'sca_set_members': {
571
+ 'columns': ('project_id', 'hub_id', 'input_ref', 'set_no', 'no_defect_reason', 'updated_at'),
572
+ 'types': ('BIGINT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT'),
573
+ 'pk': ('project_id', 'hub_id'),
574
+ 'identity': None,
575
+ 'refs': ('projects',),
576
+ 'autoincrement': False,
577
+ },
578
+ 'schema_version': {
579
+ 'columns': ('version', 'applied_at', 'note'),
580
+ 'types': ('BIGINT', 'TEXT', 'TEXT'),
581
+ 'pk': ('version',),
582
+ 'identity': None,
583
+ 'refs': (),
584
+ 'autoincrement': False,
585
+ },
586
+ 'settings': {
587
+ 'columns': ('key', 'value_json', 'updated_at'),
588
+ 'types': ('TEXT', 'TEXT', 'TEXT'),
589
+ 'pk': ('key',),
590
+ 'identity': None,
591
+ 'refs': (),
592
+ 'autoincrement': False,
593
+ },
594
+ 'verdicts': {
595
+ 'columns': (
596
+ 'id', 'case_hash', 'model', 'prompt_version', 'verdict', 'confidence', 'data_json', 'raw_json',
597
+ 'stats_json', 'created_at', 'request_key', 'execution_id',
598
+ ),
599
+ 'types': (
600
+ 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'TEXT', 'BIGINT',
601
+ ),
602
+ 'pk': ('id',),
603
+ 'identity': 'id',
604
+ 'refs': ('llm_executions',),
605
+ 'autoincrement': True,
606
+ },
607
+ }
608
+
609
+ # Порядок загрузки: родители раньше детей (самоссылка runs.parent_run_id – отложенная проверка)
610
+ LOAD_ORDER: tuple[str, ...] = (
611
+ 'ast_map', 'llm_providers', 'projects', 'llm_executions', 'verdicts', 'cases', 'codebase_map', 'defects',
612
+ 'findings', 'hub_ops', 'hub_attempts', 'hub_defects', 'hub_defect_history', 'hub_defect_reference_loads',
613
+ 'hub_defect_sync_runs', 'hub_entity_versions', 'hub_issue_states', 'hub_sync_applications',
614
+ 'hub_sync_items', 'hub_sync_pending', 'hub_sync_requests', 'imports', 'meta', 'questions',
615
+ 'review_texts', 'reviews', 'runs', 'run_items', 'run_journal', 'run_review_events', 'sast_group_merges',
616
+ 'saved_component_filters', 'sca2_decisions', 'sca2_tasks', 'sca2_research', 'sca_research_consents',
617
+ 'sca2_research_runs', 'sca2_research_run_rows', 'sca2_task_rows', 'sca_answers', 'sca_applicability',
618
+ 'sca_defect_sets', 'sca_package_texts', 'sca_set_members', 'schema_version', 'settings',
619
+ )