@kaeawc/auto-mobile 0.0.85 → 0.0.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/README.md.backup +3 -3
- package/dist/build-info.json +10 -10
- package/dist/src/index.js +1173 -840
- package/dist/src/utils/workers/iosBundleExtractWorker.js +3 -3
- package/node_modules/strtok3/lib/stream/StreamReader.js +6 -1
- package/node_modules/strtok3/package.json +1 -1
- package/package.json +21 -17
- package/dist/schemas/managed-slot-contract.json +0 -142
- package/dist/src/db/eventTables.ts +0 -8
- package/dist/src/db/migrations/2025_12_28_000_initial_schema.ts +0 -28
- package/dist/src/db/migrations/2025_12_30_000_performance_thresholds.ts +0 -85
- package/dist/src/db/migrations/2025_12_30_001_navigation_graph.ts +0 -223
- package/dist/src/db/migrations/2025_12_31_000_accessibility_baselines.ts +0 -34
- package/dist/src/db/migrations/2025_12_31_001_memory_audit.ts +0 -120
- package/dist/src/db/migrations/2026_01_01_000_recomposition_metrics.ts +0 -44
- package/dist/src/db/migrations/2026_01_02_000_prediction_history.ts +0 -87
- package/dist/src/db/migrations/2026_01_03_000_feature_flags.ts +0 -17
- package/dist/src/db/migrations/2026_01_03_000_test_executions.ts +0 -45
- package/dist/src/db/migrations/2026_01_05_000_tool_calls.ts +0 -31
- package/dist/src/db/migrations/2026_01_08_000_test_coverage.ts +0 -109
- package/dist/src/db/migrations/2026_01_09_000_video_recordings.ts +0 -66
- package/dist/src/db/migrations/2026_01_10_000_device_snapshots.ts +0 -54
- package/dist/src/db/migrations/2026_01_11_000_installed_apps.ts +0 -33
- package/dist/src/db/migrations/2026_01_11_000_video_recording_highlights.ts +0 -24
- package/dist/src/db/migrations/2026_01_13_000_installed_apps_session_tracking.ts +0 -27
- package/dist/src/db/migrations/2026_01_14_000_appearance_config.ts +0 -16
- package/dist/src/db/migrations/2026_01_25_000_navigation_screenshots.ts +0 -27
- package/dist/src/db/migrations/2026_01_25_001_test_run_details.ts +0 -97
- package/dist/src/db/migrations/2026_01_27_000_crash_anr_monitoring.ts +0 -204
- package/dist/src/db/migrations/2026_01_27_000_failures.ts +0 -217
- package/dist/src/db/migrations/2026_01_29_000_named_nodes.ts +0 -88
- package/dist/src/db/migrations/2026_01_30_000_performance_live_metrics.ts +0 -108
- package/dist/src/db/migrations/2026_03_15_000_telemetry_events.ts +0 -184
- package/dist/src/db/migrations/2026_03_18_000_navigation_events.ts +0 -36
- package/dist/src/db/migrations/2026_03_19_000_storage_events.ts +0 -37
- package/dist/src/db/migrations/2026_03_19_001_layout_events.ts +0 -39
- package/dist/src/db/migrations/2026_03_19_002_storage_events_previous_value.ts +0 -23
- package/dist/src/db/migrations/2026_03_19_003_layout_events_screen_name.ts +0 -23
- package/dist/src/db/migrations/2026_03_20_000_network_event_details.ts +0 -32
- package/dist/src/db/migrations/2026_04_01_000_drop_custom_events.ts +0 -41
- package/dist/src/db/migrations/2026_04_02_000_device_sessions.ts +0 -51
- package/dist/src/db/migrations/2026_07_01_000_failure_groups_signature_unique.ts +0 -162
- package/dist/src/db/migrations/2026_07_02_000_event_composite_indexes.ts +0 -62
- package/dist/src/db/migrations/2026_07_03_000_drop_redundant_device_indexes.ts +0 -66
- package/dist/src/db/migrations/2026_07_03_000_repair_datetime_now_defaults.ts +0 -278
- package/dist/src/db/migrations/2026_07_04_000_storage_events_key_lookup.ts +0 -60
- package/dist/src/db/migrations/2026_07_05_000_repair_updated_at_defaults.ts +0 -239
- package/dist/src/db/migrations/2026_07_24_000_device_locks.ts +0 -27
- package/dist/src/db/migrations/2026_07_27_000_session_tool_capabilities.ts +0 -17
- package/dist/src/db/migrations/2026_07_31_000_video_recordings_owner_session.ts +0 -39
- package/dist/src/db/migrations/2026_08_02_000_navigation_provenance.ts +0 -159
- package/dist/src/db/migrations/2026_08_17_000_emulator_loss_incidents.ts +0 -39
- package/dist/src/db/migrations/2026_08_22_000_provision_device_operations.ts +0 -21
- package/dist/src/db/migrations/2026_08_22_001_session_tool_overrides.ts +0 -106
- package/dist/src/db/migrations/2026_08_22_002_navigation_observation_eviction_index.ts +0 -67
- package/dist/src/db/migrations/2026_08_22_003_device_teardown_operations.ts +0 -19
- package/dist/src/db/migrations/2026_08_23_000_device_teardown_operation_owner.ts +0 -19
- package/dist/src/db/migrations/2026_08_23_001_default_existing_delete_device_disabled.ts +0 -26
- package/dist/src/db/migrations/2026_08_24_000_installed_apps_profile_type.ts +0 -15
- package/dist/src/db/migrations/2026_09_06_000_tool_selection_profile_provenance.ts +0 -36
- package/dist/src/db/migrations/2026_09_08_000_provision_device_operations_expiry.ts +0 -25
- package/dist/src/db/migrations/2026_09_10_000_provision_device_operation_attempt.ts +0 -25
- package/dist/src/db/migrations/2026_09_10_001_device_session_retention_index.ts +0 -14
- package/dist/src/db/migrations/2026_09_13_000_device_snapshot_vm_reclaim.ts +0 -63
- package/dist/src/db/migrations/2026_09_14_000_device_session_stable_identity.ts +0 -9
- package/dist/src/db/migrations/2026_09_14_001_device_session_identity_writer_fence.ts +0 -45
- package/dist/src/db/migrations/2026_09_16_000_device_session_liveness_owner.ts +0 -9
- package/dist/src/db/migrations/2026_09_16_001_device_session_liveness_contract.ts +0 -37
- package/dist/src/db/migrations/2026_09_17_000_device_session_liveness_writer_fence.ts +0 -48
- package/dist/src/db/migrations/2026_09_17_001_device_session_identity_fence_same_serial.ts +0 -53
- package/dist/src/db/migrations/2026_09_20_000_provision_device_lifecycle_outcome.ts +0 -32
- package/dist/src/db/migrations/2026_09_29_000_navigation_suggestion_provenance.ts +0 -41
- package/dist/src/db/migrations/2026_09_30_000_video_recording_display.ts +0 -17
- package/dist/src/db/migrations/2026_09_30_001_network_capture_fields.ts +0 -30
- package/dist/src/db/migrations/2026_10_05_000_device_locks_device_identity.ts +0 -28
- package/dist/src/db/migrations/2026_10_05_001_storage_events_key_lookup_insertion_order.ts +0 -38
- package/dist/src/db/migrations/2026_10_05_002_test_edge_coverage_edge_id_index.ts +0 -19
- package/dist/src/db/migrations/2026_10_09_000_device_resource_applications.ts +0 -22
- package/dist/src/db/migrations/2026_10_09_001_drop_provision_device_operations.ts +0 -32
- package/dist/src/db/migrations/2026_10_09_002_drop_device_teardown_operations.ts +0 -28
- package/dist/src/db/migrations/2026_10_12_000_rename_recording_tool_names.ts +0 -44
- package/dist/src/db/migrations/2026_10_12_001_video_recording_capture_teardown.ts +0 -17
- package/dist/src/db/migrations/2026_10_13_000_video_recording_recorder_daemon.ts +0 -17
- package/dist/src/index.js.map +0 -1
- package/dist/src/utils/workers/iosBundleExtractWorker.js.map +0 -1
- package/schemas/managed-slot-contract.json +0 -142
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { type Kysely, sql } from "kysely";
|
|
2
|
-
|
|
3
|
-
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
4
|
-
await createNavigationApps(db);
|
|
5
|
-
await createNavigationNodes(db);
|
|
6
|
-
await createNavigationEdges(db);
|
|
7
|
-
await createUIElements(db);
|
|
8
|
-
await createEdgeUIElements(db);
|
|
9
|
-
await createNodeModals(db);
|
|
10
|
-
await createEdgeModals(db);
|
|
11
|
-
await createScrollPositions(db);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async function createNavigationApps(db: Kysely<unknown>): Promise<void> {
|
|
15
|
-
// Create navigation_apps table
|
|
16
|
-
await db.schema
|
|
17
|
-
.createTable("navigation_apps")
|
|
18
|
-
.ifNotExists()
|
|
19
|
-
.addColumn("app_id", "text", (col) => col.primaryKey())
|
|
20
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
21
|
-
.addColumn("updated_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
22
|
-
.execute();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async function createNavigationNodes(db: Kysely<unknown>): Promise<void> {
|
|
26
|
-
// Create navigation_nodes table
|
|
27
|
-
await db.schema
|
|
28
|
-
.createTable("navigation_nodes")
|
|
29
|
-
.ifNotExists()
|
|
30
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
31
|
-
.addColumn("app_id", "text", (col) =>
|
|
32
|
-
col.notNull().references("navigation_apps.app_id").onDelete("cascade"),
|
|
33
|
-
)
|
|
34
|
-
.addColumn("screen_name", "text", (col) => col.notNull())
|
|
35
|
-
.addColumn("first_seen_at", "integer", (col) => col.notNull())
|
|
36
|
-
.addColumn("last_seen_at", "integer", (col) => col.notNull())
|
|
37
|
-
.addColumn("visit_count", "integer", (col) => col.notNull().defaultTo(1))
|
|
38
|
-
.addColumn("back_stack_depth", "integer")
|
|
39
|
-
.addColumn("task_id", "integer")
|
|
40
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
41
|
-
.execute();
|
|
42
|
-
|
|
43
|
-
// Create unique constraint on (app_id, screen_name)
|
|
44
|
-
await db.schema
|
|
45
|
-
.createIndex("idx_navigation_nodes_app_screen")
|
|
46
|
-
.ifNotExists()
|
|
47
|
-
.on("navigation_nodes")
|
|
48
|
-
.columns(["app_id", "screen_name"])
|
|
49
|
-
.unique()
|
|
50
|
-
.execute();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async function createNavigationEdges(db: Kysely<unknown>): Promise<void> {
|
|
54
|
-
// Create navigation_edges table
|
|
55
|
-
await db.schema
|
|
56
|
-
.createTable("navigation_edges")
|
|
57
|
-
.ifNotExists()
|
|
58
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
59
|
-
.addColumn("app_id", "text", (col) =>
|
|
60
|
-
col.notNull().references("navigation_apps.app_id").onDelete("cascade"),
|
|
61
|
-
)
|
|
62
|
-
.addColumn("from_screen", "text", (col) => col.notNull())
|
|
63
|
-
.addColumn("to_screen", "text", (col) => col.notNull())
|
|
64
|
-
.addColumn("tool_name", "text")
|
|
65
|
-
.addColumn("tool_args", "text")
|
|
66
|
-
.addColumn("timestamp", "integer", (col) => col.notNull())
|
|
67
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
68
|
-
.execute();
|
|
69
|
-
|
|
70
|
-
// Create indices for navigation_edges
|
|
71
|
-
await db.schema
|
|
72
|
-
.createIndex("idx_navigation_edges_app")
|
|
73
|
-
.ifNotExists()
|
|
74
|
-
.on("navigation_edges")
|
|
75
|
-
.column("app_id")
|
|
76
|
-
.execute();
|
|
77
|
-
|
|
78
|
-
await db.schema
|
|
79
|
-
.createIndex("idx_navigation_edges_from")
|
|
80
|
-
.ifNotExists()
|
|
81
|
-
.on("navigation_edges")
|
|
82
|
-
.column("from_screen")
|
|
83
|
-
.execute();
|
|
84
|
-
|
|
85
|
-
await db.schema
|
|
86
|
-
.createIndex("idx_navigation_edges_to")
|
|
87
|
-
.ifNotExists()
|
|
88
|
-
.on("navigation_edges")
|
|
89
|
-
.column("to_screen")
|
|
90
|
-
.execute();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
async function createUIElements(db: Kysely<unknown>): Promise<void> {
|
|
94
|
-
// Create ui_elements table
|
|
95
|
-
await db.schema
|
|
96
|
-
.createTable("ui_elements")
|
|
97
|
-
.ifNotExists()
|
|
98
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
99
|
-
.addColumn("app_id", "text", (col) =>
|
|
100
|
-
col.notNull().references("navigation_apps.app_id").onDelete("cascade"),
|
|
101
|
-
)
|
|
102
|
-
.addColumn("text", "text")
|
|
103
|
-
.addColumn("resource_id", "text")
|
|
104
|
-
.addColumn("content_description", "text")
|
|
105
|
-
.addColumn("class_name", "text")
|
|
106
|
-
.addColumn("bounds_left", "integer")
|
|
107
|
-
.addColumn("bounds_top", "integer")
|
|
108
|
-
.addColumn("bounds_right", "integer")
|
|
109
|
-
.addColumn("bounds_bottom", "integer")
|
|
110
|
-
.addColumn("clickable", "integer")
|
|
111
|
-
.addColumn("scrollable", "integer")
|
|
112
|
-
.addColumn("first_seen_at", "integer", (col) => col.notNull())
|
|
113
|
-
.addColumn("last_seen_at", "integer", (col) => col.notNull())
|
|
114
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
115
|
-
.execute();
|
|
116
|
-
|
|
117
|
-
// Create index on app_id for ui_elements
|
|
118
|
-
await db.schema
|
|
119
|
-
.createIndex("idx_ui_elements_app")
|
|
120
|
-
.ifNotExists()
|
|
121
|
-
.on("ui_elements")
|
|
122
|
-
.column("app_id")
|
|
123
|
-
.execute();
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
async function createEdgeUIElements(db: Kysely<unknown>): Promise<void> {
|
|
127
|
-
// Create edge_ui_elements junction table
|
|
128
|
-
await db.schema
|
|
129
|
-
.createTable("edge_ui_elements")
|
|
130
|
-
.ifNotExists()
|
|
131
|
-
.addColumn("edge_id", "integer", (col) =>
|
|
132
|
-
col.notNull().references("navigation_edges.id").onDelete("cascade"),
|
|
133
|
-
)
|
|
134
|
-
.addColumn("ui_element_id", "integer", (col) =>
|
|
135
|
-
col.notNull().references("ui_elements.id").onDelete("cascade"),
|
|
136
|
-
)
|
|
137
|
-
.addColumn("selection_order", "integer", (col) => col.notNull().defaultTo(0))
|
|
138
|
-
.execute();
|
|
139
|
-
|
|
140
|
-
// Create primary key for edge_ui_elements
|
|
141
|
-
await db.schema
|
|
142
|
-
.createIndex("idx_edge_ui_elements_pk")
|
|
143
|
-
.ifNotExists()
|
|
144
|
-
.on("edge_ui_elements")
|
|
145
|
-
.columns(["edge_id", "ui_element_id"])
|
|
146
|
-
.unique()
|
|
147
|
-
.execute();
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
async function createNodeModals(db: Kysely<unknown>): Promise<void> {
|
|
151
|
-
// Create node_modals table
|
|
152
|
-
await db.schema
|
|
153
|
-
.createTable("node_modals")
|
|
154
|
-
.ifNotExists()
|
|
155
|
-
.addColumn("node_id", "integer", (col) =>
|
|
156
|
-
col.notNull().references("navigation_nodes.id").onDelete("cascade"),
|
|
157
|
-
)
|
|
158
|
-
.addColumn("modal_identifier", "text", (col) => col.notNull())
|
|
159
|
-
.addColumn("stack_level", "integer", (col) => col.notNull())
|
|
160
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
161
|
-
.execute();
|
|
162
|
-
|
|
163
|
-
// Create primary key for node_modals
|
|
164
|
-
await db.schema
|
|
165
|
-
.createIndex("idx_node_modals_pk")
|
|
166
|
-
.ifNotExists()
|
|
167
|
-
.on("node_modals")
|
|
168
|
-
.columns(["node_id", "stack_level"])
|
|
169
|
-
.unique()
|
|
170
|
-
.execute();
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
async function createEdgeModals(db: Kysely<unknown>): Promise<void> {
|
|
174
|
-
// Create edge_modals table
|
|
175
|
-
await db.schema
|
|
176
|
-
.createTable("edge_modals")
|
|
177
|
-
.ifNotExists()
|
|
178
|
-
.addColumn("edge_id", "integer", (col) =>
|
|
179
|
-
col.notNull().references("navigation_edges.id").onDelete("cascade"),
|
|
180
|
-
)
|
|
181
|
-
.addColumn("position", "text", (col) => col.notNull())
|
|
182
|
-
.addColumn("modal_identifier", "text", (col) => col.notNull())
|
|
183
|
-
.addColumn("stack_level", "integer", (col) => col.notNull())
|
|
184
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
185
|
-
.execute();
|
|
186
|
-
|
|
187
|
-
// Create primary key for edge_modals
|
|
188
|
-
await db.schema
|
|
189
|
-
.createIndex("idx_edge_modals_pk")
|
|
190
|
-
.ifNotExists()
|
|
191
|
-
.on("edge_modals")
|
|
192
|
-
.columns(["edge_id", "position", "stack_level"])
|
|
193
|
-
.unique()
|
|
194
|
-
.execute();
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
async function createScrollPositions(db: Kysely<unknown>): Promise<void> {
|
|
198
|
-
// Create scroll_positions table
|
|
199
|
-
await db.schema
|
|
200
|
-
.createTable("scroll_positions")
|
|
201
|
-
.ifNotExists()
|
|
202
|
-
.addColumn("edge_id", "integer", (col) =>
|
|
203
|
-
col.primaryKey().references("navigation_edges.id").onDelete("cascade"),
|
|
204
|
-
)
|
|
205
|
-
.addColumn("target_element_id", "integer", (col) => col.notNull().references("ui_elements.id"))
|
|
206
|
-
.addColumn("container_element_id", "integer", (col) => col.references("ui_elements.id"))
|
|
207
|
-
.addColumn("direction", "text", (col) => col.notNull())
|
|
208
|
-
.addColumn("speed", "text")
|
|
209
|
-
.addColumn("swipe_count", "integer")
|
|
210
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
211
|
-
.execute();
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
215
|
-
await db.schema.dropTable("scroll_positions").execute();
|
|
216
|
-
await db.schema.dropTable("edge_modals").execute();
|
|
217
|
-
await db.schema.dropTable("node_modals").execute();
|
|
218
|
-
await db.schema.dropTable("edge_ui_elements").execute();
|
|
219
|
-
await db.schema.dropTable("ui_elements").execute();
|
|
220
|
-
await db.schema.dropTable("navigation_edges").execute();
|
|
221
|
-
await db.schema.dropTable("navigation_nodes").execute();
|
|
222
|
-
await db.schema.dropTable("navigation_apps").execute();
|
|
223
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { type Kysely, sql } from "kysely";
|
|
2
|
-
|
|
3
|
-
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
4
|
-
// Create accessibility_baselines table
|
|
5
|
-
await db.schema
|
|
6
|
-
.createTable("accessibility_baselines")
|
|
7
|
-
.ifNotExists()
|
|
8
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
9
|
-
.addColumn("screen_id", "text", (col) => col.notNull().unique())
|
|
10
|
-
.addColumn("violations_json", "text", (col) => col.notNull()) // JSON blob of WcagViolation[]
|
|
11
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
12
|
-
.addColumn("updated_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
13
|
-
.execute();
|
|
14
|
-
|
|
15
|
-
// Create index on screen_id for fast lookups
|
|
16
|
-
await db.schema
|
|
17
|
-
.createIndex("idx_accessibility_baselines_screen_id")
|
|
18
|
-
.ifNotExists()
|
|
19
|
-
.on("accessibility_baselines")
|
|
20
|
-
.column("screen_id")
|
|
21
|
-
.execute();
|
|
22
|
-
|
|
23
|
-
// Create index on updated_at for cleanup queries
|
|
24
|
-
await db.schema
|
|
25
|
-
.createIndex("idx_accessibility_baselines_updated_at")
|
|
26
|
-
.ifNotExists()
|
|
27
|
-
.on("accessibility_baselines")
|
|
28
|
-
.column("updated_at")
|
|
29
|
-
.execute();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
33
|
-
await db.schema.dropTable("accessibility_baselines").execute();
|
|
34
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { type Kysely, sql } from "kysely";
|
|
2
|
-
|
|
3
|
-
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
4
|
-
// Create memory_thresholds table for per-app threshold configuration
|
|
5
|
-
await db.schema
|
|
6
|
-
.createTable("memory_thresholds")
|
|
7
|
-
.ifNotExists()
|
|
8
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
9
|
-
.addColumn("device_id", "text", (col) => col.notNull())
|
|
10
|
-
.addColumn("package_name", "text", (col) => col.notNull())
|
|
11
|
-
.addColumn("heap_growth_threshold_mb", "real", (col) => col.notNull()) // Max heap growth after GC
|
|
12
|
-
.addColumn("native_heap_growth_threshold_mb", "real", (col) => col.notNull()) // Max native heap growth
|
|
13
|
-
.addColumn("gc_count_threshold", "integer", (col) => col.notNull()) // Max GC events per action
|
|
14
|
-
.addColumn("gc_duration_threshold_ms", "real", (col) => col.notNull()) // Max total GC pause time
|
|
15
|
-
.addColumn("unreachable_objects_threshold", "integer", (col) => col.notNull()) // Max unreachable objects
|
|
16
|
-
.addColumn("weight", "real", (col) => col.notNull().defaultTo(1.0)) // For weighted threshold calculation
|
|
17
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
18
|
-
.addColumn("ttl_hours", "integer", (col) => col.notNull().defaultTo(24)) // TTL in hours
|
|
19
|
-
.execute();
|
|
20
|
-
|
|
21
|
-
// Create index on device_id + package_name for fast lookups
|
|
22
|
-
await db.schema
|
|
23
|
-
.createIndex("idx_memory_thresholds_device_package")
|
|
24
|
-
.ifNotExists()
|
|
25
|
-
.on("memory_thresholds")
|
|
26
|
-
.columns(["device_id", "package_name"])
|
|
27
|
-
.execute();
|
|
28
|
-
|
|
29
|
-
// Create memory_baselines table for adaptive baseline tracking
|
|
30
|
-
await db.schema
|
|
31
|
-
.createTable("memory_baselines")
|
|
32
|
-
.ifNotExists()
|
|
33
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
34
|
-
.addColumn("device_id", "text", (col) => col.notNull())
|
|
35
|
-
.addColumn("package_name", "text", (col) => col.notNull())
|
|
36
|
-
.addColumn("tool_name", "text", (col) => col.notNull()) // Which tool action this baseline is for
|
|
37
|
-
.addColumn("java_heap_baseline_mb", "real", (col) => col.notNull())
|
|
38
|
-
.addColumn("native_heap_baseline_mb", "real", (col) => col.notNull())
|
|
39
|
-
.addColumn("gc_count_baseline", "real", (col) => col.notNull()) // Average GC count
|
|
40
|
-
.addColumn("gc_duration_baseline_ms", "real", (col) => col.notNull()) // Average GC duration
|
|
41
|
-
.addColumn("unreachable_objects_baseline", "real", (col) => col.notNull()) // Average unreachable count
|
|
42
|
-
.addColumn("sample_count", "integer", (col) => col.notNull().defaultTo(1)) // Number of samples in baseline
|
|
43
|
-
.addColumn("last_updated", "text", (col) => col.notNull())
|
|
44
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
45
|
-
.execute();
|
|
46
|
-
|
|
47
|
-
// Create unique index on device_id + package_name + tool_name
|
|
48
|
-
await db.schema
|
|
49
|
-
.createIndex("idx_memory_baselines_device_package_tool")
|
|
50
|
-
.ifNotExists()
|
|
51
|
-
.on("memory_baselines")
|
|
52
|
-
.columns(["device_id", "package_name", "tool_name"])
|
|
53
|
-
.unique()
|
|
54
|
-
.execute();
|
|
55
|
-
|
|
56
|
-
// Create memory_audit_results table to store audit outcomes
|
|
57
|
-
await db.schema
|
|
58
|
-
.createTable("memory_audit_results")
|
|
59
|
-
.ifNotExists()
|
|
60
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
61
|
-
.addColumn("device_id", "text", (col) => col.notNull())
|
|
62
|
-
.addColumn("session_id", "text", (col) => col.notNull())
|
|
63
|
-
.addColumn("package_name", "text", (col) => col.notNull())
|
|
64
|
-
.addColumn("tool_name", "text", (col) => col.notNull())
|
|
65
|
-
.addColumn("tool_args", "text") // JSON blob of tool arguments
|
|
66
|
-
.addColumn("timestamp", "text", (col) => col.notNull())
|
|
67
|
-
.addColumn("passed", "integer", (col) => col.notNull()) // 0 = failed, 1 = passed
|
|
68
|
-
// Pre-action measurements
|
|
69
|
-
.addColumn("pre_java_heap_mb", "real")
|
|
70
|
-
.addColumn("pre_native_heap_mb", "real")
|
|
71
|
-
.addColumn("pre_total_pss_mb", "real")
|
|
72
|
-
// Post-action measurements (after explicit GC)
|
|
73
|
-
.addColumn("post_java_heap_mb", "real")
|
|
74
|
-
.addColumn("post_native_heap_mb", "real")
|
|
75
|
-
.addColumn("post_total_pss_mb", "real")
|
|
76
|
-
// Deltas
|
|
77
|
-
.addColumn("java_heap_growth_mb", "real")
|
|
78
|
-
.addColumn("native_heap_growth_mb", "real")
|
|
79
|
-
.addColumn("total_pss_growth_mb", "real")
|
|
80
|
-
// GC metrics
|
|
81
|
-
.addColumn("gc_count", "integer")
|
|
82
|
-
.addColumn("gc_total_duration_ms", "real")
|
|
83
|
-
// Unreachable objects
|
|
84
|
-
.addColumn("unreachable_objects_count", "integer")
|
|
85
|
-
// Diagnostics
|
|
86
|
-
.addColumn("violations_json", "text") // JSON array of MemoryViolation[]
|
|
87
|
-
.addColumn("diagnostics_json", "text") // JSON blob for detailed diagnostics
|
|
88
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
89
|
-
.execute();
|
|
90
|
-
|
|
91
|
-
// Create index on device_id + timestamp for historical queries
|
|
92
|
-
await db.schema
|
|
93
|
-
.createIndex("idx_memory_audit_results_device_timestamp")
|
|
94
|
-
.ifNotExists()
|
|
95
|
-
.on("memory_audit_results")
|
|
96
|
-
.columns(["device_id", "timestamp"])
|
|
97
|
-
.execute();
|
|
98
|
-
|
|
99
|
-
// Create index on package_name + timestamp for app-specific queries
|
|
100
|
-
await db.schema
|
|
101
|
-
.createIndex("idx_memory_audit_results_package_timestamp")
|
|
102
|
-
.ifNotExists()
|
|
103
|
-
.on("memory_audit_results")
|
|
104
|
-
.columns(["package_name", "timestamp"])
|
|
105
|
-
.execute();
|
|
106
|
-
|
|
107
|
-
// Create index on passed for filtering failures
|
|
108
|
-
await db.schema
|
|
109
|
-
.createIndex("idx_memory_audit_results_passed")
|
|
110
|
-
.ifNotExists()
|
|
111
|
-
.on("memory_audit_results")
|
|
112
|
-
.column("passed")
|
|
113
|
-
.execute();
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
117
|
-
await db.schema.dropTable("memory_audit_results").execute();
|
|
118
|
-
await db.schema.dropTable("memory_baselines").execute();
|
|
119
|
-
await db.schema.dropTable("memory_thresholds").execute();
|
|
120
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Kysely, sql } from "kysely";
|
|
2
|
-
|
|
3
|
-
export async function up(db: Kysely<any>): Promise<void> {
|
|
4
|
-
await db.schema
|
|
5
|
-
.createTable("recomposition_metrics")
|
|
6
|
-
.ifNotExists()
|
|
7
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
8
|
-
.addColumn("device_id", "text", (col) => col.notNull())
|
|
9
|
-
.addColumn("session_id", "text", (col) => col.notNull())
|
|
10
|
-
.addColumn("package_name", "text", (col) => col.notNull())
|
|
11
|
-
.addColumn("composable_id", "text", (col) => col.notNull())
|
|
12
|
-
.addColumn("composable_name", "text")
|
|
13
|
-
.addColumn("resource_id", "text")
|
|
14
|
-
.addColumn("test_tag", "text")
|
|
15
|
-
.addColumn("total_count", "integer", (col) => col.notNull())
|
|
16
|
-
.addColumn("skip_count", "integer", (col) => col.notNull())
|
|
17
|
-
.addColumn("rolling_1s_avg", "real")
|
|
18
|
-
.addColumn("duration_ms", "real")
|
|
19
|
-
.addColumn("likely_cause", "text")
|
|
20
|
-
.addColumn("parent_chain_json", "text")
|
|
21
|
-
.addColumn("stable_annotated", "integer")
|
|
22
|
-
.addColumn("remembered_count", "integer")
|
|
23
|
-
.addColumn("timestamp", "text", (col) => col.notNull())
|
|
24
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(CURRENT_TIMESTAMP)`))
|
|
25
|
-
.execute();
|
|
26
|
-
|
|
27
|
-
await db.schema
|
|
28
|
-
.createIndex("idx_recomposition_metrics_timestamp")
|
|
29
|
-
.ifNotExists()
|
|
30
|
-
.on("recomposition_metrics")
|
|
31
|
-
.column("timestamp")
|
|
32
|
-
.execute();
|
|
33
|
-
|
|
34
|
-
await db.schema
|
|
35
|
-
.createIndex("idx_recomposition_metrics_composable")
|
|
36
|
-
.ifNotExists()
|
|
37
|
-
.on("recomposition_metrics")
|
|
38
|
-
.columns(["package_name", "composable_id", "timestamp"])
|
|
39
|
-
.execute();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export async function down(db: Kysely<any>): Promise<void> {
|
|
43
|
-
await db.schema.dropTable("recomposition_metrics").execute();
|
|
44
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { type Kysely, sql } from "kysely";
|
|
2
|
-
|
|
3
|
-
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
4
|
-
await db.schema
|
|
5
|
-
.createTable("prediction_outcomes")
|
|
6
|
-
.ifNotExists()
|
|
7
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
8
|
-
.addColumn("app_id", "text", (col) =>
|
|
9
|
-
col.notNull().references("navigation_apps.app_id").onDelete("cascade"),
|
|
10
|
-
)
|
|
11
|
-
.addColumn("prediction_id", "text", (col) => col.notNull())
|
|
12
|
-
.addColumn("timestamp", "integer", (col) => col.notNull())
|
|
13
|
-
.addColumn("from_screen", "text", (col) => col.notNull())
|
|
14
|
-
.addColumn("predicted_screen", "text", (col) => col.notNull())
|
|
15
|
-
.addColumn("actual_screen", "text", (col) => col.notNull())
|
|
16
|
-
.addColumn("tool_name", "text", (col) => col.notNull())
|
|
17
|
-
.addColumn("tool_args", "text", (col) => col.notNull().defaultTo(""))
|
|
18
|
-
.addColumn("predicted_elements", "text")
|
|
19
|
-
.addColumn("found_elements", "text")
|
|
20
|
-
.addColumn("confidence", "real", (col) => col.notNull())
|
|
21
|
-
.addColumn("match_score", "real", (col) => col.notNull())
|
|
22
|
-
.addColumn("correct", "integer", (col) => col.notNull())
|
|
23
|
-
.addColumn("partial_match", "integer", (col) => col.notNull())
|
|
24
|
-
.addColumn("error_type", "text")
|
|
25
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
26
|
-
.execute();
|
|
27
|
-
|
|
28
|
-
await db.schema
|
|
29
|
-
.createIndex("idx_prediction_outcomes_app")
|
|
30
|
-
.ifNotExists()
|
|
31
|
-
.on("prediction_outcomes")
|
|
32
|
-
.column("app_id")
|
|
33
|
-
.execute();
|
|
34
|
-
|
|
35
|
-
await db.schema
|
|
36
|
-
.createIndex("idx_prediction_outcomes_from")
|
|
37
|
-
.ifNotExists()
|
|
38
|
-
.on("prediction_outcomes")
|
|
39
|
-
.column("from_screen")
|
|
40
|
-
.execute();
|
|
41
|
-
|
|
42
|
-
await db.schema
|
|
43
|
-
.createIndex("idx_prediction_outcomes_predicted")
|
|
44
|
-
.ifNotExists()
|
|
45
|
-
.on("prediction_outcomes")
|
|
46
|
-
.column("predicted_screen")
|
|
47
|
-
.execute();
|
|
48
|
-
|
|
49
|
-
await db.schema
|
|
50
|
-
.createIndex("idx_prediction_outcomes_tool")
|
|
51
|
-
.ifNotExists()
|
|
52
|
-
.on("prediction_outcomes")
|
|
53
|
-
.column("tool_name")
|
|
54
|
-
.execute();
|
|
55
|
-
|
|
56
|
-
await db.schema
|
|
57
|
-
.createTable("prediction_transition_stats")
|
|
58
|
-
.ifNotExists()
|
|
59
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
60
|
-
.addColumn("app_id", "text", (col) =>
|
|
61
|
-
col.notNull().references("navigation_apps.app_id").onDelete("cascade"),
|
|
62
|
-
)
|
|
63
|
-
.addColumn("from_screen", "text", (col) => col.notNull())
|
|
64
|
-
.addColumn("to_screen", "text", (col) => col.notNull())
|
|
65
|
-
.addColumn("tool_name", "text", (col) => col.notNull())
|
|
66
|
-
.addColumn("tool_args", "text", (col) => col.notNull().defaultTo(""))
|
|
67
|
-
.addColumn("attempts", "integer", (col) => col.notNull())
|
|
68
|
-
.addColumn("successes", "integer", (col) => col.notNull())
|
|
69
|
-
.addColumn("total_confidence", "real", (col) => col.notNull())
|
|
70
|
-
.addColumn("brier_score_sum", "real", (col) => col.notNull())
|
|
71
|
-
.addColumn("updated_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
72
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
73
|
-
.execute();
|
|
74
|
-
|
|
75
|
-
await db.schema
|
|
76
|
-
.createIndex("idx_prediction_transition_key")
|
|
77
|
-
.ifNotExists()
|
|
78
|
-
.on("prediction_transition_stats")
|
|
79
|
-
.columns(["app_id", "from_screen", "to_screen", "tool_name", "tool_args"])
|
|
80
|
-
.unique()
|
|
81
|
-
.execute();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
85
|
-
await db.schema.dropTable("prediction_transition_stats").execute();
|
|
86
|
-
await db.schema.dropTable("prediction_outcomes").execute();
|
|
87
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type Kysely, sql } from "kysely";
|
|
2
|
-
|
|
3
|
-
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
4
|
-
await db.schema
|
|
5
|
-
.createTable("feature_flags")
|
|
6
|
-
.ifNotExists()
|
|
7
|
-
.addColumn("key", "text", (col) => col.primaryKey())
|
|
8
|
-
.addColumn("enabled", "integer", (col) => col.notNull().defaultTo(0))
|
|
9
|
-
.addColumn("config_json", "text")
|
|
10
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
11
|
-
.addColumn("updated_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
12
|
-
.execute();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
16
|
-
await db.schema.dropTable("feature_flags").execute();
|
|
17
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { type Kysely, sql } from "kysely";
|
|
2
|
-
|
|
3
|
-
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
4
|
-
await db.schema
|
|
5
|
-
.createTable("test_executions")
|
|
6
|
-
.ifNotExists()
|
|
7
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
8
|
-
.addColumn("test_class", "text", (col) => col.notNull())
|
|
9
|
-
.addColumn("test_method", "text", (col) => col.notNull())
|
|
10
|
-
.addColumn("duration_ms", "integer", (col) => col.notNull())
|
|
11
|
-
.addColumn("status", "text", (col) => col.notNull())
|
|
12
|
-
.addColumn("timestamp", "integer", (col) => col.notNull())
|
|
13
|
-
.addColumn("device_id", "text")
|
|
14
|
-
.addColumn("device_name", "text")
|
|
15
|
-
.addColumn("device_platform", "text")
|
|
16
|
-
.addColumn("device_type", "text")
|
|
17
|
-
.addColumn("app_version", "text")
|
|
18
|
-
.addColumn("git_commit", "text")
|
|
19
|
-
.addColumn("target_sdk", "integer")
|
|
20
|
-
.addColumn("jdk_version", "text")
|
|
21
|
-
.addColumn("jvm_target", "text")
|
|
22
|
-
.addColumn("gradle_version", "text")
|
|
23
|
-
.addColumn("is_ci", "integer")
|
|
24
|
-
.addColumn("session_uuid", "text")
|
|
25
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
26
|
-
.execute();
|
|
27
|
-
|
|
28
|
-
await db.schema
|
|
29
|
-
.createIndex("idx_test_executions_lookup")
|
|
30
|
-
.ifNotExists()
|
|
31
|
-
.on("test_executions")
|
|
32
|
-
.columns(["test_class", "test_method"])
|
|
33
|
-
.execute();
|
|
34
|
-
|
|
35
|
-
await db.schema
|
|
36
|
-
.createIndex("idx_test_executions_timestamp")
|
|
37
|
-
.ifNotExists()
|
|
38
|
-
.on("test_executions")
|
|
39
|
-
.column("timestamp")
|
|
40
|
-
.execute();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
44
|
-
await db.schema.dropTable("test_executions").execute();
|
|
45
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type Kysely, sql } from "kysely";
|
|
2
|
-
|
|
3
|
-
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
4
|
-
await db.schema
|
|
5
|
-
.createTable("tool_calls")
|
|
6
|
-
.ifNotExists()
|
|
7
|
-
.addColumn("id", "integer", (col) => col.primaryKey().autoIncrement())
|
|
8
|
-
.addColumn("tool_name", "text", (col) => col.notNull())
|
|
9
|
-
.addColumn("timestamp", "text", (col) => col.notNull())
|
|
10
|
-
.addColumn("session_uuid", "text")
|
|
11
|
-
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(sql`(datetime('now'))`))
|
|
12
|
-
.execute();
|
|
13
|
-
|
|
14
|
-
await db.schema
|
|
15
|
-
.createIndex("idx_tool_calls_timestamp")
|
|
16
|
-
.ifNotExists()
|
|
17
|
-
.on("tool_calls")
|
|
18
|
-
.column("timestamp")
|
|
19
|
-
.execute();
|
|
20
|
-
|
|
21
|
-
await db.schema
|
|
22
|
-
.createIndex("idx_tool_calls_session_uuid")
|
|
23
|
-
.ifNotExists()
|
|
24
|
-
.on("tool_calls")
|
|
25
|
-
.column("session_uuid")
|
|
26
|
-
.execute();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
30
|
-
await db.schema.dropTable("tool_calls").execute();
|
|
31
|
-
}
|