Documentation / Examples

Rebuild into an empty root

Reconstruct damaged authoritative state without overwriting the existing Lake. Ordinary source rewrites recover automatically and do not require a second root.

  1. Goal: Reconstruct history after cursor or canonical-state damage while preserving the failed Lake.
  2. Risk: Vendor-source reads and writes to a distinct destination. The command deletes nothing.
  3. Environment: macOS, installed Transcript Lake, and sufficient disk for a second full Lake.
  4. Preconditions: Preserve the failed Lake and vendor sources; select a genuinely empty replacement root; capture the original error and status.
  5. Inputs: The old LAKE_DATA and a different empty absolute destination.
  6. Artifacts and side effects: rebuild reads complete selected vendor histories and writes a separate Lake, cursors, and Oko projection. The old root remains untouched. Vendor history no longer present in the sources cannot be reconstructed from those sources.
  7. Steps:
sh
OLD="/absolute/operator-owned/lake-failed"
NEW="/absolute/operator-owned/lake-rebuild"
transcript-lake --data-dir "$OLD" doctor --json
transcript-lake --data-dir "$OLD" rebuild --to "$NEW"
transcript-lake --data-dir "$NEW" doctor
transcript-lake --data-dir "$NEW" status
  1. Observable result: The replacement root did not exist before the command. A complete rebuild reports full: true, partial: false, zero failures, fresh cursors, and partition inventory.
  2. Failure path: A non-empty target is rejected before replay. Insufficient space, unreadable source, or parser failure preserves both roots; recovery uses another empty root after correction.
  3. Off-switch: After comparing aggregate inventory and intended date/runtime coverage, point the stream service at the replacement root. Retain or remove the old root according to local policy.
  4. Related operation: Start the live stream only after the replacement root is authoritative.