Problem
When messages/sessions are ingested under the wrong workspace, there's currently no first-class way to correct it without deleting and re-ingesting — which loses derived conclusions (observations) and breaks continuity.
Proposal
An admin/maintenance script that relocates named sessions — with their messages, embeddings, and conclusions — between workspaces without data loss:
- id-preserving in-place relocate via transaction-local deferrable constraints
- full-column copy of any peers/collections the target is missing (peer cards/metadata preserved)
- rename-on-collision (never overwrites an existing target session)
- dry-run by default;
--apply takes a pg_dump backup and runs the whole move in one transaction with a post-move integrity assertion
- a no-privilege fallback strategy for deployments that can't
ALTER constraints
I have a tested implementation ready and will open a PR linking this issue. Happy to adjust the approach (standalone script vs. an API endpoint) based on maintainer preference.
Problem
When messages/sessions are ingested under the wrong workspace, there's currently no first-class way to correct it without deleting and re-ingesting — which loses derived conclusions (observations) and breaks continuity.
Proposal
An admin/maintenance script that relocates named sessions — with their messages, embeddings, and conclusions — between workspaces without data loss:
--applytakes apg_dumpbackup and runs the whole move in one transaction with a post-move integrity assertionALTERconstraintsI have a tested implementation ready and will open a PR linking this issue. Happy to adjust the approach (standalone script vs. an API endpoint) based on maintainer preference.