@substrate-ai/core 0.20.98 → 0.20.99
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/dist/persistence/index.d.ts +0 -1
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +3 -1
- package/dist/persistence/index.js.map +1 -1
- package/dist/persistence/schema.d.ts +1 -1
- package/dist/persistence/schema.d.ts.map +1 -1
- package/dist/persistence/schema.js +5 -4
- package/dist/persistence/schema.js.map +1 -1
- package/dist/persistence/state-schema.d.ts +18 -17
- package/dist/persistence/state-schema.d.ts.map +1 -1
- package/dist/persistence/state-schema.js +25 -99
- package/dist/persistence/state-schema.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,6 @@ export { initSchema, initCoreSchema, initCoreViews, initPipelineSchema, initMoni
|
|
|
7
7
|
export { coreSchemaTables, coreSchemaViews } from './core-schema.js';
|
|
8
8
|
export { pipelineSchemaTables } from './pipeline-schema.js';
|
|
9
9
|
export { monitorSchemaTables } from './monitor-schema.js';
|
|
10
|
-
export { stateSchemaTables } from './state-schema.js';
|
|
11
10
|
export { repoMapSchemaTables } from './repo-map-schema.js';
|
|
12
11
|
export { telemetrySchemaTables } from './telemetry-schema.js';
|
|
13
12
|
export { workGraphSchemaTables, workGraphSchemaViews } from './work-graph-schema.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/persistence/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,OAAO,EACL,UAAU,EACV,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version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AAE,MAAM,wBAAwB,CAAA;AACnF,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,uBAAuB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAC/D,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACnF,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -8,10 +8,12 @@ export { initSchema, initCoreSchema, initCoreViews, initPipelineSchema, initMoni
|
|
|
8
8
|
// Ship 6 ownership-contract exports: each subsystem declares the tables (and
|
|
9
9
|
// views) it owns. The meta-test in test/persistence/schema-ownership.test.ts
|
|
10
10
|
// asserts (a) no overlap and (b) the union covers the canonical set.
|
|
11
|
+
// `state-schema` owns no tables anymore (Ship 8 dropped the six legacy tables);
|
|
12
|
+
// it survives only as a DROP-table cleanup for existing repos, so it has no
|
|
13
|
+
// ownership array to export.
|
|
11
14
|
export { coreSchemaTables, coreSchemaViews } from './core-schema.js';
|
|
12
15
|
export { pipelineSchemaTables } from './pipeline-schema.js';
|
|
13
16
|
export { monitorSchemaTables } from './monitor-schema.js';
|
|
14
|
-
export { stateSchemaTables } from './state-schema.js';
|
|
15
17
|
export { repoMapSchemaTables } from './repo-map-schema.js';
|
|
16
18
|
export { telemetrySchemaTables } from './telemetry-schema.js';
|
|
17
19
|
export { workGraphSchemaTables, workGraphSchemaViews } from './work-graph-schema.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/persistence/index.ts"],"names":[],"mapp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,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACpF,gHAAgH;AAChH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,oHAAoH;AACpH,OAAO,EACL,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,aAAa,GACd,MAAM,wBAAwB,CAAA;AAE/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,uBAAuB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAE/D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEnF,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - core-schema.ts — sessions, tasks, plans, execution log, cost entries, signals, schema_migrations + ready_tasks/session_cost_summary views
|
|
9
9
|
* - pipeline-schema.ts — pipeline_runs, decisions, requirements, constraints, artifacts, token_usage, run_metrics, story_metrics
|
|
10
10
|
* - monitor-schema.ts — task_metrics, performance_aggregates, routing_recommendations (main DB; monitor.db is separate)
|
|
11
|
-
* - state-schema.ts —
|
|
11
|
+
* - state-schema.ts — legacy-table cleanup only (Ship 8 dropped the 6 remaining tables; module owns no tables now)
|
|
12
12
|
* - repo-map-schema.ts — repo_map_symbols, repo_map_meta
|
|
13
13
|
* - telemetry-schema.ts — turn_analysis, efficiency_scores, recommendations, category_stats, consumer_stats
|
|
14
14
|
* - work-graph-schema.ts — wg_stories, story_dependencies, ready_stories view
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/persistence/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AASjD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/persistence/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AASjD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BxE;AAMD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - core-schema.ts — sessions, tasks, plans, execution log, cost entries, signals, schema_migrations + ready_tasks/session_cost_summary views
|
|
9
9
|
* - pipeline-schema.ts — pipeline_runs, decisions, requirements, constraints, artifacts, token_usage, run_metrics, story_metrics
|
|
10
10
|
* - monitor-schema.ts — task_metrics, performance_aggregates, routing_recommendations (main DB; monitor.db is separate)
|
|
11
|
-
* - state-schema.ts —
|
|
11
|
+
* - state-schema.ts — legacy-table cleanup only (Ship 8 dropped the 6 remaining tables; module owns no tables now)
|
|
12
12
|
* - repo-map-schema.ts — repo_map_symbols, repo_map_meta
|
|
13
13
|
* - telemetry-schema.ts — turn_analysis, efficiency_scores, recommendations, category_stats, consumer_stats
|
|
14
14
|
* - work-graph-schema.ts — wg_stories, story_dependencies, ready_stories view
|
|
@@ -43,9 +43,10 @@ export async function initSchema(adapter) {
|
|
|
43
43
|
// routing_recommendations). `.substrate/monitor.db` is a separate DB
|
|
44
44
|
// managed independently by monitor-database.ts.
|
|
45
45
|
await initMonitorSchema(adapter);
|
|
46
|
-
// 4. Legacy state
|
|
47
|
-
//
|
|
48
|
-
//
|
|
46
|
+
// 4. Legacy state-table cleanup. Ship 8 (v0.20.99) dropped the six
|
|
47
|
+
// remaining tables that Ship 1 had already audited as empty in every
|
|
48
|
+
// production project. This call now only DROP TABLE IF EXISTS them on
|
|
49
|
+
// existing repos (ynab, quant). Fresh repos never see them.
|
|
49
50
|
await initStateSchema(adapter);
|
|
50
51
|
// 5. Repo-map tables (used by src/modules/repo-map/storage.ts).
|
|
51
52
|
await initRepoMapSchema(adapter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/persistence/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,kBAAk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AE7B,mEAAmE;IACnE,MAAM,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAEjC,0EAA0E;IAC1E,wEAAwE;IACxE,mDAAmD;IACnD,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAA;IAEhC,mEAAmE;IACnE,wEAAwE;IACxE,yEAAyE;IACzE,+DAA+D;IAC/D,MAAM,eAAe,CAAC,OAAO,CAAC,CAAA;IAE9B,gEAAgE;IAChE,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAA;IAEhC,+DAA+D;IAC/D,MAAM,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAElC,yDAAyD;IACzD,MAAM,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAElC,uEAAuE;IACvE,iDAAiD;IACjD,MAAM,aAAa,CAAC,OAAO,CAAC,CAAA;AAC9B,CAAC;AAED,8EAA8E;AAC9E,4EAA4E;AAC5E,wEAAwE;AACxE,mEAAmE;AACnE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Legacy state
|
|
2
|
+
* Legacy state-table cleanup — pre-2026-Q1 orchestrator state tables.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* review_verdicts
|
|
4
|
+
* Historical context: `stories`, `contracts`, `metrics`, `dispatch_log`,
|
|
5
|
+
* `build_results`, `review_verdicts` (+ vestigial `_schema_version`) were
|
|
6
|
+
* defined as the substrate-state surface in `schema.sql`. Ship 1 (v0.20.92)
|
|
7
|
+
* excised the corresponding DoltStateStore CRUD methods after auditing every
|
|
8
|
+
* production project (ynab, quant) and finding all six tables empty — the
|
|
9
|
+
* orchestrator wires `FileStateStore` (in-memory), so DoltStateStore's write
|
|
10
|
+
* methods never fired and these tables were perpetually empty.
|
|
6
11
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* methods; Ship 3 ported the DDL out of schema.sql into initSchema; Ship 5
|
|
12
|
-
* moved them to this module; Ship 7 (2026-05) deleted the vestigial
|
|
13
|
-
* `_schema_version` table that used to live here.
|
|
12
|
+
* Ship 7 (v0.20.98) deleted the vestigial `_schema_version` table the same
|
|
13
|
+
* way; Ship 8 (v0.20.99) extends that pattern to the remaining six legacy
|
|
14
|
+
* tables. This module owns NO tables now — it survives only to drop the
|
|
15
|
+
* legacy tables on existing repos (ynab, quant) at next `substrate run`.
|
|
14
16
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Fresh repos never see any of these tables; existing repos lose them on
|
|
18
|
+
* next init via the DROP TABLE IF EXISTS block below.
|
|
19
|
+
*
|
|
20
|
+
* Note: monitor.db's `_schema_version` (in `.substrate/monitor.db`) is
|
|
21
|
+
* intentionally distinct from the substrate-state `_schema_version` we
|
|
22
|
+
* dropped — see monitor-database.ts.
|
|
20
23
|
*/
|
|
21
24
|
import type { DatabaseAdapter } from './types.js';
|
|
22
|
-
/** Tables owned by this subsystem (Ship 6 ownership contract). */
|
|
23
|
-
export declare const stateSchemaTables: readonly ["stories", "contracts", "metrics", "dispatch_log", "build_results", "review_verdicts"];
|
|
24
25
|
export declare function initStateSchema(adapter: DatabaseAdapter): Promise<void>;
|
|
25
26
|
//# sourceMappingURL=state-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-schema.d.ts","sourceRoot":"","sources":["../../src/persistence/state-schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"state-schema.d.ts","sourceRoot":"","sources":["../../src/persistence/state-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAYjD,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7E"}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Legacy state
|
|
2
|
+
* Legacy state-table cleanup — pre-2026-Q1 orchestrator state tables.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* review_verdicts
|
|
4
|
+
* Historical context: `stories`, `contracts`, `metrics`, `dispatch_log`,
|
|
5
|
+
* `build_results`, `review_verdicts` (+ vestigial `_schema_version`) were
|
|
6
|
+
* defined as the substrate-state surface in `schema.sql`. Ship 1 (v0.20.92)
|
|
7
|
+
* excised the corresponding DoltStateStore CRUD methods after auditing every
|
|
8
|
+
* production project (ynab, quant) and finding all six tables empty — the
|
|
9
|
+
* orchestrator wires `FileStateStore` (in-memory), so DoltStateStore's write
|
|
10
|
+
* methods never fired and these tables were perpetually empty.
|
|
6
11
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* methods; Ship 3 ported the DDL out of schema.sql into initSchema; Ship 5
|
|
12
|
-
* moved them to this module; Ship 7 (2026-05) deleted the vestigial
|
|
13
|
-
* `_schema_version` table that used to live here.
|
|
12
|
+
* Ship 7 (v0.20.98) deleted the vestigial `_schema_version` table the same
|
|
13
|
+
* way; Ship 8 (v0.20.99) extends that pattern to the remaining six legacy
|
|
14
|
+
* tables. This module owns NO tables now — it survives only to drop the
|
|
15
|
+
* legacy tables on existing repos (ynab, quant) at next `substrate run`.
|
|
14
16
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Fresh repos never see any of these tables; existing repos lose them on
|
|
18
|
+
* next init via the DROP TABLE IF EXISTS block below.
|
|
19
|
+
*
|
|
20
|
+
* Note: monitor.db's `_schema_version` (in `.substrate/monitor.db`) is
|
|
21
|
+
* intentionally distinct from the substrate-state `_schema_version` we
|
|
22
|
+
* dropped — see monitor-database.ts.
|
|
20
23
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
const LEGACY_TABLES = [
|
|
25
|
+
'_schema_version',
|
|
23
26
|
'stories',
|
|
24
27
|
'contracts',
|
|
25
28
|
'metrics',
|
|
@@ -28,88 +31,11 @@ export const stateSchemaTables = [
|
|
|
28
31
|
'review_verdicts',
|
|
29
32
|
];
|
|
30
33
|
export async function initStateSchema(adapter) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// lives in `.substrate/monitor.db` with a different schema (version_id +
|
|
37
|
-
// applied_at) and is managed independently.
|
|
38
|
-
try {
|
|
39
|
-
await adapter.exec('DROP TABLE IF EXISTS _schema_version');
|
|
34
|
+
for (const table of LEGACY_TABLES) {
|
|
35
|
+
try {
|
|
36
|
+
await adapter.exec(`DROP TABLE IF EXISTS ${table}`);
|
|
37
|
+
}
|
|
38
|
+
catch { /* table absent or adapter lacks DROP support */ }
|
|
40
39
|
}
|
|
41
|
-
catch { /* table absent or adapter lacks DROP support */ }
|
|
42
|
-
await adapter.exec(`
|
|
43
|
-
CREATE TABLE IF NOT EXISTS stories (
|
|
44
|
-
story_key VARCHAR(100) NOT NULL,
|
|
45
|
-
sprint VARCHAR(50),
|
|
46
|
-
status VARCHAR(30) NOT NULL DEFAULT 'PENDING',
|
|
47
|
-
phase VARCHAR(30) NOT NULL DEFAULT 'PENDING',
|
|
48
|
-
ac_results JSON,
|
|
49
|
-
error_message TEXT,
|
|
50
|
-
created_at DATETIME,
|
|
51
|
-
updated_at DATETIME,
|
|
52
|
-
completed_at DATETIME,
|
|
53
|
-
PRIMARY KEY (story_key)
|
|
54
|
-
)
|
|
55
|
-
`);
|
|
56
|
-
await adapter.exec(`
|
|
57
|
-
CREATE TABLE IF NOT EXISTS contracts (
|
|
58
|
-
story_key VARCHAR(100) NOT NULL,
|
|
59
|
-
name VARCHAR(200) NOT NULL,
|
|
60
|
-
direction VARCHAR(20) NOT NULL,
|
|
61
|
-
schema_path VARCHAR(500),
|
|
62
|
-
transport VARCHAR(200),
|
|
63
|
-
recorded_at DATETIME,
|
|
64
|
-
PRIMARY KEY (story_key, name, direction)
|
|
65
|
-
)
|
|
66
|
-
`);
|
|
67
|
-
await adapter.exec(`
|
|
68
|
-
CREATE TABLE IF NOT EXISTS metrics (
|
|
69
|
-
story_key VARCHAR(100) NOT NULL,
|
|
70
|
-
task_type VARCHAR(100) NOT NULL,
|
|
71
|
-
recorded_at DATETIME NOT NULL,
|
|
72
|
-
model VARCHAR(100),
|
|
73
|
-
tokens_in BIGINT NOT NULL DEFAULT 0,
|
|
74
|
-
tokens_out BIGINT NOT NULL DEFAULT 0,
|
|
75
|
-
cache_read_tokens BIGINT NOT NULL DEFAULT 0,
|
|
76
|
-
cost_usd DECIMAL(10,6) NOT NULL DEFAULT 0,
|
|
77
|
-
wall_clock_ms BIGINT NOT NULL DEFAULT 0,
|
|
78
|
-
review_cycles INT NOT NULL DEFAULT 0,
|
|
79
|
-
stall_count INT NOT NULL DEFAULT 0,
|
|
80
|
-
result VARCHAR(30),
|
|
81
|
-
PRIMARY KEY (story_key, task_type, recorded_at)
|
|
82
|
-
)
|
|
83
|
-
`);
|
|
84
|
-
await adapter.exec(`
|
|
85
|
-
CREATE TABLE IF NOT EXISTS dispatch_log (
|
|
86
|
-
story_key VARCHAR(100) NOT NULL,
|
|
87
|
-
dispatched_at DATETIME NOT NULL,
|
|
88
|
-
branch VARCHAR(200),
|
|
89
|
-
worker_id VARCHAR(100),
|
|
90
|
-
result VARCHAR(30),
|
|
91
|
-
PRIMARY KEY (story_key, dispatched_at)
|
|
92
|
-
)
|
|
93
|
-
`);
|
|
94
|
-
await adapter.exec(`
|
|
95
|
-
CREATE TABLE IF NOT EXISTS build_results (
|
|
96
|
-
story_key VARCHAR(100) NOT NULL,
|
|
97
|
-
timestamp DATETIME NOT NULL,
|
|
98
|
-
command VARCHAR(500),
|
|
99
|
-
exit_code INT,
|
|
100
|
-
stdout_hash VARCHAR(64),
|
|
101
|
-
PRIMARY KEY (story_key, timestamp)
|
|
102
|
-
)
|
|
103
|
-
`);
|
|
104
|
-
await adapter.exec(`
|
|
105
|
-
CREATE TABLE IF NOT EXISTS review_verdicts (
|
|
106
|
-
story_key VARCHAR(100) NOT NULL,
|
|
107
|
-
timestamp DATETIME NOT NULL,
|
|
108
|
-
verdict VARCHAR(30),
|
|
109
|
-
issues_count INT NOT NULL DEFAULT 0,
|
|
110
|
-
notes TEXT,
|
|
111
|
-
PRIMARY KEY (story_key, timestamp)
|
|
112
|
-
)
|
|
113
|
-
`);
|
|
114
40
|
}
|
|
115
41
|
//# sourceMappingURL=state-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-schema.js","sourceRoot":"","sources":["../../src/persistence/state-schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"state-schema.js","sourceRoot":"","sources":["../../src/persistence/state-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,MAAM,aAAa,GAAG;IACpB,iBAAiB;IACjB,SAAS;IACT,WAAW;IACX,SAAS;IACT,cAAc;IACd,eAAe;IACf,iBAAiB;CACT,CAAA;AAEV,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAwB;IAC5D,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;QAClC,IAAI,CAAC;YAAC,MAAM,OAAO,CAAC,IAAI,CAAC,wBAAwB,KAAK,EAAE,CAAC,CAAA;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,gDAAgD,CAAC,CAAC;IACxH,CAAC;AACH,CAAC"}
|