Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

787 B
Raw Blame
/**
 * Split `data/pipeline-series.json` into per-record files under
 * `data/pipeline-series/{id}/index.json`.
 *
 * Shares the split skeleton with 034 / 035 / 059 via `makeSplitMigration` —
 * series carry no cross-record type-level state, so `config` is `{}`.
 */

import { makeSplitMigration } from './_lib.js';

const VALID_ID = /^ser-[A-Za-z0-9-]+$/;

export default makeSplitMigration({
  migrationLabel: 'migration 036',
  typeDirName: 'pipeline-series',
  legacyFilename: 'pipeline-series.json',
  backupSuffix: '.bak-036',
  typeSchemaVersion: 1,
  typeLabel: 'pipelineSeries',
  recordsKey: 'series',
  idPattern: VALID_ID,
  recordNoun: 'series record',
  // Corrupt source must stay pending (not stamped applied) so a repaired file re-splits.
  onUnreadable: 'throw',
});