Skip to content

Feature: lossless tool to move sessions between workspaces #862

Description

@cfdude

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions