You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
migrate-dev-db fails on real data: children of filtered experiment rows are copied #49
vp run migrate-dev-db fails against the real ~/.t3/userdata/statev2.sqlite with MigrateDevDbPhaseError ... during snapshot ... FOREIGN KEY constraint failed, so a worktree cannot be seeded with real data. It fails even with --projects 1 --threads-per-project 3. The source database itself has no foreign-key violations (PRAGMA foreign_key_check is empty).
Cause
copySourceSlice (apps/server/scripts/migrate-dev-db.ts) filters a table to the copied threads only when it has a thread_id column, and copies every other table whole. For the experiment tables that splits parents from children:
experiment_assignments has thread_id, so it is filtered.
Its children experiment_outcomes, experiment_observations, experiment_evidence and experiment_evaluations have no thread_id, so every row is copied and points at assignments that were left out.
experiment_work_tasks (filtered) and experiment_work_allocations / experiment_work_evidence (not) have the same shape, and so may external_agent_work with external_agent_sessions.
Acceptance
vp run migrate-dev-db --base-dir <dir> completes against a database that has experiment assignments belonging to hidden threads.
A test seeds a parent that is filtered out and a child without thread_id, and shows the child is not copied.
Landed in t3peach a176d5c with #104: snapshot and prune resolve rows whose parents were filtered or pruned by following the schema's foreign keys (SET NULL nulls, others delete), without rowids. Verified against the real database: migrate-dev-db completes and foreign_key_check is empty.
Activity
feat: Build links and #numbers in chat render as live chips with cards (
pechhe commentedon Oct 17, 2026
Landed in t3peach a176d5c with #104: snapshot and prune resolve rows whose parents were filtered or pruned by following the schema's foreign keys (SET NULL nulls, others delete), without rowids. Verified against the real database: migrate-dev-db completes and foreign_key_check is empty.