Skip to content

Commit 448a0fc

Browse files
test(web): sidebar evidence seeder replaces only its exact fixture rows
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent ae52758 commit 448a0fc

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

‎scripts/seed-sidebar-evidence.py‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,30 @@ def main():
6262
):
6363
if connection.execute(f"SELECT count(*) FROM {table}").fetchone()[0]:
6464
parser.error(f"Expected empty synthetic state: {table} is populated.")
65+
project, project_title = "shortcut-fixtures", "Shortcut fixtures"
66+
# Only rows this script writes may be replaced; match them exactly.
6567
if connection.execute(
66-
"SELECT count(*) FROM orchestration_v2_projection_threads "
67-
"WHERE thread_id NOT LIKE 'shortcut-fixture-%'"
68+
"SELECT count(*) FROM orchestration_v2_projection_threads WHERE NOT "
69+
"(thread_id IN ('shortcut-fixture-1','shortcut-fixture-2','shortcut-fixture-3') "
70+
"AND project_id IS ?)",
71+
(project,),
6872
).fetchone()[0]:
6973
parser.error("Refusing to replace nonfixture threads.")
7074
if connection.execute(
71-
"SELECT count(*) FROM projection_projects WHERE title != 'Shortcut fixtures'"
75+
"SELECT count(*) FROM projection_projects "
76+
"WHERE NOT (project_id IS ? AND title IS ?)",
77+
(project, project_title),
7278
).fetchone()[0]:
7379
parser.error("Refusing to replace nonfixture projects.")
7480

7581
clock = "2026-10-22T08:00:00.000Z"
76-
project = "shortcut-fixtures"
7782
connection.execute("DELETE FROM orchestration_v2_projection_threads")
7883
connection.execute("DELETE FROM projection_projects")
7984
connection.execute(
8085
"INSERT INTO projection_projects "
8186
"(project_id,title,workspace_root,scripts_json,created_at,updated_at) "
8287
"VALUES (?,?,?,?,?,?)",
83-
(project, "Shortcut fixtures", str(workspace), "[]", clock, clock),
88+
(project, project_title, str(workspace), "[]", clock, clock),
8489
)
8590
for index, title in enumerate(() if args.empty else ("Alpha", "Beta", "Gamma"), 1):
8691
thread = f"shortcut-fixture-{index}"

0 commit comments

Comments
 (0)