@devflow-tools/database 0.18.72 → 0.19.0
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/database.js +28 -0
- package/package.json +3 -3
package/dist/database.js
CHANGED
|
@@ -1179,6 +1179,34 @@ class DevFlowDatabase {
|
|
|
1179
1179
|
DROP TABLE devflow_retrieval_sessions_v2_legacy;
|
|
1180
1180
|
CREATE INDEX IF NOT EXISTS idx_retrieval_sessions_v2_owner
|
|
1181
1181
|
ON devflow_retrieval_sessions_v2(project_root, task_session_id, state, updated_at);
|
|
1182
|
+
`);
|
|
1183
|
+
// The RENAME above made SQLite rewrite devflow_retrieval_cycles_v2's
|
|
1184
|
+
// FOREIGN KEY to point at the renamed legacy table — which was then
|
|
1185
|
+
// dropped, leaving every cycles insert failing with "no such table".
|
|
1186
|
+
// Rebuild the cycles table so the constraint targets the new sessions
|
|
1187
|
+
// table again, preserving all rows.
|
|
1188
|
+
this.db.exec('ALTER TABLE devflow_retrieval_cycles_v2 RENAME TO devflow_retrieval_cycles_v2_rebuild');
|
|
1189
|
+
this.db.exec(`
|
|
1190
|
+
CREATE TABLE devflow_retrieval_cycles_v2 (
|
|
1191
|
+
retrieval_session_id TEXT NOT NULL,
|
|
1192
|
+
cycle INTEGER NOT NULL CHECK(cycle BETWEEN 1 AND 3),
|
|
1193
|
+
signature_hashes_json TEXT NOT NULL,
|
|
1194
|
+
receipt_json TEXT NOT NULL,
|
|
1195
|
+
receipt_hash TEXT NOT NULL UNIQUE,
|
|
1196
|
+
evidence_hash TEXT NOT NULL,
|
|
1197
|
+
token_cost INTEGER NOT NULL CHECK(token_cost >= 0),
|
|
1198
|
+
stable_ref_gain INTEGER NOT NULL CHECK(stable_ref_gain >= 0),
|
|
1199
|
+
no_gain_count INTEGER NOT NULL DEFAULT 0 CHECK(no_gain_count BETWEEN 0 AND 2),
|
|
1200
|
+
sufficiency TEXT NOT NULL CHECK(sufficiency IN ('sufficient','gap_actionable','gap_unavailable','abstain')),
|
|
1201
|
+
created_at INTEGER NOT NULL,
|
|
1202
|
+
PRIMARY KEY(retrieval_session_id, cycle),
|
|
1203
|
+
FOREIGN KEY(retrieval_session_id) REFERENCES devflow_retrieval_sessions_v2(id)
|
|
1204
|
+
);
|
|
1205
|
+
INSERT INTO devflow_retrieval_cycles_v2
|
|
1206
|
+
SELECT * FROM devflow_retrieval_cycles_v2_rebuild;
|
|
1207
|
+
DROP TABLE devflow_retrieval_cycles_v2_rebuild;
|
|
1208
|
+
CREATE INDEX IF NOT EXISTS idx_retrieval_cycle_v2_evidence
|
|
1209
|
+
ON devflow_retrieval_cycles_v2(retrieval_session_id, evidence_hash);
|
|
1182
1210
|
`);
|
|
1183
1211
|
}
|
|
1184
1212
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devflow-tools/database",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "SQLite persistence primitives shared by DevFlow runtime packages.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"test": "vitest run"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@devflow-tools/sdk": "0.
|
|
15
|
+
"@devflow-tools/sdk": "0.19.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/node": "^22.15.0",
|
|
19
19
|
"typescript": "^5.5.0",
|
|
20
20
|
"vitest": "^2.0.0"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "d4f681428ac2f83d868e152a10c85ec892afda8b",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|