opencode-windows-scheduler 1.1.0 → 1.2.1

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 (144) hide show
  1. package/CHANGELOG.md +60 -1
  2. package/README.md +18 -8
  3. package/README.ru.md +13 -3
  4. package/ROADMAP-STRATEGY.md +2 -2
  5. package/ROADMAP.md +51 -18
  6. package/dist/core/analytics.d.ts +10 -0
  7. package/dist/core/analytics.d.ts.map +1 -1
  8. package/dist/core/analytics.js +21 -0
  9. package/dist/core/dry-run.d.ts +18 -1
  10. package/dist/core/dry-run.d.ts.map +1 -1
  11. package/dist/core/dry-run.js +49 -3
  12. package/dist/core/matrix.d.ts.map +1 -1
  13. package/dist/core/matrix.js +10 -0
  14. package/dist/core/one-shot.d.ts +62 -0
  15. package/dist/core/one-shot.d.ts.map +1 -0
  16. package/dist/core/one-shot.js +126 -0
  17. package/dist/core/otel.d.ts +4 -0
  18. package/dist/core/otel.d.ts.map +1 -0
  19. package/dist/core/otel.js +98 -0
  20. package/dist/core/prometheus.d.ts +23 -0
  21. package/dist/core/prometheus.d.ts.map +1 -0
  22. package/dist/core/prometheus.js +146 -0
  23. package/dist/core/ps-wrapper.d.ts +36 -2
  24. package/dist/core/ps-wrapper.d.ts.map +1 -1
  25. package/dist/core/ps-wrapper.js +124 -4
  26. package/dist/core/record-history.d.ts.map +1 -1
  27. package/dist/core/record-history.js +9 -0
  28. package/dist/core/schedule-gate.d.ts +2 -0
  29. package/dist/core/schedule-gate.d.ts.map +1 -0
  30. package/dist/core/schedule-gate.js +182 -0
  31. package/dist/core/schedule-v2.d.ts +88 -0
  32. package/dist/core/schedule-v2.d.ts.map +1 -0
  33. package/dist/core/schedule-v2.js +496 -0
  34. package/dist/core/scheduler/linux.d.ts +12 -3
  35. package/dist/core/scheduler/linux.d.ts.map +1 -1
  36. package/dist/core/scheduler/linux.js +80 -3
  37. package/dist/core/scheduler/mac.d.ts.map +1 -1
  38. package/dist/core/scheduler/mac.js +17 -3
  39. package/dist/core/scheduler/posix.d.ts.map +1 -1
  40. package/dist/core/scheduler/posix.js +3 -0
  41. package/dist/core/scheduler/registry.d.ts +4 -0
  42. package/dist/core/scheduler/registry.d.ts.map +1 -1
  43. package/dist/core/scheduler/types.d.ts +20 -3
  44. package/dist/core/scheduler/types.d.ts.map +1 -1
  45. package/dist/core/scheduler/windows.d.ts.map +1 -1
  46. package/dist/core/scheduler/windows.js +23 -2
  47. package/dist/core/session.d.ts +34 -0
  48. package/dist/core/session.d.ts.map +1 -0
  49. package/dist/core/session.js +105 -0
  50. package/dist/core/structured-log.d.ts +84 -0
  51. package/dist/core/structured-log.d.ts.map +1 -0
  52. package/dist/core/structured-log.js +137 -0
  53. package/dist/core/wrappers/bash.d.ts +24 -0
  54. package/dist/core/wrappers/bash.d.ts.map +1 -1
  55. package/dist/core/wrappers/bash.js +70 -3
  56. package/dist/db/history-repo.d.ts +8 -0
  57. package/dist/db/history-repo.d.ts.map +1 -1
  58. package/dist/db/history-repo.js +76 -6
  59. package/dist/db/metrics-repo.d.ts +3 -0
  60. package/dist/db/metrics-repo.d.ts.map +1 -1
  61. package/dist/db/metrics-repo.js +16 -8
  62. package/dist/db/migrate.d.ts.map +1 -1
  63. package/dist/db/migrate.js +8 -1
  64. package/dist/db/schema.d.ts +1 -1
  65. package/dist/db/schema.d.ts.map +1 -1
  66. package/dist/db/schema.js +19 -0
  67. package/dist/gui-experimental.cjs +1 -0
  68. package/dist/history.d.ts +7 -0
  69. package/dist/history.d.ts.map +1 -1
  70. package/dist/history.js +13 -0
  71. package/dist/index.d.ts +137 -1
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +1323 -78
  74. package/dist/integrations.d.ts +64 -0
  75. package/dist/integrations.d.ts.map +1 -0
  76. package/dist/integrations.js +205 -0
  77. package/dist/notifications.d.ts +112 -6
  78. package/dist/notifications.d.ts.map +1 -1
  79. package/dist/notifications.js +396 -34
  80. package/dist/profiles.d.ts +60 -0
  81. package/dist/profiles.d.ts.map +1 -0
  82. package/dist/profiles.js +209 -0
  83. package/dist/rpc.d.ts +592 -4
  84. package/dist/rpc.d.ts.map +1 -1
  85. package/dist/rpc.js +233 -6
  86. package/dist/server.d.ts +2 -0
  87. package/dist/server.d.ts.map +1 -1
  88. package/dist/server.js +473 -58
  89. package/dist/settings.d.ts +95 -0
  90. package/dist/settings.d.ts.map +1 -1
  91. package/dist/settings.js +186 -8
  92. package/dist/shared/jobs-view.d.ts +43 -5
  93. package/dist/shared/jobs-view.d.ts.map +1 -1
  94. package/dist/shared/jobs-view.js +125 -7
  95. package/dist/task-transfer.d.ts +32 -3
  96. package/dist/task-transfer.d.ts.map +1 -1
  97. package/dist/task-transfer.js +101 -3
  98. package/dist/types.d.ts.map +1 -1
  99. package/dist/types.js +3 -11
  100. package/dist/workspaces.d.ts +43 -0
  101. package/dist/workspaces.d.ts.map +1 -1
  102. package/dist/workspaces.js +174 -8
  103. package/docs/ARCHITECTURE.md +32 -12
  104. package/docs/FEATURES.md +186 -10
  105. package/gui-experimental.cjs +4 -2
  106. package/package.json +15 -2
  107. package/scripts/demo-dashboard.mjs +12 -2
  108. package/src/core/analytics.ts +36 -0
  109. package/src/core/dry-run.ts +65 -4
  110. package/src/core/matrix.ts +10 -0
  111. package/src/core/one-shot.ts +173 -0
  112. package/src/core/otel.ts +128 -0
  113. package/src/core/prometheus.ts +215 -0
  114. package/src/core/ps-wrapper.ts +144 -4
  115. package/src/core/record-history.ts +13 -0
  116. package/src/core/schedule-gate.ts +213 -0
  117. package/src/core/schedule-v2.ts +533 -0
  118. package/src/core/scheduler/linux.ts +90 -3
  119. package/src/core/scheduler/mac.ts +35 -4
  120. package/src/core/scheduler/posix.ts +3 -0
  121. package/src/core/scheduler/registry.ts +4 -0
  122. package/src/core/scheduler/types.ts +20 -3
  123. package/src/core/scheduler/windows.ts +24 -2
  124. package/src/core/session.ts +115 -0
  125. package/src/core/structured-log.ts +205 -0
  126. package/src/core/wrappers/bash.ts +98 -2
  127. package/src/db/history-repo.ts +90 -7
  128. package/src/db/metrics-repo.ts +19 -7
  129. package/src/db/migrate.ts +7 -1
  130. package/src/db/schema.ts +25 -0
  131. package/src/gui.tsx +3832 -2868
  132. package/src/history.ts +17 -0
  133. package/src/index.ts +1670 -117
  134. package/src/integrations.ts +253 -0
  135. package/src/notifications.ts +516 -40
  136. package/src/profiles.ts +236 -0
  137. package/src/rpc.ts +244 -6
  138. package/src/server.ts +506 -58
  139. package/src/settings.ts +336 -9
  140. package/src/shared/jobs-view.ts +158 -8
  141. package/src/task-transfer.ts +151 -5
  142. package/src/tui.tsx +290 -14
  143. package/src/types.ts +3 -13
  144. package/src/workspaces.ts +214 -8
