fix(conditions): gate the CLOS-condition tier on a persisted marker (cave#294)Verified
f2767ea's mc probes put a baked-function call (ag-fn-lookup) on the UNIVERSAL error path. At the host-built stage1, runtime-compiled code (stdlib loaded at boot, REPL forms) cannot call ANY baked defun — the call traps and spins — so every condition raise died: handler-case, condition-system-stubs, bitwise-and-arithmetic, fboundp bootstrap tests all failed. Fix (stdlib/mini-clos only; not in COLD_SRCS, zero fixed-point risk): - New *mc-conditions-live* stdlib defvar; mini-clos SETQs it T at load (after mc-conditions-init-builtin — *mc-print-hook* precedent). - All six f2767ea mc sites (%cond-mc-inst-p, %mc-accessor-fallback, %define-condition-runtime, make-condition, both printer arms) check the flag — a same-tier defvar read, the only probe safe in every tier — BEFORE any ag-fn-lookup. stage1: mc never loads, flag NIL, cons-tier conditions (pre-f2767ea behavior). stage2/funcl: flag T, instance tier as before. - %condition-image-tables/-restore-tables gain slot 3 carrying the flag across save-image (the cave#291 channel — bake-time values do not survive restore, cave#244); old 3-slot images read NIL and the mc arms come up safely off. save-image round-trip verified: restored image still builds instances (typep T). - %fn-lookup-hit-p belt kept at the sites (a degenerate lookup result can never feed NIL into a numeric compare again). - fboundp: pure-stdlib special-operator-p arm reordered first and the ag-macro-known-p (baked) arm handler-case-wrapped — the same stdlib-calls-baked-fn class made (fboundp t) exit 1 in stage1 a.outs. Verified: stage1 handler-case → BAD / nested → b; 4 of the 5 cave#294 tests pass; native tier unregressed (typep/make-condition T, handler-case catches, defclass smoke); fasl oracle still 4/4; make build green. The residual save-image-restart-evaluates failure is OUT of this family: stage1 (save-image …) core-dumps at f2767ea~1 too (gdb: AG-SAVE-IMAGE-ACTION) — an older stage1 save-path breakage, filed separately, as is the root "stage1 runtime code cannot call baked defuns" class. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By:
Claude Opus 4.8 <noreply@anthropic.com>