diff --git a/4-Infrastructure/shim/lbi.sh b/4-Infrastructure/shim/lbi.sh new file mode 100755 index 00000000..41160056 --- /dev/null +++ b/4-Infrastructure/shim/lbi.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# lbi — Lake Build + Ingest wrapper +# Runs `lake build` and ingests results into ENE on neon-64gb. +# Use this instead of bare `lake build` to keep databases in sync. +# +# Usage: +# lbi # full build + ingest +# lbi Compiler # compiler surface + ingest +# lbi Semantics.GraphRank # narrow target + ingest +# +# Aliases (add to .bashrc / .zshrc): +# alias lake-build='lbi' +# alias lb='lbi' + +set -euo pipefail + +LEAN_DIR="${LEAN_DIR:-/home/allaun/Research Stack/0-Core-Formalism/lean/Semantics}" +INGEST_SCRIPT="/home/allaun/Research Stack/4-Infrastructure/shim/lake_build_ingest.py" +TARGET="${1:-}" +ACTOR="${2:-opencode}" + +# Run lake build +echo "▸ lake build ${TARGET:-}" +cd "$LEAN_DIR" || exit 1 +lake build $TARGET 2>&1 +BUILD_EXIT=$? + +if [ $BUILD_EXIT -ne 0 ]; then + echo "✗ lake build failed (exit $BUILD_EXIT), skipping ingest" + exit $BUILD_EXIT +fi + +echo "▸ ingesting into ENE..." +python3 "$INGEST_SCRIPT" ${TARGET:+$TARGET} --actor "$ACTOR" 2>&1 || true +echo "✓ done"