chore: snapshot in-progress question-gen work before preflight fixes

This commit is contained in:
2026-07-16 04:12:21 -04:00
parent 11a5545f57
commit a4c429b247
39 changed files with 738 additions and 283 deletions
+4 -12
View File
@@ -112,9 +112,7 @@ class TestHarnessLog:
conn = sqlite3.connect(db_path)
conn.row_factory = sqlite3.Row
row = conn.execute(
"SELECT status FROM _runs WHERE run_id = ?", (run_id,)
).fetchone()
row = conn.execute("SELECT status FROM _runs WHERE run_id = ?", (run_id,)).fetchone()
conn.close()
assert row["status"] == "failed"
@@ -130,9 +128,7 @@ class TestHarnessLog:
log.insert("t", {"x": 42})
conn = sqlite3.connect(db_path)
count = conn.execute(
"SELECT COUNT(*) FROM _runs WHERE run_id = ?", (run_id,)
).fetchone()[0]
count = conn.execute("SELECT COUNT(*) FROM _runs WHERE run_id = ?", (run_id,)).fetchone()[0]
conn.close()
assert count == 1, "ON CONFLICT DO UPDATE 应保证 _runs 只有一行"
@@ -151,9 +147,7 @@ class TestHarnessLog:
with HarnessLog(db_path, run_id) as log:
log.create_table("batch", {"epoch": "INTEGER", "loss": "REAL"})
log.insert_many("batch", records)
rows = log.query(
"SELECT * FROM batch WHERE run_id = ? ORDER BY epoch", (run_id,)
)
rows = log.query("SELECT * FROM batch WHERE run_id = ? ORDER BY epoch", (run_id,))
assert len(rows) == 5
assert [r["epoch"] for r in rows] == [0, 1, 2, 3, 4]
@@ -163,9 +157,7 @@ class TestHarnessLog:
with HarnessLog(db_path, run_id) as log:
log.log_event("train_start", {"epoch": 1, "lr": 0.001})
log.log_event("train_end", {"epoch": 1, "loss": 0.42})
rows = log.query(
"SELECT * FROM _events WHERE run_id = ? ORDER BY id", (run_id,)
)
rows = log.query("SELECT * FROM _events WHERE run_id = ? ORDER BY id", (run_id,))
assert len(rows) == 2
assert rows[0]["event_type"] == "train_start"