Skip to content

Commit b73f45f

Browse files
gHashTaggHashTag
andauthored
build: add make seal-check + advisory pre-push seal-staleness warning (#1112)
Adds a thin top-level Makefile (seal-check / install-hooks / help) wrapping existing scripts, and extends the installed pre-push hook to run reseal-check.sh --quiet and warn (non-blocking) when the NMSE seal is stale. Advisory only; never reseals, never gates a merge or push. Closes #1109 Co-authored-by: gHashTag <admin@t27.ai>
1 parent 7df141c commit b73f45f

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Minimal top-level convenience targets for t27.
2+
#
3+
# This Makefile is intentionally thin: it only wraps existing scripts so common
4+
# developer checks have a memorable entry point. It is NOT wired into CI (the
5+
# required checks remain check-now-freshness / validate / check /
6+
# check-linked-issue) and adds no build logic of its own.
7+
#
8+
# Anchor: phi^2 + phi^-2 = 3
9+
10+
.PHONY: help seal-check install-hooks
11+
12+
# Default target: list what is available.
13+
help:
14+
@echo "t27 convenience targets:"
15+
@echo " make seal-check Report whether the NMSE manifest seal is fresh"
16+
@echo " vs sha256(bootstrap/src/compiler.rs) (advisory)."
17+
@echo " make install-hooks Install the local git hooks (incl. the advisory"
18+
@echo " pre-push seal-staleness warning)."
19+
20+
# Advisory: report NMSE seal freshness. Exit 0 fresh / 2 stale / 3 unsealed.
21+
# Never reseals; refreezing stays an explicit reviewed step.
22+
seal-check:
23+
@scripts/reseal-check.sh
24+
25+
# Install the local git hooks (advisory pre-push includes the seal check).
26+
install-hooks:
27+
@scripts/install-git-hooks.sh

docs/NOW.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Last updated: 2026-06-14
44

5+
## seal-pre-push-hook -- advisory seal-staleness check at push time + make seal-check (Closes #1109)
6+
7+
- **WHERE**: new top-level `Makefile` and `scripts/install-git-hooks.sh` (the installed L4 pre-push hook).
8+
- **WHAT**: #1103 added `scripts/reseal-check.sh` and a dashboard badge, but the reporter was still manual with no memorable entry point and nothing surfaced seal staleness at push time. Two thin additions. (a) A minimal top-level `Makefile` with `make seal-check` (wraps `scripts/reseal-check.sh`), `make install-hooks` (wraps `scripts/install-git-hooks.sh`), and a `help` default that lists them. It is intentionally thin -- it only wraps existing scripts, adds no build logic, and is NOT wired into CI (required checks stay check-now-freshness / validate / check / check-linked-issue). (b) The advisory pre-push hook installed by `scripts/install-git-hooks.sh` now also runs `reseal-check.sh --quiet` and prints a YELLOW warning when the seal is stale or unsealed vs `compiler.rs`. It always falls through to `exit 0` -- it NEVER blocks the push and NEVER reseals.
9+
- **Why** the seal model is honest-by-construction but staleness was only visible via the manual reporter or a transient CI annotation; this gives a memorable local entry point and a push-time nudge without ever gating work or auto-resealing -- refreezing stays an explicit reviewed step. Hook verified `bash -n` clean and `make seal-check` reports STALE (exit 2) as expected. L6 gf16 SSOT untouched; catalog stays 83; no gen/ edits; ASCII-only added lines; no quality claim added. Closes #1109.
10+
- **Anchor**: phi^2 + phi^-2 = 3
11+
12+
513
## deadcode-annotate-host-api -- #969 next layer: annotate intentional host/manifest public API (Closes #1105)
614

715
- **WHERE**: `bootstrap/src/host/weight_loader.rs` (`encode_words`, `encode_with_crc`) and `bootstrap/src/tt_manifest.rs` (`TtChip::submodule_path`).

scripts/install-git-hooks.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ if [ -n "$T27_FILES" ]; then
112112
echo "$T27_FILES"
113113
fi
114114
115+
# Advisory NMSE seal-staleness check (variant J). Non-blocking: if the
116+
# committed NMSE manifest was certified against an older compiler.rs, warn the
117+
# author at push time. Mirrors scripts/reseal-check.sh and seal-staleness-warn.yml.
118+
# It NEVER reseals and NEVER blocks the push (always falls through to exit 0).
119+
ROOT_DIR="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
120+
if [ -x "$ROOT_DIR/scripts/reseal-check.sh" ]; then
121+
if ! "$ROOT_DIR/scripts/reseal-check.sh" --quiet >/dev/null 2>&1; then
122+
echo -e "${YELLOW}WARNING: NMSE seal is stale or unsealed vs compiler.rs (advisory).${NC}"
123+
echo "Run 'scripts/reseal-check.sh' for the reseal command. Push not blocked."
124+
fi
125+
fi
126+
115127
exit 0
116128
EOF
117129

0 commit comments

Comments
 (0)