Skip to content

rando - #89

Merged
codecaaron merged 8 commits into
mainfrom
feat/system-vocab-registration
Sep 4, 2026
Merged

rando#89
codecaaron merged 8 commits into
mainfrom
feat/system-vocab-registration

Conversation

@codecaaron

Copy link
Copy Markdown
Owner

No description provided.

codecaaron and others added 8 commits August 20, 2026 11:32
`resolve_exports_entry` did an exact-key `exports.get()` and implemented no
subpath patterns, so every `"./*"`-style exports map (e.g. `@ark-ui/react`
5.36.2) was unresolvable to the system loader while Node and Vite resolve
the same specifier fine. The `rust-system-loader` spec already requires a
Node-style resolver; this closes the pattern half of it.

Node's semantics, matched: an exact key answers first, then `"./*"`
patterns by PATTERN_KEY_COMPARE specificity (longest literal prefix, ties
broken by longest suffix), with the matched segment substituted into the
resolved target. A subpath that matches nothing still returns `None`, so
`resolve_bare_specifier` falls through to `module`/`main` exactly as before
and the `.` entry is untouched.

Also corrects the `animus.keyframes.external-entry-failed` remediation
text. Discovery registers TWO scan entries for a subpath-declared kit — the
declared entry and a derived alias for the package ROOT module (deliberate:
collections routinely live only there, pinned by collect-external-packages'
"a derived root alias scans its root entry for keyframes too"). The old
message told the reader collections "must be reachable from the package's
definition entry", which is advice a consumer with a framework-free
definition entry has already followed and which never silences the root
barrel. The message now names the scan set it actually walks; the scan
itself is unchanged. `library-authoring.mdx` is restated to match.

Tests (red first):
- resolve_exports_entry_wildcard_subpath_pattern
- resolve_exports_entry_wildcard_longest_prefix_wins
- resolve_exports_entry_without_pattern_still_falls_through (fall-through guard)
- resolve_bare_specifier_through_wildcard_exports (fixture package.json on disk)
- external-keyframes: "the entry-failed message describes the whole scanned-entry set"

Verification: vp run verify, verify:hygiene:rust, verify:parity (66/66,
register stays []), verify:integration, verify:packed — all exit 0.

Refs .scratch/agent-styling-perspective/issues/11-exports-wildcard-resolution.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQuCHBc6HCuzoa77JyBwA4
…eyframes → seal()

Keyframe collections become declared vocabulary: build() keeps its pinned
{ system, createGlobalStyles, createKeyframes } shape and additionally
opens a LINEAR registration window — each registerKeyframes() returns the
bundle carrying the accumulated vocabulary axis (template-literal
collision labels; index-signature maps rejected), and seal() closes it,
returning the final instance with a frozen, version-marked,
declaration-ordered vocabulary record. extend() threads the axis from
sealed sources via an optional-phantom inference (no second overload — a
sealed-specific overload measured 140-309s TS2589 detonations on consumer
shapes), including LibraryBundle<V>/LibraryBundleFor<S> publication.
Collisions: compile errors on typed paths; coded record entries
(animus.vocabulary.collision) with winner-at-own-position ordering on
erased paths. Frame payloads are deep-copied + frozen at registration;
prop/group sources and the registry snapshot are captured once at build()
so the bundle's two instances can never disagree.

Strict extend()-requires-sealed is deferred to the atomic migration
increment (openspec Ledger DEF-11) and pinned by an it.fails test.

Full inc-02 adversarial review (14 findings) dispositioned in the change
journal; openspec change: system-vocabulary-registration (local-only).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQuCHBc6HCuzoa77JyBwA4
… guard

loadSystemModule now reads keyframe collections from a sealed system's
registration record (getVocabularyRecord): declaration-ordered into the
unchanged { exportName: { keyName: { name, frames } } } wire via
Object.fromEntries in-context (no HashMap on the path; byte-identical
across fresh loads, test-witnessed), with exported-but-unregistered
collections excluded and a wrong version marker failing the load loud.
Collision witnesses ride a new vocabulary_collisions SystemConfig/NAPI
field (code animus.vocabulary.collision) — the record, not the shimmed
console, is the witness channel. Multiple DISTINCT toConfig-bearing
exports without an explicit exportName now fail the load naming every
candidate (dual-built-theme precedent) instead of first-picking.

Staging (deleted with the migration increment): record ABSENCE still
falls back to the export scan so un-migrated fixtures keep loading; the
fallback pin test is named for that deletion.

Route green: system-loader 60/60, clippy, hygiene:rust, unit:rust,
canary, parity 66/66 (register []), integration 156, verify:compile.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQuCHBc6HCuzoa77JyBwA4
…gnostic

Two engine witnesses at the unit seam: registration-key-equals-export-name
proves substitution end to end (rewritten from the string-presence test),
and a mismatched key skips the reference AND fires the new stable code
animus.keyframes.unregistered-reference (trailing-marker convention lifted
by diagnostic_code_from_message; severity warn, documented and pinned —
strict escalation belongs to the strict-mode contract).

