Research-Stack/4-Infrastructure/shim/lbi.sh
allaun 13ab95e18a feat(infra): lbi wrapper — lake build + ENE ingest in one call
Usage:
  lbi                    # full build + ingest
  lbi Compiler           # compiler surface + ingest
  lbi Semantics.GraphRank  # narrow target + ingest

Keeps databases in sync during development, not just on commit.
Add to shell: alias lb='lbi'
2026-06-22 21:22:14 -05:00

35 lines
1 KiB
Bash
Executable file

#!/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:-<full>}"
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"