makeover-layout 0.27.5

The renderer-agnostic half of the make-family design system: what a thing IS, named as intents and relationships and never as values. Colour defers to makeover, spacing to makeover-geometry; what is left is composition.
Documentation
#!/bin/bash
# Canonical pre-push gate. Two gates, and they answer different questions:
#
#   internal deps   does every in-house `version` requirement in the tree still
#                   resolve against the crate it names? Runs in EVERY repo.
#   test targets    do this repo's test targets build? Runs where there is a
#                   root Cargo.toml to run one command in.
#
# DO NOT EDIT IN PLACE. The master is _private/infra/bootstrap/githooks/pre-push.
#
# Bypass for a work-in-progress push: git push --no-verify
#
# WHY THE FIRST GATE EXISTS. Every cross-repo dependency carries a `version`
# alongside its `git` URL, so cargo refuses a sibling it was not written against
# instead of compiling something surprising. That requirement is the protection
# and it is also the maintenance: bumping a library's minor breaks every consumer
# whose requirement excludes it, and CLAUDE.md's rule is that the bump and the
# forward fix are one pass. Nothing enforced the rule, so quasi went 0.11 -> 0.14
# over two evenings and MNW's server could not resolve at all for a day. The
# nightly sweep found it and a red cell in a grid is not the same as being told.
#
# This gate is that rule, mechanised, at the moment it is broken: the push that
# would leave a consumer unable to build is the push that is refused. It reads
# the WORKING COPIES in the tree, not the remotes, because `~/Code/.cargo/config.toml`
# redirects every one of these dependencies to the working copy -- so a local bump
# breaks a consumer's build here whether or not it has been pushed anywhere.
#
# `cargo check` and `cargo clippy` both compile only the lib and bin targets, so a
# break confined to `tests/` or a `#[cfg(test)]` module is clean under both and
# lands unnoticed (goingson's sqlx 0.9 upgrade shipped exactly that way).
# `--no-run` builds every test target without running them, which is the cheap
# half of the suite and enough to catch a compile break. Tests still run
# separately.
#
# `--workspace` is load-bearing wherever default-members is narrower than the
# workspace: goingson's is src-tauri alone, so a bare `cargo test --no-run` would
# skip core, db-sqlite, go-mcp and got.
set -euo pipefail

ROOT="$(git rev-parse --show-toplevel)"
cd "$ROOT"

# See the canonical pre-commit: a hook run from an editor or a cron job does not
# get the profile's PATH, and a hook that cannot find cargo is worse than none.
export PATH="$HOME/.cargo/bin:$HOME/.local/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"

# Refs arrive on stdin as "<local ref> <local sha> <remote ref> <remote sha>".
# A branch deletion has an all-zero local sha and no tree to push. Read once,
# ahead of both gates: stdin is not seekable and a second reader gets nothing.
pushing=0
while read -r _local_ref local_sha _remote_ref _remote_sha; do
    case "$local_sha" in
        *[!0]*) pushing=1 ;;
    esac
done
[ "$pushing" -eq 1 ] || exit 0

# ── gate 1: internal dependency coherence ──────────────────────────────────
#
# Deliberately no cargo: this reads manifests and answers in well under a second,
# where `cargo metadata` on the server is tens of seconds and fails outright on
# exactly the state being detected.
CODE_ROOT="${CODE_ROOT:-$HOME/Code}"
if [ -d "$CODE_ROOT" ] && command -v python3 >/dev/null 2>&1; then
    if ! python3 "$ROOT/scripts/githooks/internal-deps.py" "$CODE_ROOT" "$ROOT"; then
        echo "pre-push: push aborted (use --no-verify to bypass)."
        exit 1
    fi
fi

# ── gate 2: test targets build ─────────────────────────────────────────────
#
# MNW and synckit have no root Cargo.toml by design (standalone crates, no root
# workspace), so there is no one command to run and they get gate 1 only.
[ -f "$ROOT/Cargo.toml" ] || exit 0

echo "pre-push: building test targets (cargo test --no-run --workspace)..."
if ! cargo test --no-run --workspace; then
    echo "pre-push: test targets failed to build."
    echo "pre-push: push aborted (use --no-verify to bypass)."
    exit 1
fi

echo "pre-push: test targets build clean."