@@ -1,5 +1,6 @@
1
1
  import { getDb, withTransaction } from "./index.js";
2
2
  import { incrementMetricsUnsafe } from "./metrics-repo.js";
3
+ import { appendStructuredLog } from "../core/structured-log.js";
3
4
  import type { TaskStatus } from "../history.js";
4
5
 
5
6
  /**
@@ -117,7 +118,7 @@ export function startRun(
117
118
  allowedTools?: string[] | null,
118
119
  deniedTools?: string[] | null
119
120
  ): number {
120
- return insertHistory({
121
+ const id = insertHistory({
121
122
  taskName,
122
123
  status: "running",
123
124
  startedAt,
@@ -126,6 +127,16 @@ export function startRun(
126
127
  allowedTools,
127
128
  deniedTools,
128
129
  });
130
+ appendStructuredLog({
131
+ event: "run.started",
132
+ runId: id,
133
+ task: taskName,
134
+ status: "running",
135
+ startedAt,
136
+ workspaceId: workspaceId ?? null,
137
+ source: "startRun",
138
+ });
139
+ return id;
129
140
  }
130
141
 
131
142
  /**
@@ -144,7 +155,11 @@ export function finishRun(
144
155
  preFlightStatus?: "success" | "error" | "skipped",
145
156
  postFlightStatus?: "success" | "error" | "skipped"
146
157
  ): boolean {
147
- return withTransaction(() => {
158
+ const safeDuration = Number.isFinite(durationMs) ? Math.max(0, Math.floor(durationMs)) : 0;
159
+ const finishedAt = new Date().toISOString();
160
+ let completed: { taskName: string; startedAt: string } | null = null;
161
+
162
+ const ok = withTransaction(() => {
148
163
  const instance = getDb();
149
164
  const row = instance
150
165
  .prepare("SELECT finished_at FROM history WHERE id = ?")
@@ -161,8 +176,8 @@ export function finishRun(
161
176
  )
162
177
  .run(
163
178
  status,
164
- new Date().toISOString(),
165
- Number.isFinite(durationMs) ? Math.max(0, Math.floor(durationMs)) : 0,
179
+ finishedAt,
180
+ safeDuration,
166
181
  error ?? null,
167
182
  nextTask ?? null,
168
183
  tokens ?? null,
@@ -174,11 +189,36 @@ export function finishRun(
174
189
  );
175
190
 
176
191
  const taskRow = instance
177
- .prepare("SELECT task_name FROM history WHERE id = ?")
192
+ .prepare("SELECT task_name, started_at FROM history WHERE id = ?")
178
193
  .get(id) as any;
179
194
  incrementMetricsUnsafe(String(taskRow.task_name), status, tokens, costUsd);
195
+ completed = {
196
+ taskName: String(taskRow.task_name),
197
+ startedAt: String(taskRow.started_at),
198
+ };
180
199
  return true;
181
200
  });
201
+
202
+ if (ok && completed) {
203
+ const done = completed as { taskName: string; startedAt: string };
204
+ appendStructuredLog({
205
+ event: "run.finished",
206
+ runId: id,
207
+ task: done.taskName,
208
+ status,
209
+ startedAt: done.startedAt,
210
+ finishedAt,
211
+ durationMs: safeDuration,
212
+ error: error ?? null,
213
+ nextTask: nextTask ?? null,
214
+ tokens,
215
+ costUsd,
216
+ model,
217
+ preFlightStatus,
218
+ postFlightStatus,
219
+ });
220
+ }
221
+ return ok;
182
222
  }
183
223
 
184
224
  /**
@@ -202,7 +242,8 @@ export function recordRun(
202
242
  allowedTools?: string[] | null,
203
243
  deniedTools?: string[] | null
204
244
  ): number {
205
- return withTransaction(() => {
245
+ const safeDuration = Math.max(0, Math.floor(Number(durationMs) || 0));
246
+ const id = withTransaction(() => {
206
247
  const result = getDb()
207
248
  .prepare(INSERT_SQL)
208
249
  .run(
@@ -210,7 +251,7 @@ export function recordRun(
210
251
  status,
211
252
  startedAt,
212
253
  finishedAt,
213
- Math.max(0, Math.floor(Number(durationMs) || 0)),
254
+ safeDuration,
214
255
  error ?? null,
215
256
  tokens ?? null,
216
257
  costUsd ?? null,
@@ -225,6 +266,25 @@ export function recordRun(
225
266
  incrementMetricsUnsafe(taskName, status, tokens, costUsd);
226
267
  return lastId(result);
227
268
  });
269
+
270
+ appendStructuredLog({
271
+ event: "run.finished",
272
+ runId: id,
273
+ task: taskName,
274
+ status,
275
+ startedAt,
276
+ finishedAt,
277
+ durationMs: safeDuration,
278
+ error: error ?? null,
279
+ nextTask: nextTask ?? null,
280
+ tokens,
281
+ costUsd,
282
+ model,
283
+ workspaceId: workspaceId ?? null,
284
+ preFlightStatus,
285
+ postFlightStatus,
286
+ });
287
+ return id;
228
288
  }
229
289
 
230
290
  /** История запусков (новые сверху). Без taskName — по всем задачам. */
