Skip to content

runtime schema repair must record DDL changes in the migration ledger #618

Description

@EtanHey

Problem

BrainLayer's runtime schema-ensure path can create or replace FTS objects without writing a corresponding schema_migrations or migration_events record.

During the M1 outage, the index job reported missing/mismatched chunks_fts_* objects. Hours later the 21-object runtime contract passed, but:

  • the latest schema_migrations entry predated the repair by weeks;
  • migration_events was empty.

This made the exact repair time and actor impossible to establish.

Expected

Every runtime path that mutates DDL should leave an atomic, queryable event containing at least:

  • timestamp;
  • actor/path;
  • prior and resulting schema fingerprint;
  • affected objects;
  • success/failure.

Acceptance

  • Regression test performs a runtime FTS/schema repair and asserts a ledger event.
  • No event is written for a read-only validation.
  • Failed repairs record failure without claiming the resulting fingerprint.
  • Existing explicit migrations remain compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions