code-to10 v7 mech merge fix: SqliteScorecardGainLedger uses cloud.db.connect instead of sqlite3.connect (arch conformance layer rule), no semantics changed

(cherry picked from commit bde36a84880574c2297aaee9ed08312cd0e2c0fc)
This commit is contained in:
host committed 2026-11-03 02:49:27 +00:00
1 parent 368363e096
commit de925bff3b
1 file changed
+5 -2
+5 -2
View File
@@ -90,6 +90,8 @@ from __future__ import annotations
import sqlite3
from cloud.db import connect as _db_connect
TABLES = ("code", "production", "product")
# 停表阈值:测试默认值、未拍板。生产阈值须用户拍板后显式传入。
@@ -297,8 +299,9 @@ class SqliteScorecardGainLedger:
self._conn = connection
self._owns_conn = False
else:
self._conn = sqlite3.connect(str(db_path))
self._conn.row_factory = sqlite3.Row
# 层规则:服务层不得直连驱动,须走 cloud.db.connect
# (其 SQLite 路径已设 WAL + busy_timeout + Row)。
self._conn = _db_connect(str(db_path))
self._owns_conn = True
self._conn.execute(SQLITE_DDL)
self._conn.commit()