@@ -310,6 +370,29 @@ export function countRunningRecords(): number {
310
370
  return Number(row?.count) || 0;
311
371
  }
312
372
 
373
+ /** Запись о незавершённом запуске — для детектора зависших матриц (Спринт 20). */
374
+ export interface RunningHistoryRecord {
375
+ id: number;
376
+ taskName: string;
377
+ startedAt: string;
378
+ }
379
+
380
+ /** Список активных запусков (finished_at IS NULL), самые старые сверху. */
381
+ export function listRunningRecords(): RunningHistoryRecord[] {
382
+ const rows = getDb()
383
+ .prepare(
384
+ `SELECT id, task_name, started_at FROM history
385
+ WHERE finished_at IS NULL
386
+ ORDER BY started_at ASC, id ASC`
387
+ )
388
+ .all() as any[];
389
+ return rows.map((row) => ({
390
+ id: Number(row.id) || 0,
391
+ taskName: String(row.task_name ?? ""),
392
+ startedAt: String(row.started_at ?? ""),
393
+ }));
394
+ }
395
+
313
396
  /** Параметры очистки истории (Спринт 18). 0 — ограничение выключено. */
314
397
  export interface PruneHistoryOptions {
315
398
  /** Удалять завершённые записи старше N дней. */
@@ -16,6 +16,8 @@ export interface TaskMetricsRow {
16
16
  total: number;
17
17
  success: number;
18
18
  error: number;
19
+ /** Частичные выполнения: ответ получен, но post-flight/quality gate не прошёл. */
20
+ partial: number;
19
21
  tokens: number;
20
22
  costUsd: number;
21
23
  }
@@ -24,6 +26,7 @@ export interface MetricsTotals {
24
26
  total: number;
25
27
  success: number;
26
28
  error: number;
29
+ partial: number;
27
30
  tokens: number;
28
31
  costUsd: number;
29
32
  }
@@ -41,6 +44,7 @@ function rowToMetrics(row: any): TaskMetricsRow {
41
44
  total: Number(row.total) || 0,
42
45
  success: Number(row.success) || 0,
43
46
  error: Number(row.error) || 0,
47
+ partial: Number(row.partial) || 0,
44
48
  tokens: Number(row.total_tokens) || 0,
45
49
  costUsd: Number(row.total_cost) || 0,
46
50
  };
@@ -53,23 +57,27 @@ export function incrementMetricsUnsafe(
53
57
  tokens = 0,
54
58
  costUsd = 0
55
59
  ): void {
60
+ // error — только ошибки и таймауты; partial хранится отдельным счётчиком,
61
+ // иначе дашборд показывал частичный запуск как обычную ошибку.
56
62
  const success = status === "success" ? 1 : 0;
57
- const error = status === "success" ? 0 : 1;
63
+ const partial = status === "partial" ? 1 : 0;
64
+ const error = status === "error" || status === "timeout" ? 1 : 0;
58
65
  const safeTokens = Number.isFinite(tokens) && tokens > 0 ? Math.floor(tokens) : 0;
59
66
  const safeCost = Number.isFinite(costUsd) && costUsd > 0 ? costUsd : 0;
60
67
 
61
68
  getDb()
62
69
  .prepare(
63
- `INSERT INTO metrics (task_name, total, success, error, total_tokens, total_cost)
64
- VALUES (?, 1, ?, ?, ?, ?)
70
+ `INSERT INTO metrics (task_name, total, success, error, partial, total_tokens, total_cost)
71
+ VALUES (?, 1, ?, ?, ?, ?, ?)
65
72
  ON CONFLICT(task_name) DO UPDATE SET
66
73
  total = total + 1,
67
74
  success = success + excluded.success,
68
75
  error = error + excluded.error,
76
+ partial = partial + excluded.partial,
69
77
  total_tokens = total_tokens + excluded.total_tokens,
70
78
  total_cost = total_cost + excluded.total_cost`
71
79
  )
72
- .run(taskName, success, error, safeTokens, safeCost);
80
+ .run(taskName, success, error, partial, safeTokens, safeCost);
73
81
  }
74
82
 
75
83
  /** Атомарно увеличивает счётчики задачи: +1 запуск, +1 success/error, токены, стоимость. */
@@ -88,7 +96,7 @@ export function getMetrics(taskName: string): TaskMetricsRow {
88
96
  .prepare("SELECT * FROM metrics WHERE lower(task_name) = lower(?) LIMIT 1")
89
97
  .get(taskName) as any;
90
98
  if (!row) {
91
- return { taskName, total: 0, success: 0, error: 0, tokens: 0, costUsd: 0 };
99
+ return { taskName, total: 0, success: 0, error: 0, partial: 0, tokens: 0, costUsd: 0 };
92
100
  }
93
101
  return rowToMetrics(row);
94
102
  }
@@ -109,6 +117,7 @@ export function getTotals(): MetricsTotals {
109
117
  COALESCE(SUM(total), 0) AS total,
110
118
  COALESCE(SUM(success), 0) AS success,
111
119
  COALESCE(SUM(error), 0) AS error,
120
+ COALESCE(SUM(partial), 0) AS partial,
112
121
  COALESCE(SUM(total_tokens), 0) AS tokens,
113
122
  COALESCE(SUM(total_cost), 0) AS cost_usd
114
123
  FROM metrics`
@@ -118,6 +127,7 @@ export function getTotals(): MetricsTotals {
118
127
  total: Number(row?.total) || 0,
119
128
  success: Number(row?.success) || 0,
120
129
  error: Number(row?.error) || 0,
130
+ partial: Number(row?.partial) || 0,
121
131
  tokens: Number(row?.tokens) || 0,
122
132
  costUsd: Number(row?.cost_usd) || 0,
123
133
  };
@@ -132,12 +142,13 @@ export function incrementGlobalMetrics(status: TaskStatus): void {
132
142
  export function upsertMetricsRow(row: TaskMetricsRow): void {
133
143
  getDb()
134
144
  .prepare(
135
- `INSERT INTO metrics (task_name, total, success, error, total_tokens, total_cost)
136
- VALUES (?, ?, ?, ?, ?, ?)
145
+ `INSERT INTO metrics (task_name, total, success, error, partial, total_tokens, total_cost)
146
+ VALUES (?, ?, ?, ?, ?, ?, ?)
137
147
  ON CONFLICT(task_name) DO UPDATE SET
138
148
  total = excluded.total,
139
149
  success = excluded.success,
140
150
  error = excluded.error,
151
+ partial = excluded.partial,
141
152
  total_tokens = excluded.total_tokens,
142
153
  total_cost = excluded.total_cost`
143
154
  )
@@ -146,6 +157,7 @@ export function upsertMetricsRow(row: TaskMetricsRow): void {
146
157
  Math.max(0, Math.floor(row.total)),
147
158
  Math.max(0, Math.floor(row.success)),
148
159
  Math.max(0, Math.floor(row.error)),
160
+ Math.max(0, Math.floor(row.partial)),
149
161
  Math.max(0, Math.floor(row.tokens)),
150
162
  Math.max(0, row.costUsd)
151
163
  );
package/src/db/migrate.ts CHANGED
@@ -236,11 +236,13 @@ export async function migrateJsonToDb(
236
236
  total: 0,
237
237
  success: 0,
238
238
  error: 0,
239
+ partial: 0,
239
240
  tokens: 0,
240
241
  costUsd: 0,
241
242
  } satisfies TaskMetricsRow);
242
243
  current.total += 1;
243
244
  if (row.status === "success") current.success += 1;
245
+ else if (row.status === "partial") current.partial += 1;
244
246
  else current.error += 1;
245
247
  current.tokens += Math.max(0, row.tokens ?? 0);
246
248
  current.costUsd += Math.max(0, row.costUsd ?? 0);
@@ -253,16 +255,19 @@ export async function migrateJsonToDb(
253
255
  total: acc.total + row.total,
254
256
  success: acc.success + row.success,
255
257
  error: acc.error + row.error,
258
+ partial: acc.partial + row.partial,
256
259
  tokens: acc.tokens + row.tokens,
257
260
  costUsd: acc.costUsd + row.costUsd,
258
261
  }),
259
- { total: 0, success: 0, error: 0, tokens: 0, costUsd: 0 }
262
+ { total: 0, success: 0, error: 0, partial: 0, tokens: 0, costUsd: 0 }
260
263
  );
261
264
 
262
265
  const extra = {
263
266
  total: Math.max(0, (toNumber(legacyMetrics.total) ?? 0) - migrated.total),
264
267
  success: Math.max(0, (toNumber(legacyMetrics.success) ?? 0) - migrated.success),
265
268
  error: Math.max(0, (toNumber(legacyMetrics.error) ?? 0) - migrated.error),
269
+ // В старом metrics.json не было отдельного счётчика partial.
270
+ partial: 0,
266
271
  tokens: Math.max(0, (toNumber(legacyMetrics.tokens) ?? 0) - migrated.tokens),
267
272
  costUsd: Math.max(0, (toNumber(legacyMetrics.costUsd) ?? 0) - migrated.costUsd),
268
273
  };
@@ -277,6 +282,7 @@ export async function migrateJsonToDb(
277
282
  total: extra.total,
278
283
  success: extra.success,
279
284
  error: extra.error,
285
+ partial: extra.partial,
280
286
  tokens: extra.tokens,
281
287
  costUsd: extra.costUsd,
282
288
  });
package/src/db/schema.ts CHANGED
@@ -41,6 +41,7 @@ CREATE TABLE IF NOT EXISTS metrics (
41
41
  total INTEGER DEFAULT 0,
42
42
  success INTEGER DEFAULT 0,
43
43
  error INTEGER DEFAULT 0,
44
+ partial INTEGER DEFAULT 0,
44
45
  total_tokens INTEGER DEFAULT 0,
45
46
  total_cost REAL DEFAULT 0
46
47
  );
@@ -62,6 +63,8 @@ CREATE TABLE IF NOT EXISTS workspaces (
62
63
  path TEXT NOT NULL UNIQUE,
63
64
  git_remote TEXT,
64
65
  color TEXT,
66
+ env_json TEXT,
67
+ env_file TEXT,
65
68
  created_at TEXT NOT NULL
66
69
  );
67
70
  `;
@@ -106,4 +109,26 @@ export function applySchema(db: SchemaDb): void {
106
109
  if (!taskColumnNames.includes("is_matrix_parent")) {
107
110
  db.exec("ALTER TABLE tasks ADD COLUMN is_matrix_parent INTEGER DEFAULT 0");
108
111
  }
112
+
113
+ // Спринт 21: env-переменные на workspace (пары ключ-значение и .env-файл).
114
+ const workspaceColumns = db.prepare("PRAGMA table_info(workspaces)").all() as Array<{
115
+ name?: string;
116
+ }>;
117
+ const workspaceColumnNames = workspaceColumns.map((c) => c.name).filter(Boolean);
118
+ if (!workspaceColumnNames.includes("env_json")) {
119
+ db.exec("ALTER TABLE workspaces ADD COLUMN env_json TEXT");
120
+ }
121
+ if (!workspaceColumnNames.includes("env_file")) {
122
+ db.exec("ALTER TABLE workspaces ADD COLUMN env_file TEXT");
123
+ }
124
+
125
+ // Спринт 25: partial вынесен из error, чтобы дашборд не смешивал
126
+ // частичные выполнения с ошибками и таймаутами.
127
+ const metricsColumns = db.prepare("PRAGMA table_info(metrics)").all() as Array<{
128
+ name?: string;
129
+ }>;
130
+ const metricsColumnNames = metricsColumns.map((c) => c.name).filter(Boolean);
131
+ if (!metricsColumnNames.includes("partial")) {
132
+ db.exec("ALTER TABLE metrics ADD COLUMN partial INTEGER DEFAULT 0");
133
+ }
109
134
  }