CinvanaAI
← All projects

Library · Games & interaction

Discord Topology Reconciler

Plan how an ordered Discord archive should change while reusing existing message slots.

Repository: CinvanaAI/discord-topology-reconciler

Recorded synthetic example. Source with a complete offline example.

See the idea in action.

Three edits and one create, preserving the three existing Discord slot IDs.

Example input
Published [one, two, three]; desired [new, one, two, three].
Captured result
{
  "before": [
    "one",
    "two",
    "three"
  ],
  "desired": [
    "new",
    "one",
    "two",
    "three"
  ],
  "plan": {
    "container_key": "synthetic-thread",
    "generation_id": 2,
    "relinks": [],
    "operations": [
      {
        "operation_id": "op_f055a8789afd9353f25e46efcf397088",
        "generation_id": 2,
        "priority": 50,
        "sequence": 1,
        "operation_type": "EDIT_MESSAGE",
        "target_key": "slot-1",
        "container_key": "synthetic-thread",
        "payload": {
          "slot_key": "slot-1",
          "message_key": "new-1",
          "content_hash": "11507a0e2f5e69d5dfa40a62a1bd7b6ee57e6bcd85c67c9b8431b36fff21c437",
          "slot_index": 1
        },
        "state": "pending"
      },
      {
        "operation_id": "op_16f2afd25b80de10606712b50123ebbb",
        "generation_id": 2,
        "priority": 50,
        "sequence": 2,
        "operation_type": "EDIT_MESSAGE",
        "target_key": "slot-2",
        "container_key": "synthetic-thread",
        "payload": {
          "slot_key": "slot-2",
          "message_key": "new-2",
          "content_hash": "7692c3ad3540bb803c020b3aee66cd8887123234ea0c6e7143c0add73ff431ed",
          "slot_index": 2
        },
        "state": "pending"
      },
      {
        "operation_id": "op_837252e79cb557041bb8e589997c4878",
        "generation_id": 2,
        "priority": 50,
        "sequence": 3,
        "operation_type": "EDIT_MESSAGE",
        "target_key": "slot-3",
        "container_key": "synthetic-thread",
        "payload": {
          "slot_key": "slot-3",
          "message_key": "new-3",
          "content_hash": "3fc4ccfe745870e2c0d99f71f30ff0656c8dedd41cc1d7d3d376b0dbe685e2f3",
          "slot_index": 3
        },
        "state": "pending"
      },
      {
        "operation_id": "op_26644e561c31ace17b300fb3d4378583",
        "generation_id": 2,
        "priority": 51,
        "sequence": 4,
        "operation_type": "CREATE_MESSAGE",
        "target_key": "new-4",
        "container_key": "synthetic-thread",
        "payload": {
          "message_key": "new-4",
          "content_hash": "8b5b9db0c13db24256c829aa364aa90c6d2eba318b9232a4ab9313b954d3555f",
          "slot_index": 4
        },
        "state": "pending"
      }
    ]
  },
  "api_calls": 0
}

Try the example.

From the repository root, follow the dependency requirements in the README. This example uses supplied synthetic material.

python -m pip install -e .
python -m examples.walkthrough

Three edits and one create, preserving the three existing Discord slot IDs.

Complete setup and instructions ↗

The interesting part.

Logical message identity is separate from physical slots, so inserting at the head can reuse existing external message IDs.

Focused extraction

Where it came from.

Desired-state planning and publication-queue ideas from CinvanaAI Discord Engine.

Demonstrates retained reconciliation mechanics through a new in-memory contract.

It is not a live Discord client and does not carry the parent database or Conversation Engine projection.

Source ↗

Follow the family: Conversation source, migration and Discord archives

  • Extracted fromConversation Archive for Discord

    See the integrated setting from which this independently useful mechanism was separated. The smaller package re-expresses the retained planning mechanics through a new in-memory contract.

    Source ↗