Skip to content

Commit 60007d7

Browse files
gHashTaggHashTag
andauthored
build: add make verify -- single advisory pre-PR umbrella (#1127)
Closes #1124 Co-authored-by: gHashTag <admin@t27.ai>
1 parent ad4f24e commit 60007d7

3 files changed

Lines changed: 145 additions & 1 deletion

File tree

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# Anchor: phi^2 + phi^-2 = 3
99

10-
.PHONY: help seal-check seal install-hooks warnings-baseline
10+
.PHONY: help verify seal-check seal install-hooks warnings-baseline
1111

1212
# Default target: list what is available.
1313
help:
@@ -20,6 +20,15 @@ help:
2020
@echo " pre-push seal-staleness warning)."
2121
@echo " make warnings-baseline Count non-test build warnings vs the recorded"
2222
@echo " baseline and list the top files (advisory; #969)."
23+
@echo " make verify Run all advisory pre-PR checks at once (seal-check"
24+
@echo " + warnings-baseline + quick test); never blocks."
25+
26+
# Advisory umbrella: run the seal-freshness, warnings-baseline, and a quick test
27+
# back-to-back and print one compact summary. Never edits code, never reseals,
28+
# always exits 0 -- a convenience entry point for a pre-PR glance. The real gate
29+
# stays the four required CI checks.
30+
verify:
31+
@scripts/verify.sh
2332

2433
# Advisory: report NMSE seal freshness. Exit 0 fresh / 2 stale / 3 unsealed.
2534
# Never reseals; refreezing stays an explicit reviewed step.

docs/NOW.md

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

33
Last updated: 2026-06-14
44

5+
## make-verify-umbrella -- single advisory pre-PR umbrella (make verify) (Closes #1124)
6+
7+
- **WHERE**: new `scripts/verify.sh` and the top-level `Makefile` (new `verify` target + `make help` entry).
8+
- **WHAT**: the repo has accumulated several small read-only developer checks, each with its own entry point -- the NMSE seal-freshness reporter (`make seal-check` / #1106), the #969 dead-code warning meter (`make warnings-baseline` / #1119), and the test suite. Before opening a PR a contributor wants to glance at all of them at once. `scripts/verify.sh` runs three best-effort sub-checks back-to-back -- (1) `scripts/reseal-check.sh --quiet` (seal freshness), (2) `scripts/warnings-baseline.sh --quiet` (#969 meter), (3) a quick `cargo test --bin t27c tests_compiler_rejects` (the negative-test gate from K/M/Q; `VERIFY_FULL_TEST=1` runs the whole suite, `VERIFY_SKIP_TEST=1` skips the test step) -- then prints one compact `verify: ...` summary line. Supports `--quiet`. A missing sub-script is reported as SKIP, never an error. A `verify` target wraps it (continuing the thin #1109 Makefile) and is listed in `make help`.
9+
- **Why** a memorable pre-PR convenience that surfaces all advisory checks in one place. It is advisory only -- never edits code, never reseals, and ALWAYS exits 0, so it is safe to wire into a pre-push habit without ever blocking a push; the actual gate stays the four required CI checks (check-now-freshness / validate / check / check-linked-issue). Verified: `make verify` runs all three sub-checks and prints a single summary (seal STALE advisory, warnings OK <= 655, test PASS) at exit 0; `scripts/verify.sh --quiet` prints only the summary line; `VERIFY_SKIP_TEST=1` and `VERIFY_FULL_TEST=1` behave as documented; `make help` lists the new target. L6 gf16 SSOT untouched; catalog stays 83; no gen/ edits; ASCII-only added lines; no quality claim added. Closes #1124.
10+
- **Anchor**: phi^2 + phi^-2 = 3
11+
512
## decl-level-negative-tests -- extend the negative-test gate to module/declaration level (Closes #1123)
613

714
- **WHERE**: `bootstrap/src/compiler.rs` (`mod tests_compiler_rejects`: new `assert_decl_dropped` helper + six tests).

scripts/verify.sh

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
#!/usr/bin/env bash
2+
#
3+
# verify.sh -- single advisory pre-PR umbrella for t27.
4+
#
5+
# The repo has accumulated several small, read-only developer checks, each with
6+
# its own entry point: the NMSE seal-freshness reporter (scripts/reseal-check.sh
7+
# / `make seal-check`, #1106), the #969 dead-code warning meter
8+
# (scripts/warnings-baseline.sh / `make warnings-baseline`, #1119), and the test
9+
# suite. Before opening a PR a contributor wants to glance at all of them at
10+
# once. This script runs them back-to-back and prints a single compact summary.
11+
#
12+
# It is ADVISORY ONLY. It never edits code, never reseals, never blocks: every
13+
# sub-check's outcome is reported and the umbrella ALWAYS exits 0 so it can be
14+
# dropped into a pre-push habit without ever failing a push. The actual gate
15+
# remains the four required CI checks (check-now-freshness / validate / check /
16+
# check-linked-issue); this is a local convenience, not a substitute.
17+
#
18+
# Sub-checks (each best-effort; a missing script is reported as SKIP):
19+
# 1. seal -- scripts/reseal-check.sh --quiet (NMSE seal freshness)
20+
# 2. warnings -- scripts/warnings-baseline.sh --quiet (#969 meter)
21+
# 3. test -- a quick cargo test of the compiler reject/accept suite
22+
# (the negative-test gate from variants K/M/Q), unless
23+
# VERIFY_FULL_TEST=1 asks for the whole binary test run.
24+
#
25+
# Usage:
26+
# scripts/verify.sh # run all sub-checks, print summary, exit 0
27+
# scripts/verify.sh --quiet # print only the final one-line summary
28+
# VERIFY_SKIP_TEST=1 scripts/verify.sh # skip the (slow) test sub-check
29+
# VERIFY_FULL_TEST=1 scripts/verify.sh # run the full binary test suite
30+
#
31+
# Anchor: phi^2 + phi^-2 = 3
32+
33+
set -uo pipefail
34+
35+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
36+
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
37+
cd "$REPO_ROOT"
38+
39+
QUIET=0
40+
if [ "${1:-}" = "--quiet" ]; then QUIET=1; fi
41+
log() { if [ "$QUIET" -eq 0 ]; then echo "$@"; fi; }
42+
43+
# Prefer an explicit cargo if present; fall back to PATH.
44+
CARGO_BIN="cargo"
45+
if [ -x "$HOME/.cargo/bin/cargo" ]; then CARGO_BIN="$HOME/.cargo/bin/cargo"; fi
46+
47+
# Collected one-line verdicts for the final summary.
48+
SUMMARY=""
49+
add_summary() { SUMMARY="${SUMMARY}${SUMMARY:+ | }$1"; }
50+
51+
log "================================================================"
52+
log " t27 pre-PR verify (advisory umbrella; never blocks)"
53+
log "================================================================"
54+
55+
# ----------------------------------------------------------------------------
56+
# 1. NMSE seal freshness (read-only; reseal stays an explicit reviewed step).
57+
# ----------------------------------------------------------------------------
58+
if [ -x scripts/reseal-check.sh ]; then
59+
SEAL_OUT="$(scripts/reseal-check.sh --quiet 2>/dev/null)"
60+
SEAL_CODE=$?
61+
case "$SEAL_CODE" in
62+
0) SEAL_VERDICT="seal:FRESH" ;;
63+
2) SEAL_VERDICT="seal:STALE (advisory; run 'make seal' if intended)" ;;
64+
3) SEAL_VERDICT="seal:UNSEALED (advisory)" ;;
65+
*) SEAL_VERDICT="seal:UNKNOWN (exit $SEAL_CODE)" ;;
66+
esac
67+
log " [1/3] seal-check -> ${SEAL_OUT:-$SEAL_VERDICT}"
68+
else
69+
SEAL_VERDICT="seal:SKIP (script missing)"
70+
log " [1/3] seal-check -> SKIP (scripts/reseal-check.sh not found)"
71+
fi
72+
add_summary "$SEAL_VERDICT"
73+
74+
# ----------------------------------------------------------------------------
75+
# 2. #969 dead-code warning meter (read-only; builds with JSON diagnostics).
76+
# ----------------------------------------------------------------------------
77+
if [ -x scripts/warnings-baseline.sh ]; then
78+
WARN_OUT="$(scripts/warnings-baseline.sh --quiet 2>/dev/null)"
79+
WARN_CODE=$?
80+
case "$WARN_CODE" in
81+
0) WARN_VERDICT="warnings:OK" ;;
82+
1) WARN_VERDICT="warnings:REGRESSED (advisory; above baseline)" ;;
83+
2) WARN_VERDICT="warnings:BUILD-FAILED" ;;
84+
*) WARN_VERDICT="warnings:UNKNOWN (exit $WARN_CODE)" ;;
85+
esac
86+
log " [2/3] warnings -> ${WARN_OUT:-$WARN_VERDICT}"
87+
else
88+
WARN_VERDICT="warnings:SKIP (script missing)"
89+
log " [2/3] warnings -> SKIP (scripts/warnings-baseline.sh not found)"
90+
fi
91+
add_summary "$WARN_VERDICT"
92+
93+
# ----------------------------------------------------------------------------
94+
# 3. Quick test of the negative-test gate (variants K/M/Q) -- the fastest
95+
# high-signal correctness check. Opt into the full suite with
96+
# VERIFY_FULL_TEST=1, or skip tests entirely with VERIFY_SKIP_TEST=1.
97+
# ----------------------------------------------------------------------------
98+
if [ "${VERIFY_SKIP_TEST:-0}" = "1" ]; then
99+
TEST_VERDICT="test:SKIP (VERIFY_SKIP_TEST=1)"
100+
log " [3/3] test -> SKIP (VERIFY_SKIP_TEST=1)"
101+
else
102+
if [ "${VERIFY_FULL_TEST:-0}" = "1" ]; then
103+
TEST_DESC="full binary test suite"
104+
TEST_FILTER=""
105+
else
106+
TEST_DESC="compiler reject/accept gate"
107+
TEST_FILTER="tests_compiler_rejects"
108+
fi
109+
if "$CARGO_BIN" test --bin t27c $TEST_FILTER >/dev/null 2>&1; then
110+
TEST_VERDICT="test:PASS ($TEST_DESC)"
111+
log " [3/3] test -> PASS ($TEST_DESC)"
112+
else
113+
TEST_VERDICT="test:FAIL ($TEST_DESC) -- advisory, inspect with 'cargo test'"
114+
log " [3/3] test -> FAIL ($TEST_DESC) (advisory; re-run 'cargo test --bin t27c' for detail)"
115+
fi
116+
fi
117+
add_summary "$TEST_VERDICT"
118+
119+
log "----------------------------------------------------------------"
120+
log " advisory only: never edits code, never reseals, never gates CI."
121+
log " required CI checks remain: check-now-freshness / validate /"
122+
log " check / check-linked-issue."
123+
log "----------------------------------------------------------------"
124+
125+
# Final compact summary. Always printed (even with --quiet) and we ALWAYS exit 0
126+
# so the umbrella is safe to wire into a pre-push habit without ever blocking.
127+
echo "verify: $SUMMARY"
128+
exit 0

0 commit comments

Comments
 (0)