@substrate-ai/core 0.20.95 → 0.20.97
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/core-schema.d.ts +34 -0
- package/dist/persistence/core-schema.d.ts.map +1 -0
- package/dist/persistence/core-schema.js +237 -0
- package/dist/persistence/core-schema.js.map +1 -0
- package/dist/persistence/index.d.ts +8 -1
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +11 -1
- package/dist/persistence/index.js.map +1 -1
- package/dist/persistence/monitor-schema.d.ts +17 -0
- package/dist/persistence/monitor-schema.d.ts.map +1 -0
- package/dist/persistence/monitor-schema.js +72 -0
- package/dist/persistence/monitor-schema.js.map +1 -0
- package/dist/persistence/pipeline-schema.d.ts +15 -0
- package/dist/persistence/pipeline-schema.d.ts.map +1 -0
- package/dist/persistence/pipeline-schema.js +160 -0
- package/dist/persistence/pipeline-schema.js.map +1 -0
- package/dist/persistence/repo-map-schema.d.ts +17 -0
- package/dist/persistence/repo-map-schema.d.ts.map +1 -0
- package/dist/persistence/repo-map-schema.js +45 -0
- package/dist/persistence/repo-map-schema.js.map +1 -0
- package/dist/persistence/schema.d.ts +26 -14
- package/dist/persistence/schema.d.ts.map +1 -1
- package/dist/persistence/schema.js +59 -724
- package/dist/persistence/schema.js.map +1 -1
- package/dist/persistence/state-schema.d.ts +20 -0
- package/dist/persistence/state-schema.d.ts.map +1 -0
- package/dist/persistence/state-schema.js +130 -0
- package/dist/persistence/state-schema.js.map +1 -0
- package/dist/persistence/telemetry-schema.d.ts +16 -0
- package/dist/persistence/telemetry-schema.d.ts.map +1 -0
- package/dist/persistence/telemetry-schema.js +129 -0
- package/dist/persistence/telemetry-schema.js.map +1 -0
- package/dist/persistence/work-graph-schema.d.ts +25 -0
- package/dist/persistence/work-graph-schema.d.ts.map +1 -0
- package/dist/persistence/work-graph-schema.js +82 -0
- package/dist/persistence/work-graph-schema.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo-map schema — code-symbol index used by the context-engineering layer.
|
|
3
|
+
*
|
|
4
|
+
* Owns: repo_map_symbols, repo_map_meta + their indexes.
|
|
5
|
+
*
|
|
6
|
+
* Consumed by `src/modules/repo-map/storage.ts` (~10 query sites). Production
|
|
7
|
+
* runtime DDL was previously in `dolt-store.ts._runMigrations` (the v5→v6
|
|
8
|
+
* dependencies-column ALTER, which still runs there for repos predating
|
|
9
|
+
* v0.20.94 — Ship 3 ported the CREATE TABLE here from schema.sql).
|
|
10
|
+
*
|
|
11
|
+
* Extracted from `schema.ts` in Ship 5 (2026-05).
|
|
12
|
+
*/
|
|
13
|
+
/** Tables owned by this subsystem (Ship 6 ownership contract). */
|
|
14
|
+
export const repoMapSchemaTables = [
|
|
15
|
+
'repo_map_symbols',
|
|
16
|
+
'repo_map_meta',
|
|
17
|
+
];
|
|
18
|
+
export async function initRepoMapSchema(adapter) {
|
|
19
|
+
await adapter.exec(`
|
|
20
|
+
CREATE TABLE IF NOT EXISTS repo_map_symbols (
|
|
21
|
+
id BIGINT AUTO_INCREMENT NOT NULL,
|
|
22
|
+
file_path VARCHAR(1000) NOT NULL,
|
|
23
|
+
symbol_name VARCHAR(500) NOT NULL,
|
|
24
|
+
symbol_kind VARCHAR(20) NOT NULL,
|
|
25
|
+
signature TEXT,
|
|
26
|
+
line_number INT NOT NULL DEFAULT 0,
|
|
27
|
+
exported TINYINT(1) NOT NULL DEFAULT 0,
|
|
28
|
+
file_hash VARCHAR(64) NOT NULL,
|
|
29
|
+
dependencies JSON,
|
|
30
|
+
PRIMARY KEY (id)
|
|
31
|
+
)
|
|
32
|
+
`);
|
|
33
|
+
await adapter.exec('CREATE INDEX IF NOT EXISTS idx_repo_map_symbols_file ON repo_map_symbols (file_path)');
|
|
34
|
+
await adapter.exec('CREATE INDEX IF NOT EXISTS idx_repo_map_symbols_kind ON repo_map_symbols (symbol_kind)');
|
|
35
|
+
await adapter.exec(`
|
|
36
|
+
CREATE TABLE IF NOT EXISTS repo_map_meta (
|
|
37
|
+
id INT NOT NULL DEFAULT 1,
|
|
38
|
+
commit_sha VARCHAR(64),
|
|
39
|
+
updated_at DATETIME,
|
|
40
|
+
file_count INT NOT NULL DEFAULT 0,
|
|
41
|
+
PRIMARY KEY (id)
|
|
42
|
+
)
|
|
43
|
+
`);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=repo-map-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-map-schema.js","sourceRoot":"","sources":["../../src/persistence/repo-map-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,kEAAkE;AAClE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,kBAAkB;IAClB,eAAe;CACP,CAAA;AAEV,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAwB;IAC9D,MAAM,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;GAalB,CAAC,CAAA;IACF,MAAM,OAAO,CAAC,IAAI,CAAC,sFAAsF,CAAC,CAAA;IAC1G,MAAM,OAAO,CAAC,IAAI,CAAC,wFAAwF,CAAC,CAAA;IAE5G,MAAM,OAAO,CAAC,IAAI,CAAC;;;;;;;;GAQlB,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Composition-root for persistence schema initialization.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* `initSchema(adapter)` calls the per-subsystem `initXxxSchema` functions in
|
|
5
|
+
* the correct order (tables before views; dependencies before dependents).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Subsystem ownership (Ship 5, 2026-05 — per-subsystem schema split):
|
|
8
|
+
* - core-schema.ts — sessions, tasks, plans, execution log, cost entries, signals, schema_migrations + ready_tasks/session_cost_summary views
|
|
9
|
+
* - pipeline-schema.ts — pipeline_runs, decisions, requirements, constraints, artifacts, token_usage, run_metrics, story_metrics
|
|
10
|
+
* - monitor-schema.ts — task_metrics, performance_aggregates, routing_recommendations (main DB; monitor.db is separate)
|
|
11
|
+
* - state-schema.ts — stories, contracts, metrics, dispatch_log, build_results, review_verdicts, _schema_version (legacy)
|
|
12
|
+
* - repo-map-schema.ts — repo_map_symbols, repo_map_meta
|
|
13
|
+
* - telemetry-schema.ts — turn_analysis, efficiency_scores, recommendations, category_stats, consumer_stats
|
|
14
|
+
* - work-graph-schema.ts — wg_stories, story_dependencies, ready_stories view
|
|
9
15
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* -
|
|
15
|
-
*
|
|
16
|
-
* -
|
|
17
|
-
*
|
|
18
|
-
* - Telemetry: turn_analysis, efficiency_scores, recommendations, category_stats, consumer_stats
|
|
16
|
+
* All per-subsystem inits are idempotent (CREATE TABLE IF NOT EXISTS, INSERT
|
|
17
|
+
* IGNORE seeds, try/catch ALTER ADD COLUMN migrations).
|
|
18
|
+
*
|
|
19
|
+
* Composition root order matters for views:
|
|
20
|
+
* - `ready_tasks` and `session_cost_summary` (initCoreViews) reference
|
|
21
|
+
* `tasks` + `sessions` — must run AFTER initCoreSchema.
|
|
22
|
+
* - `ready_stories` (in initWorkGraphSchema) references wg_stories +
|
|
23
|
+
* story_dependencies, both defined inside the same function — self-contained.
|
|
19
24
|
*/
|
|
20
25
|
import type { DatabaseAdapter } from './types.js';
|
|
21
26
|
/**
|
|
@@ -23,4 +28,11 @@ import type { DatabaseAdapter } from './types.js';
|
|
|
23
28
|
* Idempotent — safe to call multiple times.
|
|
24
29
|
*/
|
|
25
30
|
export declare function initSchema(adapter: DatabaseAdapter): Promise<void>;
|
|
31
|
+
export { initCoreSchema, initCoreViews } from './core-schema.js';
|
|
32
|
+
export { initPipelineSchema } from './pipeline-schema.js';
|
|
33
|
+
export { initMonitorSchema } from './monitor-schema.js';
|
|
34
|
+
export { initStateSchema } from './state-schema.js';
|
|
35
|
+
export { initRepoMapSchema } from './repo-map-schema.js';
|
|
36
|
+
export { initTelemetrySchema } from './telemetry-schema.js';
|
|
37
|
+
export { initWorkGraphSchema } from './work-graph-schema.js';
|
|
26
38
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/persistence/schema.ts"],"names":[],"mappings":"AAAA
|
|
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,CA8BxE;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"}
|