The code is minted ONLY at keyframe-eligible value positions: eligibility
threads through the eval recursion (animationName/animation own it;
responsive maps and nested selector/at-rule blocks inherit it), so the
type-licensed responsive form animationName:{_:ref} is witnessed while
color:palette.brand can never carry a keyframes code — both directions
test-pinned. Reason text speaks registration (build() → register → seal();
key = export name); scan/reachability language is gone, including the
stale no-statics comments. Restored the registry-over-static precedence
witness and pinned the pre-existing dead-@Keyframes emission on mismatch.

Route green: extract-v2 559 lib tests, clippy, hygiene:rust, unit:rust,
canary, parity 66/66 (register []), integration 156.

Increment 04 of openspec change system-vocabulary-registration (local);
delegated implementation + independent adversarial review (11 findings
dispositioned in the change journal).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQuCHBc6HCuzoa77JyBwA4
…an is gone

Migration (one tree state, no midpoint): all nine app fixture systems +
showcase + test-ds + both test fixtures register their collections and
export the SEALED instance; test-ds's kitMotion relocates into the
definition graph (defined/registered in system.ts, root re-export keeps
consumer imports and the engine's export-name resolution — the vite-app
kit witness survives byte-exact, SET-IDENTICAL pre/post).

Deletion (total): the NAPI scan entry point + regenerated bindings, the
loader's scan fn + its three unit tests, the external-keyframes merge
module + test, discovery's scan-entry population (the root-alias
module-resolution redirect STAYS, pin rewritten), both host orchestration
copies (vite-plugin context/build-start, extraction session), every
plugin scan mock, both scan-era animus.keyframes.* codes.

Flips: extend() rejects unsealed sources; the loader refuses recordless
systems loud; hosts surface the sealed record's coded witnesses via one
shared fail-closed mapper (vocabularyWitnessDiagnostics + unit tests).

New: the D4 legacy-verb witness — a sealed kit with registered vocabulary
consumed through from()/includes: records animus.vocabulary.legacy-verb
(positional source label; seal-time filtering never claims a name that a
separate .extend() delivered; no console noise in shipped bundles). Fires
on exactly the three deliberate legacy lanes, warn severity, lanes green.

Docs swept to the sealed shape (Quick Start, create-system, system-setup,
library-authoring, global-styles, selectors, builder-chain, svelte,
migration, component-test, README, CLAUDE.md). Oracle fixture refreshed
to the relocated facts (340/340). Teaching page rewritten to registration.

Verified: lint/compile/types/unit:ts(146f/1773)/unit:rust/clippy/hygiene/
canary/parity(66/66, register [])/integration/packed/workers + all eight
owner lanes green; repeated-build keyframes determinism witnessed.

Increment 05 of openspec change system-vocabulary-registration (local);
two adversarial review rounds (14+14 findings) dispositioned in the
change journal.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQuCHBc6HCuzoa77JyBwA4
registerGlobalStyles() rides the same linear window as registerKeyframes
on ONE shared vocabulary name-space (cross-kind collisions are compile
errors and runtime-witnessed); the internal entry state is a tagged union
with a single merge policy. The sealed record's globalStyles array carries
{ name, styles, fontFaces? } declaration-ordered; the loader maps it into
the unchanged { exportName: { styles, fontFaces } } wire in record order
and the export scan (extract_global_style_blocks, the loader's last
HashMap-ordered collection path) is deleted. Every fixture registers its
globalStyles block before seal(); pre/post global-layer rule sets are
SET-IDENTICAL on vite-app and showcase; fresh-load byte determinism is
test-pinned. DEF-8 audit: zero __brand discovery paths remain.

Route green: system 23 vocab tests + shared-axis test-d proofs, loader
59, clippy/hygiene/unit:rust, canary, parity 66/66 (register []),
integration, lint/compile/types/unit:ts (146f/1777), all eight owner
lanes, packed.

Increment 06 of openspec change system-vocabulary-registration (local).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQuCHBc6HCuzoa77JyBwA4
Every teaching surface had drifted into shapes the current pipeline
rejects (round-2 review: Quick Start and global-styles pages still
taught export discovery; the root README destructured an unsealed
system). Rather than repair them a third time, the written docs are
deleted until the API freezes:

- packages/showcase/src/content/** (29 MDX pages) deleted; nav trimmed
  to Overview (an honest offline placeholder) + Examples, which stay
  because they are extracted and asserted every verify run
- root README and @animus-ui/system README stripped to install +
  a documentation-withheld note pointing at the type definitions and
  the verify-pinned in-repo consumers as the sources of truth
- MDX toolchain and MDXProvider stay wired so the extraction surface
  is unchanged and restoration is additive

verify:lint, verify:compile, @animus-ui/showcase#verify all green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DQuCHBc6HCuzoa77JyBwA4
@codecaaron
codecaaron merged commit 200bc04 into main Sep 4, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant