fix(pkg): cave#317 root fix — COMMON-LISP's externals are enumerable; uses-walk gets CL's baked terminalVerified

The twin-minting root cause, empirically pinned by prefix bisection
(and NOT the wire/emission channels two earlier theories blamed):
external-symbol-p special-cases CL as implicitly-all-external, but
the ENUMERATION side (pkg-exports / do-external-symbols) returned
only CL's near-empty explicit export list.  uiop/common-lisp's
(:use-reexport :common-lisp) therefore captured almost nothing, so
every package reaching CL only THROUGH it (all of uiop/asdf)
genuinely failed accessibility resolution for CL names: the
uses-walk missed, the cave#307 recursion never descended (gated on
the same empty exports), the baked-pool stage rejected on
non-transitive accessibility — and the reader minted package-own
twins (UIOP/UTILITY::SECOND) that only the name-keyed call fallback
kept alive, in source loads and compile-file alike.  This is the
pathology that made ADR-0032 B.2's rule-2 raise fatal.

Fix, two pieces at the true root:
- %cl-external-symbols: CL's external set now includes its baked
  static pool records (lazy one-shot 40-byte-record walk, cached;
  name-based CL test per cave#191's primordial-vs-runtime cons
  split), unioned with the explicit list in %pkg-external-symbols —
  so uiop/common-lisp's reexport actually captures CL.
- %cl-baked-terminal in find-symbol-via-uses-walk-d: CL's VIRTUAL
  own table (runtime alist ∪ baked pool) is now visible to the
  cave#307 recursion's terminal lookup, so an inherited CL name
  reached through a reexporting intermediary resolves to the ONE
  canonical record.

Verified: the pinned minimal repro (uiop prefix + the &aux defun) no
longer twins and find-symbol returns the canonical record; the FULL
asdf compile-file is twin-free; 8/8 sharded suite, smoke, spike
suite 16/0, alexandria via the auto-loaded fasl, 12/12 package edge
probes.  Costs, on the record: asdf compile ~5m21s (was ~4-5m) and
replay boot 171.5G instructions (+6.5%) — the ballooned reexport
lists pay linear membership scans; the dormant ag-pkg-exp name-index
(cave#313) is the designed answer, and cave#313's mystery should be
RE-TESTED now that the junk-uses/twin pathology it may have been
measuring is gone.

Probe-hygiene lesson encoded in cave#317's thread: probe sessions
auto-load build/asdf.funclfa at boot — every twin probe must mv the
fasl aside or it measures the replayed state, not the probe's.

Unblocks: ADR-0032 B.2 pkgsym bind migration (re-test cave#316's
__G63__ after this — codex rates it plausibly downstream).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Anthony Green2026-07-14 20:51:11 -0400 95938a924391cd2b9097450b2f1110a689bb6487
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>