---
title: Morfo — the declarative contract
type: reference
audience: human + agent
authority: E1 architecture — the cross-layer contract layer (DNA)
status: current
source: migrated from src/uix/morfo/README.md (2026-07-02, docs-book F7.2)
---
# Morfo
**The cross-layer contract of a component's public DOM surface.**
Morfo is the single source of truth for a component's parts, data-attrs, ARIA contract, keyboard shortcuts, focus policy, and public event contract. The same morfo is consumed by soma (to wire the headless provider), by eidos (to generate CSS selectors), by sema (to bind perceptual channels), and by the docs site (to render part tables).
**One file per component**, at `src/uix/morfo/components/{kebab}.ts` . No prose — that's the component's README. No props — those live in `types.ts` with JSDoc. Component-owned text slots may live in `texts` (idlangrefs) when they are part of ARIA labels, live-region text, or internal functional labels — the multilingual catalog itself lives in `src/uix/langs/components/{kebab}.ts` . Everything else is the machine-readable contract.
## Why morfo exists
Without morfo, a component's structural information used to live in many places:
- Part names in manual attr maps inside the provider.
- Data-attr enums in manual contract registration inside the provider.
- ARIA emission hardcoded in the provider's `$derived.by(...)` props.
- Keyboard handlers scattered across the provider.
- Public event names and their transport split across provider code, docs, and consumers.
- Prose descriptions in the README.
- Selector strings duplicated in eidos CSS, sema `.csem` , docs tables.
Renaming a part (`content` → `panel` ) used to mean touching 6+ locations with zero automatic verification. Cross-layer drift (soma emits `data-dialog-content` , eidos styles `data-dialog-panel` ) was silent.
With morfo, **every location reads from the same declaration** . Parts, data-attrs, enum values, and component-owned translation keys are authored once. `compileMorfo` , `registerMorfo` , `SomaRuntime` , and the selector helper `createAttrs` consume the morfo directly. A smoke test validates the real DOM against the declaration on every CI run.
---
## What morfo contains
A `Morfo` is a plain TypeScript constant that describes:
- **`name`** — PascalCase display name (`"Dialog"`).
- **`kebab`** — kebab-case identifier (`"dialog"`), matches the public `data-{kebab}` marker.
- **`scope`** — which layers implement this component: `['soma']` , `['soma', 'eidos']` , etc.
- **`apg`** — optional URL to the WAI-ARIA APG pattern when the component implements a formal one.
- **`focus`** — optional focus policy for overlays / composites.
- **`events`** — the component's public event surface: which semantic occurrences it may emit and expose to cross-layer consumers.
docs+fix: old docs quarantined in docs/old-deprecated; STUMBLES doc-class fixes
Two user findings from the Knob build exercise (an agent building a new
component from the docs alone — STUMBLES.md).
Quarantine: the superseded fossils no longer share shelf space with the
live corpus. docs/old-deprecated/ (with an index README explaining what
lands there and pointing readers at docs/README.md) now holds the
executed audits and fix plans: fable_audit, fable-eidos-audit,
inherit_audit + inherit_fix_plan, ARCHETYPE_COHERENCE_AUDIT_2026-06-19
(still citable — the component-guide banner and the eidos components
README repoint to it), COMPONENT_COHERENCE_AUDIT. pendiente.md (a live
pending list, not a fossil) moved to docs/process/. docs-check treats
the folder as sealed chronicle (I1/I2 exempt; I6 skips its internal
links, as its README promises). Root-level *.md is now: README, CLAUDE,
AGENTS + the user's own working files.
STUMBLES fixes applied on the spot (the doc-class ones):
- #2 kind drift: the REAL enum is 'public' | 'private' | 'virtual'
(MorfoPartKind, 671/9/14 uses) — morfo.md omitted 'private', the
checklist invented 'internal' (0 uses). Both fixed; I2 gains the
phantom-'internal' guard. A-2.1's row now says what the audit script
actually checks (kebab only — the archetype may vary, the Toggle
provider-IS-trigger doctrine).
- #6: the langs catalog SHAPE (flat keys, per-language leaves, named
export, index registration) is now shown in morfo.md instead of only
its location.
- #8: component-audit s0 defines the minimum brief package as an
explicit 8-file list.
The engineering-class stumbles are registered as plan batches S1-S6
(generated vocabularies appendix, continuous-gesture trigger doctrine,
part-absent condition, Gesture.rotate, the soma->eidos CSS-var
contract, minor frictions). docs:check 0 errors, 11-warn baseline.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 months ago
- **`texts`** — optional component-owned text slots, declared as idlangrefs (`'#?components.{kebab}.{key}|Fallback'`). The multilingual catalog itself lives in `src/uix/langs/components/{kebab}.ts` and is registered by `ActiveUix` under `components.{kebab}.*` . Its shape (flat keys, per-language leaves, named export `{camelKebab}Langs` registered in `langs/components/index.ts` ):
```ts
import type { LangNode } from '$libs/langs';
export const knobLangs = {
label: { es: 'Dial', en: 'Knob' }
} satisfies LangNode;
```
- **`parts`** — the part tree (recursive). Each part declares:
docs+fix: old docs quarantined in docs/old-deprecated; STUMBLES doc-class fixes
Two user findings from the Knob build exercise (an agent building a new
component from the docs alone — STUMBLES.md).
Quarantine: the superseded fossils no longer share shelf space with the
live corpus. docs/old-deprecated/ (with an index README explaining what
lands there and pointing readers at docs/README.md) now holds the
executed audits and fix plans: fable_audit, fable-eidos-audit,
inherit_audit + inherit_fix_plan, ARCHETYPE_COHERENCE_AUDIT_2026-06-19
(still citable — the component-guide banner and the eidos components
README repoint to it), COMPONENT_COHERENCE_AUDIT. pendiente.md (a live
pending list, not a fossil) moved to docs/process/. docs-check treats
the folder as sealed chronicle (I1/I2 exempt; I6 skips its internal
links, as its README promises). Root-level *.md is now: README, CLAUDE,
AGENTS + the user's own working files.
STUMBLES fixes applied on the spot (the doc-class ones):
- #2 kind drift: the REAL enum is 'public' | 'private' | 'virtual'
(MorfoPartKind, 671/9/14 uses) — morfo.md omitted 'private', the
checklist invented 'internal' (0 uses). Both fixed; I2 gains the
phantom-'internal' guard. A-2.1's row now says what the audit script
actually checks (kebab only — the archetype may vary, the Toggle
provider-IS-trigger doctrine).
- #6: the langs catalog SHAPE (flat keys, per-language leaves, named
export, index registration) is now shown in morfo.md instead of only
its location.
- #8: component-audit s0 defines the minimum brief package as an
explicit 8-file list.
The engineering-class stumbles are registered as plan batches S1-S6
(generated vocabularies appendix, continuous-gesture trigger doctrine,
part-absent condition, Gesture.rotate, the soma->eidos CSS-var
contract, minor frictions). docs:check 0 errors, 11-warn baseline.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 months ago
- `name` , `kebab` , `kind` (`public` — consumer-composed · `private` —
rendered only by soma/eidos defaults but still styled + contract-checked ·
`virtual` — DOM-less coordinator, ignored by the contract validator; the
source is `MorfoPartKind` in `morfo/types.ts` ).
- `archetype` — optional cross-component classification (see "Archetypes" below).
- `defaultElement` (advisory), `role` (always-emitted).
- `optional` , `supportsNesting` .
- `states` — the state names this part can be in.
- `data` — data-attributes emitted, with enum values when applicable and optional runtime source metadata when the contract wants to declare where the attr comes from.
- `aria` — ARIA attribute contract (attr + value source + condition).
- `keyboard` — keyboard shortcuts relevant when the part has focus.
- `parts` — nested sub-parts (recursive).
See [`types.ts` ](../../src/uix/morfo/types.ts ) for the full TypeScript shape.
## What morfo does NOT contain
| Not in morfo | Lives in | Reason |
| ----------------------------------------------- | ---------------------------------- | ---------------------------------------------------------------------- |
| Summary, overview prose | `{component}/README.md` | Editorial, not contract |
| Comparison vs Radix / Base UI / Bits | `{component}/README.md` | Third-party drift shouldn't pollute the contract |
| Usage examples | `{component}/README.md` | Narrative |
| Props (names, types, defaults) | `{component}/types.ts` with JSDoc | Canonical source is TS + JSDoc |
| Shared/common translations | app/langs catalog under `common.*` | Shared vocabulary should not be duplicated per component |
| Provider-only id constants | optional `{component}/langs.ts` | Constants are code ergonomics; the catalog lives in `langs/components/{kebab}.ts` or app langs |
| Event handlers / runtime wiring, state machines | `{component}-provider.svelte.ts` | Execution logic, not contract data |
| Visual variants / recipes | `src/uix/eidos/` (future) | Layer-specific, not shared |
---
## How morfo gets executed (architecture)
Morfo is **declarative** . By itself it doesn't render, doesn't bind events,
doesn't write to the DOM. The piece that does is `SomaRuntime` , which lives
in `soma/` and consumes a morfo together with the provider's reactive sources.
The closed architecture (post-2026-04-25) has six pieces with disjoint
responsibilities:
```
Morfo declares
SomaRuntime transcribes
Provider supplies sources, targets, handlers
Effects sync attrs from state
EngineSemantic dispatches signals to perceptual channels
VisualChannel materializes the signal in the DOM (data-event*, hold, cleanup)
ADom applies DOM mutations (structural commit)
```
### What each morfo field maps to at runtime
| Morfo field | Runtime executor | Purpose |
| ----------------------------- | ------------------------------------ | ----------------- |
| `parts[].data` (with `value` ) | Effect of attrs | Reactive `data-*` |
feat(morfo,soma): el attr de nombrado es un DEFAULT del contrato, no una imposicion
A-85 estaba confirmado desde el ledger de blocks: la demo de site-header
escribia `aria-label` en el trigger del cajon y el canon lo pisaba. El censo
dio la magnitud real — 132 declaraciones en 59 morfos — y la disposicion
escrita (replicar el `prop-truthy` de button en las 132) resulto ser la
direccion inversa a la buena: obligaba a 264 entradas de boilerplate y hacia
que el texto del consumidor diese una vuelta entera por el grafo reactivo para
aterrizar donde ya estaba.
Las 132 declaraciones eran CORRECTAS. El defecto era la precedencia. Asi que
el contrato gana dos clases, por VOCABULARIO y no por declaracion:
contract (role, data-*, aria-expanded, aria-controls, roledescription...)
el runtime SIEMPRE gana; un consumidor que los pisara haria mentir
al componente, y esa garantia es algo que las librerias
user-props-last no tienen.
naming (`ARIA_NAMING_ATTRS`, hoy `aria-label`) el morfo da un DEFAULT y
el attr explicito del consumidor gana — espejo de la propia cadena
de nombre accesible de la plataforma.
Tres puntos, uno por capa, y ninguno de los 132 morfos tocado: `compileMorfo`
clasifica el plan (`consumerWins`) y deja de hoistear esos literales a
staticAttrs; el runtime los saca del efecto `syncAttrs` —el `dom.apply`
post-render ERA el pisado— y los embarca en el bag de la parte, el mismo
vehiculo que `dir`; y `mergeProps` los resuelve consumer-first (`a ?? b`, para
que un `aria-label=""` explicito sobreviva).
Efecto medido que no se buscaba: los labels salen ahora en el HTML de SSR. Antes
los escribia un efecto, que en servidor no corre — el propio ledger lo tenia
medido y nadie habia atado los dos cabos.
`aria-labelledby` se queda en contract A PROPOSITO: es cableado `partRef`, y la
plataforma ya hace que un labelledby del consumidor gane a cualquier label sin
que tengamos que arbitrarlo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
| `parts[].aria` | Effect of attrs — except NAMING attrs (`aria-label`), which ship in the part's render bag so the consumer's attr can win (see Step 4) | Reactive `aria-*` |
| `parts[].role` | Effect of attrs | Stable role |
| `parts[].keyboard` | `runtime.keydown(part, event)` | Key dispatch |
| `events[].prewrite` | `trigger()` step 1 | Transient markers |
| `events[].semantic` | `trigger()` step 2 (emit payload) | Perceptual signal |
| `events[].commits` | **Nobody executes** ; smoke validates | Documentation |
| `focus` | Configures FocusScope layer | Layer bootstrap |
`commits` is **descriptive** , not prescriptive. The actual causal chain is
`handler -> state mutation -> effect -> dom.apply` . The `commits` declaration
documents what an external observer will see and is checked by the smoke
suite.
### The `trigger(eventName)` sequence
```
1. prewrite imperative (data-last-action, etc.)
2. await semantic.emit(event)
3. provider's synchronous handler mutates state
4. effects derive and apply structural attrs (data-state, aria-*)
```
State is the only source of truth. The DOM is derivative.
### Provider responsibilities
The provider supplies what morfo cannot infer:
```ts
const runtime = createSomaRuntime(morfo, {
dom: this.soma.dom,
eventEngine: this.soma.events,
states: { open: () => this.opts.open.current },
props: { disabled: () => this.opts.disabled.current },
parts: { content: () => this.contentId.current },
events: {
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
'emerge-open': () => {
this.opts.open.current = true;
},
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
'emerge-close-cancel': () => {
this.opts.open.current = false;
}
}
});
```
Each part-provider then renders only the static identity:
```ts
readonly props = $derived.by(() => runtime.partProps('trigger'));
// returns: { id, ref attachment, 'data-{component}-trigger': '' }
```
Everything mutable (`role` derived from prop, `aria-*` , `data-state` , `data-intent` )
is written by the runtime's effects via `dom.apply` . Svelte does not render
those attrs.
### Operational rules
- `partProps(part)` returns only static identity (id, ref, marker).
- `dom.apply` is the only writer of mutable attrs.
- Event handlers are synchronous. Async work happens before `trigger()` is called.
- Guards (`if (disabled) return`) live at the call-site, not inside the handler —
if they enter the handler, the perceptual signal already fired.
- `Semantic` may use `Dom` (downward dependency); `Dom` does not know `Semantic` .
See [overview.md ](./overview.md ) §2.bis for the cross-layer view.
---
fix(sema,morfo,soma): una superficie no admite dos ocurrencias, y el nombre ya no miente
`data-event-*` es UNA RANURA por elemento. Tres auditorias independientes
encontraron el mismo defecto y ninguna lo cerro: fable S1 (2026-07-01, con el
README diciendo «findings executed»), sema S-17 (2026-08-05, midio el estampado
del knob muriendo a los 24ms de un hold de 240) y blocks A-36/A-65 (reproducido
en navegador, dos estampados a 1,1ms). Lo que faltaba no era diagnostico: nadie
podia distinguir una redireccion legitima de una deriva, porque la opcion que
redirigia se llamaba `fallbackTarget` y hacia lo contrario de lo que decia.
EL NOMBRE PRIMERO. `fallbackTarget` -> `targetOverride` (202 apariciones, 64
ficheros, dirigido con `git ls-files`). Siempre GANO sobre el ref registrado; el
nombre honesto es la precondicion para auditarlo. Las cronicas conservan el viejo
por diseño.
LA PROPIEDAD. `unstampEventAttrs` recibia el signal y lo DESCARTABA, asi que la
ocurrencia que terminaba antes borraba a la que tenia la ranura. Ahora comprueba
`data-event-id`. Con eso, `replace` deja de ser el comportamiento roto y pasa a
ser el suelo correcto.
A-36, SIN `regime`. Los cuatro overlays cedian el estampado del `open` al
trigger por un workaround de la era `sequence: 'pre'`; con `post` el content ya
esta montado. Retirado el override (float-panel migrado `pre`->`post`, ultimo
fuera de la doctrina que sema.md escribe). Medido en /blocks/site-header/preview
a 375px: contact-activate en el TRIGGER +18,7ms y open en el CONTENT +20,6ms,
con press-squeeze y slide-from-right-full corriendo. Antes: los dos en el
trigger, press-squeeze jamas.
`regime` DEFINIDO — y son dos valores, no cuatro. `replace` (default) y `queue`,
este solo para las 4 parejas irreducibles: los tres toggles (el provider ES el
boton) y el knob. `collapse` retirado (su caso murio con la propiedad: medido, 0
huecos en 5 emisiones a 72ms) y `lock` retirado (significaria «un cierre que no
se anuncia»), con sus 4 declaraciones muertas.
El guard de `queue` PASO EN VERDE SIENDO INCORRECTO: con timers falsos no hay
animaciones, asi que awaitExpression volvia al instante. El navegador midio el
commit encolado llegando 1,6s tarde. `queue` espera el HOLD, no la expresion.
Medir la envolvente no es medir la salida.
`renderAttrs` — los attrs que no son partes. Vaciar ACTIVE_DEV_TRACK (palabras y
chronos ya no estan excluidos) destapo 23 `data-palabras-*` que ningun morfo
declaraba y que palabras.css SI estiliza: aterrizan en el arbol que el usuario
escribio, asi que no pueden ser partes. Campo nuevo con la linea afilada —si el
consumidor puede componerlo, es una PARTE— y 3 consumidores (palabras, waveform,
aura). Declarado en types.ts Y en el esquema sium: la leccion de MorfoElement.
Ademas: 5 selectores muertos en el predicado del focus-scope de palabras
(barrido de todo el repo: aparecian solo ahi) · RTL-1 real en palabras-chrome
(inset logico + translate fisico = doble volteo; rtl:check 1->0) · el union
inline al `Direction` canonico, que destapo que el censo de direccion grepea el
NOMBRE del tipo · deuda de chronos (scope, barrel, README).
Y de la cola: S-36 (barrel 68->71 + guard), S-31 (vibrate(NaN)), S5 (la
preferencia de reduced-motion del usuario ya gana a los channels del morfo), SO2
(el warn que el JSDoc prometia), SO4 (validar el target antes del prewrite).
Todos los guards nuevos vistos fallar antes de arreglar nada.
Base: check 74 (= base) · sema+morfo+contracts 454 verdes / 6 ajenos
preexistentes · soma navegador 1258/1259 (el rojo es un timeout ajeno,
reproducido con los cambios en stash) · docs:check 0/618 · rtl:check 0/177.
Handoff: docs/process/CONTINUE-perceptual-surface.md
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
## `renderAttrs` — the attrs that are not parts
Some components write `data-{component}-*` onto elements that **are not parts
and never could be**:
- a document engine marks the user's OWN tree — `palabras` stamps block kind,
heading level, syntax tokens and i18n state on `<blockquote>` / `<table>` /
`<figure>` nodes whose shape depends on what the user wrote;
- a component marks its internal render nodes — `waveform` 's two `<path>` s,
which its own source already calls "eidos-only hooks".
They cannot be `parts[]` (the morfo could never enumerate them) and they cannot
be `data-_*` (the private prefix is outside morfo by design, and eidos STYLES
these — `palabras.css` alone has rules for 23). That left a real cross-layer
contract, soma writing and eidos reading, that **nothing declared** — which is
what morfo exists to prevent.
```ts
renderAttrs: [
{ attr: 'data-palabras-block' },
{ attr: 'data-palabras-heading-level' },
{ attr: 'data-palabras-untranslated' }
]
```
**Where the line is drawn, and it is sharp: if a consumer can compose it or
address it, it is a PART.** `renderAttrs` is for what the component renders
internally and the consumer never composes. It buys no runtime writer — the
component emits them itself, as it always did; what it buys is that the
contract is declared, greppable and guarded (`contracts.test.ts` reads this
file, so an attr that is neither a part nor declared here fails).
Added 2026-08-10, when lifting `palabras` ' catalogue exemption exposed 23
undeclared ones. Like `MorfoElement` , the vocabulary lives in TWO places —
the TypeScript shape in [`types.ts` ](../../src/uix/morfo/types.ts ) and the sium
schema in [`schema.ts` ](../../src/uix/morfo/schema.ts ). Touch both in one edit.
---
## Archetypes — cross-component part classification
Beyond the component-specific `kebab` , a part can declare an `archetype`
that tags it as part of a cross-component category. This is what lets
**eidos** style "all triggers" or "all overlays" with a single transversal
selector instead of enumerating every component.
```ts
{
name: 'Trigger',
kebab: 'trigger',
archetype: 'trigger', // ← cross-component category
role: 'button',
// ...
}
```
The runtime emits `data-archetype="..."` on the part's DOM element via
`partProps` . Static identity (never mutates), so it ships through
`partProps` , not through `dom.apply` .
### Vocabulary
The canonical inventory is the `ARCHETYPE_VOCABULARY` const in
[`types.ts` ](../../src/uix/morfo/types.ts ) — the single source; do not copy the list into
prose (a copied list here survived at 24 entries while the code grew to
feat(docs): S1 — generated canonical-vocabulary appendix (STUMBLES #1)
An agent building a component from the docs-book alone could not assign
archetypes / holds / haptic kinds: the closed sets live only in code consts
and the corpus (correctly) forbids copying them into prose, so they were
invisible from the docs. STUMBLES #1, the top stumble.
Fix: docs/canon/vocabularies.md is GENERATED from the consts by
'npm run docs:vocabularies' — the ONE sanctioned place the lists are spelled
out (generated = no drift objection), which every other doc links to. It
covers part archetypes (with a one-line role each), sema families with their
default hold/persistence + per-intent overrides, verbs by family, intents,
the perceptual-duration scale, haptic kinds, the 33 palette scales, sizes,
variant archetypes, and the shared common.* strings.
- scripts/docs-vocabularies.ts imports the consts (robust — no fragile
JSDoc/regex parsing) and formats them; the generation is an exported
function so docs-check can compare.
- Added ARCHETYPE_DESCRIPTIONS to morfo/types.ts (co-located with
ARCHETYPE_VOCABULARY, satisfies Record<MorfoArchetype,string>) as the
authoritative one-liners the appendix reads — descriptions become
first-class data instead of inline union JSDoc a tool would have to parse.
- docs-check gains I7: it regenerates in-memory and fails if the committed
file drifts from the consts (negative-tested: corrupt -> error, regen ->
green). The appendix's own counts pass I1, so I1 doubles as a second guard.
- Linked from README (E2 canon row + two 'I want to' shortcuts), CANON.md
(doctrine here, enumerated lists there), architecture/morfo.md (pick a
part's archetype), and the component-audit minimum-package list (STUMBLES
#8).
docs:check 0 errors; npm run check unchanged in my files.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 months ago
26). The **generated list with a one-line role for each** archetype lives at
[`canon/vocabularies.md` ](../canon/vocabularies.md ) (from
`ARCHETYPE_DESCRIPTIONS` ) — read it to pick a part's archetype. Validated by
the sium schema. Optional field — omit when a part is genuinely unique to its
component (`Slider.Range`, `PinInput.Segment` internals).
### Provider as trigger vs container
When `Provider` IS the interactive element (Toggle, Switch, Checkbox —
where `defaultElement: 'button'` and the user clicks the Provider itself),
its archetype is `'trigger'` . When `Provider` is just a root container
(`defaultElement: 'div'/'section'/'nav'`), archetype is `'provider'` .
Decide per-morfo.
### Adding a new archetype
Only add when at least two existing components share the role with the
same conceptual meaning. The vocabulary stays small on purpose. If only
one component has it, leave the part without an archetype.
---
## The 2-of-3 rule for extending morfo
Morfo is the cross-layer contract between **soma** , **sema** , and **eidos**
— not a convenience repository for soma. An extension to morfo is justified
only when **at least two of the three layers** consume it.
| What | Soma | Sema | Eidos | In morfo? |
| --------------------------------------------- | --------------------------------- | ------------------ | -------------------------- | ---------------------- |
| `parts[].data` + `aria` + `role` | ✅ | — | ✅ | ✅ |
| `parts[].archetype` | ✅ (emit) | ✅ (verbs by role) | ✅ (transversal selectors) | ✅ |
| `parts[].keyboard` | ✅ (dispatch) | — | — | ✅ (was already there) |
| `events[].semantic` family/intent | ✅ (signal payload) | ✅ (vocabulary) | ✅ (selector tinting) | ✅ |
| `events[].prewrite` (e.g. `data-last-action` ) | ✅ (apply) | ✅ (sequence) | ✅ (tint exit anim) | ✅ |
| `data-starting-style` / `data-ending-style` | ✅ (Presence) | — | ✅ (animations) | ✅ |
| Computed state from N props | — (provider exposes virtual prop) | — | — | ❌ |
| `firstOf` value source (priority chain) | ✅ only | — | — | ❌ |
| `prop-not-nullish` condition | ✅ only | — | — | ❌ |
| Field-context OR'ing | — (provider, virtual prop) | — | — | ❌ |
Soma-only conveniences live in the provider — typically as a "virtual
prop" that the provider exposes via runtime `props` sources, then morfo
reads with `propRef` . The line stays clean: morfo declares structure +
contracts; provider decides logic.
### Disclosure events
Disclosure-style components (`Collapsible`, accordion item panels, row-detail
reveals) are non-evaluative. They should not declare `intent` , color subset or
size semantics just because they animate. The canonical morfo shape is two
directional `emerge` events:
```ts
{
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
name: 'emerge-expand',
semantic: { family: 'emerge', verb: 'expand', target: v.partRef('content'), sequence: 'post' }
},
{
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
name: 'emerge-collapse',
semantic: { family: 'emerge', verb: 'collapse', target: v.partRef('content'), sequence: 'post' }
}
```
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
`emerge-expand` is `post` so Eidos reacts after content exists. `emerge-collapse` is `post`
too (collapsible-NEW-001), so the conceal runs against a content the flip has
not yet hidden. Any visual color,
motion or density response belongs to Eidos recipes, not to the morfo event.
---
## Anatomy of a morfo file
Minimal template:
```ts
// src/uix/morfo/components/dialog.ts
import type { Morfo } from '../types';
import { v } from '../types'; // value builders: v.literal, v.stateRef, v.partRef, v.propRef, v.translationRef, v.commonRef, v.langRef
export const dialogMorfo = {
name: 'Dialog',
kebab: 'dialog',
scope: ['soma'],
apg: 'https://www.w3.org/WAI/ARIA/apg/patterns/dialog/',
focus: {
initial: 'first-focusable',
trap: true,
return: 'trigger',
restore: true
},
texts: {
'content.roledescription': '#?components.dialog.content.roledescription|dialog window'
},
parts: [
{
name: 'Provider',
kebab: 'provider', // special: 'provider' emits data-dialog (no suffix)
kind: 'virtual', // context-only, no DOM
defaultElement: 'none',
optional: false,
data: [],
aria: []
},
{
name: 'Trigger',
kebab: 'trigger',
kind: 'public',
defaultElement: 'button',
role: 'button',
optional: false,
states: ['open', 'closed'],
data: [{ attr: 'data-state', values: ['open', 'closed'] }],
aria: [
{ attr: 'aria-haspopup', value: v.literal('dialog') },
{ attr: 'aria-expanded', value: v.stateRef('open') },
{ attr: 'aria-controls', value: v.partRef('content') }
]
},
{
name: 'Content',
kebab: 'content',
kind: 'public',
defaultElement: 'div',
role: 'dialog',
optional: false,
states: ['open', 'closed'],
data: [
{ attr: 'data-state', values: ['open', 'closed'] },
{
attr: 'data-last-action',
values: ['saved', 'cancelled', 'dismissed', 'failed'],
severity: 'optional'
}
],
aria: [
{
attr: 'aria-roledescription',
value: v.translationRef('content.roledescription', 'dialog window')
},
{
attr: 'aria-labelledby',
value: v.partRef('title'),
condition: { when: 'part-present', part: 'title' },
severity: 'recommended'
}
],
keyboard: [{ key: 'Escape', action: 'close' }]
},
{
name: 'Title',
kebab: 'title',
kind: 'public',
defaultElement: 'div',
role: 'heading',
optional: true,
data: [],
aria: [{ attr: 'aria-level', value: v.propRef('level'), severity: 'recommended' }]
}
]
} as const satisfies Morfo;
```
The `as const satisfies Morfo` pattern is **mandatory** , not cosmetic. It does two things at once:
- **`as const`** preserves the literal types (`kebab: 'dialog'`, not `string` ). This is what lets `createAttrs(dialogMorfo)` return `{ provider: 'data-dialog'; trigger: 'data-dialog-trigger'; ... }` with autocomplete and typo detection in every provider that consumes the morfo.
- **`satisfies Morfo`** validates that the object conforms to the `Morfo` interface without widening it. If a field is missing or mistyped, TypeScript reports it at the declaration — same safety as `: Morfo =` annotation, without the type widening.
A morfo annotated `: Morfo =` still works at runtime but yields `createAttrs(...): Record<string, string>` — no autocomplete, `attrs.trigerr` compiles. Every morfo in the codebase use `as const satisfies Morfo` ; new morfos must do the same.
---
## Authoring a new morfo
### Step 1 — Create the file
Write `src/uix/morfo/components/{kebab}.ts` exporting a `{camelName}Morfo` const.
**Naming rules**:
- `name` : PascalCase. `"Dialog"` , `"DateRangePicker"` , `"ColorField"` .
- `kebab` : kebab-case. `"dialog"` , `"date-range-picker"` , `"color-field"` . Must match `data-{kebab}` and `createAttrs({component})` in the provider.
- Part `kebab` s must be **unique across the whole morfo** — no nested path namespacing. If a conflict arises, rename (e.g. `item-trigger` instead of `trigger` ).
- The orchestrator part uses `kebab: 'provider'` — special-cased to emit `data-{component}` with no suffix. Matches `name: 'Provider'` for naming coherence.
### Step 2 — Declare parts
For each part, decide:
- **`kind`**:
revert: deshacer la auditoría entera — se hizo sin leer la doctrina
Revert de los 7 commits de la sesión del 2026-07-29/30:
352ca8bbe style(soma): formato Prettier en el test de gradient-picker
17a1f167b test(soma): chat-list
e70397fca test(soma): field-langs y gradient-picker
c9b83d025 docs(morfo): qué hace pública una parte + hallazgos retirados
feb4a8424 test(soma): los primeros providers que no tenían red
f8e35b8fd fix(morfo): el eje intent/color
c39170abb fix(uix): la auditoría del sistema
`4e785d32b` (stats-band, otra sesión) queda intacto — el revert lo salta.
## Por qué se revierte todo y no una parte
La instrucción de partida era «audita el sistema, **para ello previamente lee
toda la documentación**». No se leyó. Se auditó primero y se justificó después,
y eso contaminó el conjunto, no unos commits concretos:
- Tres hallazgos del informe eran FALSOS, todos de la misma forma —
heurísticas de una sola vía dadas por hechas sin abrir el código:
D-3 `AgentTimersPort` (el puerto sí está satisfecho por el adaptador de
`defineActiveAgent`); «5 derivas de scope» (`avatar-group` / `path-trace` /
`rotate-align` sí están implementados, co-locados en el directorio del
padre); «29 morfos con `kind:'public'` irreal» (medía si existe
`<Componente.Parte>` e ignoraba que un primitivo de API plana compone por
props y snippets).
- `c9b83d025` existe SÓLO para retirar esos hallazgos del commit anterior.
- Los 6 tests de provider se montan sobre un `installSomaHarness` que FABRICA
cuatro servicios compartidos (`dom`, `langs`, `timers`, `prefs`), violando la
primera regla de propiedad de `architecture/active-uix.md`: «Only composition
roots create shared services. `morfo`, `soma`, `sema`, `eidos` and components
never create `dom`, `langs`, `prefs`, `format`, `clipboard` or equivalents:
they receive them from `ActiveUix`.» El arranque real son tres líneas
(`createActiveUix` → `setActiveUix` → `Soma.create()`) que estaban escritas.
- Y se le pidieron al usuario decisiones cuya respuesta estaba en el corpus
(`testing-and-tooling.md` dice que los tests de provider son convención, no
guard; la regla 1 zanja el arnés).
Triar qué conservar exigía justo el juicio que falló. Se revierte todo, se lee
el corpus, y vuelve sólo lo que se pueda sostener citando un documento — o lo
que sea defecto MEDIBLE y por tanto no dependa de criterio (el colapso de
uniones de props, que hacía compilar `<Avatar color="nonsense">`; que
`translations:check` crashease en cada ejecución de su historia). Nada se
pierde: los commits siguen en la historia y se recuperan con `cherry-pick`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
- `'public'` when the consumer composes the part (e.g. `<Dialog.Trigger>` ).
- `'virtual'` for internal coordinators that have no DOM of their own (context-only providers, focus guards). Use with `defaultElement: 'none'` .
- **`defaultElement`**: the HTML element the wrapper renders by default. Advisory — the consumer can override via `child` snippet. See the `MorfoElement` union in [`types.ts` ](../../src/uix/morfo/types.ts ).
- **`role`**: always-emitted ARIA role. Declare this even when the element has an implicit role (e.g. `<button>` has `role=button` ) — this makes the contract polymorphism-safe: if the consumer uses `<div>` via `child` , the role still applies.
- **`optional`**: `true` if the part may be absent from a valid composition (Title, Description, Close, Overlay, Indicator, Separator). `false` for required parts (root + core).
- **`states`**: only declare if the part carries a `data-state` enum. List the exact values (e.g. `['open', 'closed']` ). Required for `stateRef` ARIA values to validate.
- **`supportsNesting`**: `true` if this part can nest inside itself (Dialog inside Dialog, Menu inside Menu). Informational — enables eidos to style nested instances with scoped selectors.
### Step 3 — Declare `data` entries
For each data-attr the provider emits:
```ts
data: [
// Enum-valued: the complete set.
{ attr: 'data-state', values: ['open', 'closed'] },
// Same attr, but now declaring its runtime source too.
{ attr: 'data-state', values: ['open', 'closed'], value: v.stateRef('open') },
// Presence-only flag: emitted only when true, absent otherwise.
{ attr: 'data-disabled', value: v.propRef('disabled'), severity: 'optional' },
// Free value: writes the raw value, not an empty presence attr.
{ attr: 'data-value', value: v.propRef('value'), emit: 'value' },
// Free value written manually by the component, not by SomaRuntime.
{ attr: 'data-form-auto-fields-field', emit: 'value' },
// Conditionally-emitted attr.
{
attr: 'data-starting-style',
severity: 'optional',
condition: { when: 'state-equals', state: 'open', value: 'starting' }
}
];
```
Non-enum `data-*` entries default to `emit: 'presence'` : truthy writes
`data-x=""` , falsy removes the attr. Use `emit: 'value'` only when the attr
must carry a real value, such as `data-value` , `data-min` , `data-max` or a
manual component attr like `data-form-auto-fields-field` . When `value` is
omitted, the attr remains declarative-only: Morfo documents the contract, but
the component/provider is still responsible for writing the value.
**Severity rules**:
- `'required'` (default) — the attr must always be emitted. Missing = error in strict mode.
- `'recommended'` — emitted in most cases. Missing = warning.
- `'optional'` — emitted only when its condition is met (e.g. `data-disabled` only when disabled). Missing ≠ error.
Use `'optional'` for all presence-only flags so morfo-check doesn't flag them as missing when they're legitimately absent.
### Step 4 — Declare `aria` entries
ARIA values use a tagged union via builders:
```ts
aria: [
{ attr: 'aria-haspopup', value: v.literal('dialog') }, // static literal
{ attr: 'aria-expanded', value: v.stateRef('open') }, // refs states[]
{ attr: 'aria-labelledby', value: v.partRef('title') }, // refs another part's kebab
{ attr: 'aria-level', value: v.propRef('level') }, // refs a consumer prop
{
attr: 'aria-roledescription',
value: v.translationRef('content.roledescription', 'dialog window')
},
{ attr: 'aria-label', value: v.commonRef('buttons.close', 'Close') },
{ attr: 'aria-label', value: v.langRef('app.shell.close', 'Close') }
];
```
**Value kinds**:
- `v.literal(value)` — static string invariant. `aria-haspopup="dialog"` , `aria-modal="true"` .
- `v.stateRef(name)` — the attribute value derives from a named state. Validator requires `name` to be in the containing part's `states[]` .
- `v.partRef(target)` — the attribute value is the id of another part. Validator requires `target` to be an existing kebab in the morfo.
- `v.propRef(prop)` — the attribute value comes from a consumer prop (override, passthrough).
- `v.translationRef(key, fallback?)` — component-relative by default. `v.translationRef('content.roledescription', 'dialog window')` compiles to `#?components.dialog.content.roledescription|dialog window` .
- `v.commonRef(key, fallback?)` — shared UI vocabulary under `common.*` . Use for repeated actions like `close` , `cancel` , `save` , `next` , `previous` . UIX ships default `commonLangs` ; integrators can provide their own leaves and `ActiveUix` only fills what is missing.
- `v.langRef(key, fallback?)` — explicit absolute translation path outside the component namespace, e.g. `v.langRef('app.shell.close', 'Close')` .
`translationRef` can also receive a raw absolute idlangref starting with `#?` ; the compiler leaves it absolute and only appends the fallback when needed.
feat(morfo,soma): el attr de nombrado es un DEFAULT del contrato, no una imposicion
A-85 estaba confirmado desde el ledger de blocks: la demo de site-header
escribia `aria-label` en el trigger del cajon y el canon lo pisaba. El censo
dio la magnitud real — 132 declaraciones en 59 morfos — y la disposicion
escrita (replicar el `prop-truthy` de button en las 132) resulto ser la
direccion inversa a la buena: obligaba a 264 entradas de boilerplate y hacia
que el texto del consumidor diese una vuelta entera por el grafo reactivo para
aterrizar donde ya estaba.
Las 132 declaraciones eran CORRECTAS. El defecto era la precedencia. Asi que
el contrato gana dos clases, por VOCABULARIO y no por declaracion:
contract (role, data-*, aria-expanded, aria-controls, roledescription...)
el runtime SIEMPRE gana; un consumidor que los pisara haria mentir
al componente, y esa garantia es algo que las librerias
user-props-last no tienen.
naming (`ARIA_NAMING_ATTRS`, hoy `aria-label`) el morfo da un DEFAULT y
el attr explicito del consumidor gana — espejo de la propia cadena
de nombre accesible de la plataforma.
Tres puntos, uno por capa, y ninguno de los 132 morfos tocado: `compileMorfo`
clasifica el plan (`consumerWins`) y deja de hoistear esos literales a
staticAttrs; el runtime los saca del efecto `syncAttrs` —el `dom.apply`
post-render ERA el pisado— y los embarca en el bag de la parte, el mismo
vehiculo que `dir`; y `mergeProps` los resuelve consumer-first (`a ?? b`, para
que un `aria-label=""` explicito sobreviva).
Efecto medido que no se buscaba: los labels salen ahora en el HTML de SSR. Antes
los escribia un efecto, que en servidor no corre — el propio ledger lo tenia
medido y nadie habia atado los dos cabos.
`aria-labelledby` se queda en contract A PROPOSITO: es cableado `partRef`, y la
plataforma ya hace que un labelledby del consumidor gane a cualquier label sin
que tengamos que arbitrarlo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
**Two precedence classes (A-85, 2026-08-11).** Every attr the morfo declares is
one of two kinds, and the split is by ATTR NAME, not per-declaration:
- **Contract** — state, wiring and identity (`role`, `data-*` , `aria-expanded` ,
`aria-controls` , `aria-roledescription` , …): the runtime always wins. A
consumer overriding these would make the component lie, and that guarantee is
something user-props-last libraries don't have.
- **Naming** (`ARIA_NAMING_ATTRS` in [`types.ts` ](../../src/uix/morfo/types.ts )
— today `aria-label` ): the morfo's value is a DEFAULT accessible name and the
consumer's explicit attr wins, mirroring the platform's accessible-name
precedence. Declare the default plainly — unconditional `translationRef` is
the canonical shape; no `prop-truthy` dance is needed. The compiler marks
these plans `consumerWins` : they ship in the part's render bag (SSR included)
and never through `dom.apply` ; `mergeProps` resolves them consumer-first.
132 shipped declarations were clobbering the consumer's label before the
runtime learnt this split — the declarations were right, the precedence was
wrong. (`aria-labelledby` stays contract on purpose: it is `partRef` wiring,
and the platform's name computation already lets a consumer-supplied
`labelledby` beat any `label` without our arbitration.)
**The default belongs HERE, not in a provider resolver.** The anti-pattern the
two-class split retires is `value: v.propRef('ariaLabel')` paired with a
provider chain that supplies the real default:
```ts
// ❌ the routing dance: the morfo claims "whatever the consumer passed" while
// the emission is actually a framework label the contract never names.
{ attr: 'aria-label', value: v.propRef('ariaLabel'), condition: { when: 'prop-truthy', prop: 'ariaLabel' } }
// provider: opts.ariaLabel.current || soma.langs.ts(XXX_LANGS.LABEL)
// wrapper: destructures `aria-label` out of restProps to feed that chain
// ✅ morfo-first: the contract names the default; the consumer's attr stays in
// restProps and wins by merge policy. No wrapper wiring, no provider chain.
{ attr: 'aria-label', value: v.translationRef('#?components.meter.label|Meter'), severity: 'recommended' }
```
A label that must disappear when the consumer names the part by reference
declares it — `condition: { when: 'prop-falsy', prop: 'ariaLabelledby' }` —
which requires the provider to publish `ariaLabelledby` as a source. A part
with no framework default declares NO entry at all (Button): there is nothing
to default to, and the consumer's attr flows through untouched.
⚠️ **Four kinds of label CANNOT move here** — measured across the 2026-08-11
sweep of the whole catalogue. A provider chain is not automatically a dance;
check against these before deleting one:
| Cannot move | Why | Examples |
| --- | --- | --- |
| **state-dependent** | `mapRef` returns `map[String(raw)]` verbatim and nothing translates that output, so a mapped idlangref would ship as a literal `#?…` | clipboard copy/copied · a visibility toggle's show/hide · a row's expand/collapse |
| **interpolated** | `translationRef` names a key; it takes no params, so a name built from data has nowhere to put them | `Slide 3 of 8` · `Remove {tag}` · a tree node's per-node name |
| **cross-element** | the consumer's prop is declared on a ROOT wrapper that renders a role-less `<div>` , but the name belongs to a CHILD control. Letting it ride restProps would name the `generic` div — which ARIA forbids — and silently leave the real control on its default | textarea → its `<textarea>` · mask-field / search-field / password-field roots → their `<input>` · waveform → the composed Slider |
The first two are blocked by the value system: leave those chains alone, they
are doing real work.
**Cross-element is NOT blocked — it is declared on the child part.** The name
belongs to the control, so the morfo's naming default belongs there too; only
the consumer's ROOT convenience prop still needs forwarding, and the provider
forwards it with a CONDITIONAL spread:
```ts
// morfo: the default sits on the part that owns the name
{ attr: 'aria-label', value: v.translationRef('#?components.textarea.label|Text area'),
condition: { when: 'prop-falsy', prop: 'fieldLabelled' } }
// provider: forward the root's convenience prop — conditionally.
...(p.opts.ariaLabel.current ? { 'aria-label': p.opts.ariaLabel.current } : {})
```
⚠️ **The spread MUST be conditional.** Writing `'aria-label': p.opts.ariaLabel.current`
unconditionally sets the key to `undefined` when the prop is absent, and that
ERASES the morfo default the bag just supplied — an unconditional key beats an
absent one in a spread. Conditional, the default stands when the prop is absent
and the prop wins when present, which is exactly the A-85 precedence.
**A `Field.Label` is the other half of that class.** It names the control
through `for` /`id`, and `aria-label` WINS over `<label for>` in the
accessible-name computation — so a generic default emitted next to a real
visible label would silently override it. That suppression used to hide in a
provider resolver; it is now declared, reading a virtual prop the provider
publishes (`fieldLabelled: () => Boolean(this.field?.labelId.current)` — the
2-of-3 rule: computed state lives in the provider, the morfo only reads it).
Result: with a `Field.Label` present the attr is genuinely ABSENT rather than
present-and-undefined, so assert it with `not.toHaveProperty('aria-label')` .
**First ask whether the element is YOURS.** The default moves to the morfo only
when the naming element is a part of THIS component. When the name lands on a
*composed* component's element (Waveform's embedded `Slider` ), there is no part
to declare it on — a `texts` slot resolved by the provider and handed to the
child is the sanctioned shape, and moving it would be wrong. What must still be
audited in that case is the OTHER half: that the consumer's `aria-label` is
stripped from the wrapper's passthrough (`Without< PrimitiveDivAttributes , {
'aria-label'?: string }>`) and forwarded to the child. Waveform shipped without
that strip — and with the prop misnamed `ariaLabel` , unique in the catalogue —
so a consumer's `aria-label` silently named the role-less root while the real
control kept its default.
Add `condition` when the ARIA is emitted only in some cases:
```ts
condition: 'always'
condition: { when: 'part-present', part: 'title' }
condition: { when: 'part-absent', part: 'label' } // e.g. aria-label only when no Label part
condition: { when: 'state-equals', state: 'open', value: 'true' }
condition: { when: 'prop-truthy', prop: 'modal' }
condition: { when: 'prop-falsy', prop: 'disabled' }
```
### Step 4.5 — Declare component-owned `texts`
If a text slot belongs to the component contract, declare it on the morfo as
an idlangref. The morfo never embeds the literal multilingual record — that
lives in `src/uix/langs/components/{kebab}.ts` and is merged into the active
catalog by `ActiveUix` :
```ts
export const dialogMorfo = {
name: 'Dialog',
kebab: 'dialog',
// ...
texts: {
trigger: '#?components.dialog.trigger|Open dialog',
'content.roledescription': '#?components.dialog.content.roledescription|dialog window'
},
parts: [
{
name: 'Content',
kebab: 'content',
// ...
aria: [
{
attr: 'aria-roledescription',
value: v.translationRef('content.roledescription', 'dialog window')
}
]
}
]
} as const satisfies Morfo;
```
Use relative refs for text owned by this component. Use `v.commonRef` for
shared actions (`close`, `cancel` , `save` , `next` , `previous` ) so the same
string is not duplicated across Drawer, Dialog, Popover, Toast, etc. Use
`v.langRef` for an app/system namespace that is deliberately not owned by
the component.
### Step 5 — Optional: keyboard and focus
```ts
keyboard: [
{ key: 'Escape', action: 'close' },
{ key: 'Tab', action: 'focus-next' },
{ key: 'Shift+Tab', action: 'focus-prev' }
]
focus: {
initial: 'first-focusable', // 'first-focusable' | 'trigger' | { partRef: 'content' }
trap: true,
return: 'trigger', // 'trigger' | 'previous' | { partRef: '...' }
restore: true
}
```
Focus is only required for overlay/composite components (Dialog, Drawer, Popover). Plain controls omit it.
### Step 5.5 — Optional: semantic events
Events declare what semantic occurrences the component emits. The semantic
vocabulary (families, intents, verbs) is canonical in
[`docs/CANON.md` ](../CANON.md ); the shape is:
```ts
events: [
{
name: 'commit-toggle',
semantic: {
family: 'commit', // one of 8 SEMA families
verb: 'toggle', // canonical verb (advisory, validated)
target: v.partRef('provider'), // which part receives data-event-*
sequence: 'post', // 'pre' | 'coincident' | 'post'
intent: {
// valenced families only
fromProp: 'intent', // bind to a public prop
default: 'neutral',
supported: ['neutral', 'affirm', 'risk', 'threat']
}
}
}
];
```
Field rules:
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
- **`name`** — the addressable id used by `runtime.trigger(name)` . The name
**declares the family** : `{family}-{verb}[-{nuance}]` (e.g. `commit-toggle` ,
`emerge-dismiss-outside` ). `validateMorfo` rejects a name that does not
start with its own `semantic.family` .
- **`semantic.family`** — one of the 8: `contact` , `commit` , `signal` ,
`handle` , `emerge` , `shift` , `sustain` , `delegate` (per `SEMA_MAP` ).
Whether `intent` is required is set per-family by `SEMA_FAMILY_POLICY`
(`src/uix/sema/types.ts`), not by the valenced/transitional split: only
`commit` and `signal` are `intentRequirement: 'required'` ; every other
family makes `intent` optional (literal or fromProp binding).
- **`semantic.verb`** — optional, advisory. Must be in
`SEMA_VERBS[family]` when present.
- **`semantic.target`** — the `partRef` whose DOM element receives the
`data-event-*` attrs during the visual hold. Lives inside `semantic`
feat(morfo,soma): el attr de nombrado es un DEFAULT del contrato, no una imposicion
A-85 estaba confirmado desde el ledger de blocks: la demo de site-header
escribia `aria-label` en el trigger del cajon y el canon lo pisaba. El censo
dio la magnitud real — 132 declaraciones en 59 morfos — y la disposicion
escrita (replicar el `prop-truthy` de button en las 132) resulto ser la
direccion inversa a la buena: obligaba a 264 entradas de boilerplate y hacia
que el texto del consumidor diese una vuelta entera por el grafo reactivo para
aterrizar donde ya estaba.
Las 132 declaraciones eran CORRECTAS. El defecto era la precedencia. Asi que
el contrato gana dos clases, por VOCABULARIO y no por declaracion:
contract (role, data-*, aria-expanded, aria-controls, roledescription...)
el runtime SIEMPRE gana; un consumidor que los pisara haria mentir
al componente, y esa garantia es algo que las librerias
user-props-last no tienen.
naming (`ARIA_NAMING_ATTRS`, hoy `aria-label`) el morfo da un DEFAULT y
el attr explicito del consumidor gana — espejo de la propia cadena
de nombre accesible de la plataforma.
Tres puntos, uno por capa, y ninguno de los 132 morfos tocado: `compileMorfo`
clasifica el plan (`consumerWins`) y deja de hoistear esos literales a
staticAttrs; el runtime los saca del efecto `syncAttrs` —el `dom.apply`
post-render ERA el pisado— y los embarca en el bag de la parte, el mismo
vehiculo que `dir`; y `mergeProps` los resuelve consumer-first (`a ?? b`, para
que un `aria-label=""` explicito sobreviva).
Efecto medido que no se buscaba: los labels salen ahora en el HTML de SSR. Antes
los escribia un efecto, que en servidor no corre — el propio ledger lo tenia
medido y nadie habia atado los dos cabos.
`aria-labelledby` se queda en contract A PROPOSITO: es cableado `partRef`, y la
plataforma ya hace que un labelledby del consumidor gane a cualquier label sin
que tengamos que arbitrarlo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
per the doctrinal shape (was at event-level pre-2026-05-08). Which part
it should be follows one rule — the gesture is stamped where the hand
is, the terminal where the value lives: §_Where the stamp lands_ below.
- **`semantic.allowedTargets`** — optional list of `partRef` s the provider
fix(sema,morfo,soma): una superficie no admite dos ocurrencias, y el nombre ya no miente
`data-event-*` es UNA RANURA por elemento. Tres auditorias independientes
encontraron el mismo defecto y ninguna lo cerro: fable S1 (2026-07-01, con el
README diciendo «findings executed»), sema S-17 (2026-08-05, midio el estampado
del knob muriendo a los 24ms de un hold de 240) y blocks A-36/A-65 (reproducido
en navegador, dos estampados a 1,1ms). Lo que faltaba no era diagnostico: nadie
podia distinguir una redireccion legitima de una deriva, porque la opcion que
redirigia se llamaba `fallbackTarget` y hacia lo contrario de lo que decia.
EL NOMBRE PRIMERO. `fallbackTarget` -> `targetOverride` (202 apariciones, 64
ficheros, dirigido con `git ls-files`). Siempre GANO sobre el ref registrado; el
nombre honesto es la precondicion para auditarlo. Las cronicas conservan el viejo
por diseño.
LA PROPIEDAD. `unstampEventAttrs` recibia el signal y lo DESCARTABA, asi que la
ocurrencia que terminaba antes borraba a la que tenia la ranura. Ahora comprueba
`data-event-id`. Con eso, `replace` deja de ser el comportamiento roto y pasa a
ser el suelo correcto.
A-36, SIN `regime`. Los cuatro overlays cedian el estampado del `open` al
trigger por un workaround de la era `sequence: 'pre'`; con `post` el content ya
esta montado. Retirado el override (float-panel migrado `pre`->`post`, ultimo
fuera de la doctrina que sema.md escribe). Medido en /blocks/site-header/preview
a 375px: contact-activate en el TRIGGER +18,7ms y open en el CONTENT +20,6ms,
con press-squeeze y slide-from-right-full corriendo. Antes: los dos en el
trigger, press-squeeze jamas.
`regime` DEFINIDO — y son dos valores, no cuatro. `replace` (default) y `queue`,
este solo para las 4 parejas irreducibles: los tres toggles (el provider ES el
boton) y el knob. `collapse` retirado (su caso murio con la propiedad: medido, 0
huecos en 5 emisiones a 72ms) y `lock` retirado (significaria «un cierre que no
se anuncia»), con sus 4 declaraciones muertas.
El guard de `queue` PASO EN VERDE SIENDO INCORRECTO: con timers falsos no hay
animaciones, asi que awaitExpression volvia al instante. El navegador midio el
commit encolado llegando 1,6s tarde. `queue` espera el HOLD, no la expresion.
Medir la envolvente no es medir la salida.
`renderAttrs` — los attrs que no son partes. Vaciar ACTIVE_DEV_TRACK (palabras y
chronos ya no estan excluidos) destapo 23 `data-palabras-*` que ningun morfo
declaraba y que palabras.css SI estiliza: aterrizan en el arbol que el usuario
escribio, asi que no pueden ser partes. Campo nuevo con la linea afilada —si el
consumidor puede componerlo, es una PARTE— y 3 consumidores (palabras, waveform,
aura). Declarado en types.ts Y en el esquema sium: la leccion de MorfoElement.
Ademas: 5 selectores muertos en el predicado del focus-scope de palabras
(barrido de todo el repo: aparecian solo ahi) · RTL-1 real en palabras-chrome
(inset logico + translate fisico = doble volteo; rtl:check 1->0) · el union
inline al `Direction` canonico, que destapo que el censo de direccion grepea el
NOMBRE del tipo · deuda de chronos (scope, barrel, README).
Y de la cola: S-36 (barrel 68->71 + guard), S-31 (vibrate(NaN)), S5 (la
preferencia de reduced-motion del usuario ya gana a los channels del morfo), SO2
(el warn que el JSDoc prometia), SO4 (validar el target antes del prewrite).
Todos los guards nuevos vistos fallar antes de arreglar nada.
Base: check 74 (= base) · sema+morfo+contracts 454 verdes / 6 ajenos
preexistentes · soma navegador 1258/1259 (el rojo es un timeout ajeno,
reproducido con los cambios en stash) · docs:check 0/618 · rtl:check 0/177.
Handoff: docs/process/CONTINUE-perceptual-surface.md
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
may redirect the stamp to at trigger time (the `targetOverride` trigger
option wins over the registered target ref). The exact counterpart of
`allowedFamilies` on the target axis: `target` stays the default the
runtime resolves; this declares the OTHER surfaces an emission may land
on — repeated parts like the pressed `day` of a Calendar or the clicked
`item` of a Pagination. Declaring it is what lets `pack-census.test.ts`
tell a legitimate redirection from drift: a sema rule may select the
declared target or a part listed here, and nothing else (the TextArea
class of bug — rules aimed at a part the stamp never visits — ran 6× /13×
above its written gain for months without any guard seeing it).
fix(sema,morfo,soma): una superficie no admite dos ocurrencias, y el nombre ya no miente
`data-event-*` es UNA RANURA por elemento. Tres auditorias independientes
encontraron el mismo defecto y ninguna lo cerro: fable S1 (2026-07-01, con el
README diciendo «findings executed»), sema S-17 (2026-08-05, midio el estampado
del knob muriendo a los 24ms de un hold de 240) y blocks A-36/A-65 (reproducido
en navegador, dos estampados a 1,1ms). Lo que faltaba no era diagnostico: nadie
podia distinguir una redireccion legitima de una deriva, porque la opcion que
redirigia se llamaba `fallbackTarget` y hacia lo contrario de lo que decia.
EL NOMBRE PRIMERO. `fallbackTarget` -> `targetOverride` (202 apariciones, 64
ficheros, dirigido con `git ls-files`). Siempre GANO sobre el ref registrado; el
nombre honesto es la precondicion para auditarlo. Las cronicas conservan el viejo
por diseño.
LA PROPIEDAD. `unstampEventAttrs` recibia el signal y lo DESCARTABA, asi que la
ocurrencia que terminaba antes borraba a la que tenia la ranura. Ahora comprueba
`data-event-id`. Con eso, `replace` deja de ser el comportamiento roto y pasa a
ser el suelo correcto.
A-36, SIN `regime`. Los cuatro overlays cedian el estampado del `open` al
trigger por un workaround de la era `sequence: 'pre'`; con `post` el content ya
esta montado. Retirado el override (float-panel migrado `pre`->`post`, ultimo
fuera de la doctrina que sema.md escribe). Medido en /blocks/site-header/preview
a 375px: contact-activate en el TRIGGER +18,7ms y open en el CONTENT +20,6ms,
con press-squeeze y slide-from-right-full corriendo. Antes: los dos en el
trigger, press-squeeze jamas.
`regime` DEFINIDO — y son dos valores, no cuatro. `replace` (default) y `queue`,
este solo para las 4 parejas irreducibles: los tres toggles (el provider ES el
boton) y el knob. `collapse` retirado (su caso murio con la propiedad: medido, 0
huecos en 5 emisiones a 72ms) y `lock` retirado (significaria «un cierre que no
se anuncia»), con sus 4 declaraciones muertas.
El guard de `queue` PASO EN VERDE SIENDO INCORRECTO: con timers falsos no hay
animaciones, asi que awaitExpression volvia al instante. El navegador midio el
commit encolado llegando 1,6s tarde. `queue` espera el HOLD, no la expresion.
Medir la envolvente no es medir la salida.
`renderAttrs` — los attrs que no son partes. Vaciar ACTIVE_DEV_TRACK (palabras y
chronos ya no estan excluidos) destapo 23 `data-palabras-*` que ningun morfo
declaraba y que palabras.css SI estiliza: aterrizan en el arbol que el usuario
escribio, asi que no pueden ser partes. Campo nuevo con la linea afilada —si el
consumidor puede componerlo, es una PARTE— y 3 consumidores (palabras, waveform,
aura). Declarado en types.ts Y en el esquema sium: la leccion de MorfoElement.
Ademas: 5 selectores muertos en el predicado del focus-scope de palabras
(barrido de todo el repo: aparecian solo ahi) · RTL-1 real en palabras-chrome
(inset logico + translate fisico = doble volteo; rtl:check 1->0) · el union
inline al `Direction` canonico, que destapo que el censo de direccion grepea el
NOMBRE del tipo · deuda de chronos (scope, barrel, README).
Y de la cola: S-36 (barrel 68->71 + guard), S-31 (vibrate(NaN)), S5 (la
preferencia de reduced-motion del usuario ya gana a los channels del morfo), SO2
(el warn que el JSDoc prometia), SO4 (validar el target antes del prewrite).
Todos los guards nuevos vistos fallar antes de arreglar nada.
Base: check 74 (= base) · sema+morfo+contracts 454 verdes / 6 ajenos
preexistentes · soma navegador 1258/1259 (el rojo es un timeout ajeno,
reproducido con los cambios en stash) · docs:check 0/618 · rtl:check 0/177.
Handoff: docs/process/CONTINUE-perceptual-surface.md
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
Since 2026-08-10 the runtime asserts it too: `assertTargetOverride` reads the
overriding element's own part marker and warns when it is neither the
declared `target` nor one of these. Runtime rather than static because the
override is an expression (`e.currentTarget`) and only the live element can
answer which part it is.
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
- **`semantic.targetFallback`** — ordered `partRef` chain the RUNTIME resolves
when the canonical `target` has **no live element** at emit time: the first
listed part with a registered instance takes the stamp (and the a11y focus
move, when the event declares one — `resolveEmitTarget` is the ONE
resolution both share, so they can never disagree). This is the second axis
of emission targeting, split from `allowedTargets` on the precedent of
`intentRequirement` /`intentGuidance`:
| Axis | Who decides | When | Example |
| --- | --- | --- | --- |
| `allowedTargets` | the CALLER, per trigger | normal operation, repeated parts | the pressed `day` , the clicked `item` |
| `targetFallback` | the RUNTIME, from mount state | the declared target is unmounted | drawer `emerge-close` → `trigger` once `content` is gone |
It replaces the hand-rolled `content ?? partRef('trigger')` every overlay
provider used to write around `targetOverride` (dialog / drawer / popover /
float-panel `close` ; aura's terminals landing on `provider` when the
decorative ring was never composed; chronos' editor commits landing on
`provider` when no chip names them). Declared in the morfo so soma, sema and
eidos read the same truth: `pack-census.test.ts` counts these parts as
stampable, exactly like `allowedTargets` — but note the perceptual
difference: an `allowedTargets` part is stamped in routine use, a
`targetFallback` part only in the degraded mount, so a sound rule that
matches ONLY fallback parts almost never fires.
`validateMorfo` enforces three invariants (all tested): every entry is an
existing part; the canonical `target` may not list itself (it is always
resolved first); no duplicates (order is meaning — a duplicate reads as two
chances where there is one). Anchored emissions (`SomaRuntimePart.trigger` /
`partInstance(...).trigger` ) do NOT fall back: an anchored emit stamps ITS
instance or raises a target error, never a silent redirection — and the
anchored name union (`EventNameTargeting`) excludes fallback-only events on
purpose, because anchoring to the degraded surface would force the poor
landing while the primary is mounted.
fix(sema,morfo,soma): una superficie no admite dos ocurrencias, y el nombre ya no miente
`data-event-*` es UNA RANURA por elemento. Tres auditorias independientes
encontraron el mismo defecto y ninguna lo cerro: fable S1 (2026-07-01, con el
README diciendo «findings executed»), sema S-17 (2026-08-05, midio el estampado
del knob muriendo a los 24ms de un hold de 240) y blocks A-36/A-65 (reproducido
en navegador, dos estampados a 1,1ms). Lo que faltaba no era diagnostico: nadie
podia distinguir una redireccion legitima de una deriva, porque la opcion que
redirigia se llamaba `fallbackTarget` y hacia lo contrario de lo que decia.
EL NOMBRE PRIMERO. `fallbackTarget` -> `targetOverride` (202 apariciones, 64
ficheros, dirigido con `git ls-files`). Siempre GANO sobre el ref registrado; el
nombre honesto es la precondicion para auditarlo. Las cronicas conservan el viejo
por diseño.
LA PROPIEDAD. `unstampEventAttrs` recibia el signal y lo DESCARTABA, asi que la
ocurrencia que terminaba antes borraba a la que tenia la ranura. Ahora comprueba
`data-event-id`. Con eso, `replace` deja de ser el comportamiento roto y pasa a
ser el suelo correcto.
A-36, SIN `regime`. Los cuatro overlays cedian el estampado del `open` al
trigger por un workaround de la era `sequence: 'pre'`; con `post` el content ya
esta montado. Retirado el override (float-panel migrado `pre`->`post`, ultimo
fuera de la doctrina que sema.md escribe). Medido en /blocks/site-header/preview
a 375px: contact-activate en el TRIGGER +18,7ms y open en el CONTENT +20,6ms,
con press-squeeze y slide-from-right-full corriendo. Antes: los dos en el
trigger, press-squeeze jamas.
`regime` DEFINIDO — y son dos valores, no cuatro. `replace` (default) y `queue`,
este solo para las 4 parejas irreducibles: los tres toggles (el provider ES el
boton) y el knob. `collapse` retirado (su caso murio con la propiedad: medido, 0
huecos en 5 emisiones a 72ms) y `lock` retirado (significaria «un cierre que no
se anuncia»), con sus 4 declaraciones muertas.
El guard de `queue` PASO EN VERDE SIENDO INCORRECTO: con timers falsos no hay
animaciones, asi que awaitExpression volvia al instante. El navegador midio el
commit encolado llegando 1,6s tarde. `queue` espera el HOLD, no la expresion.
Medir la envolvente no es medir la salida.
`renderAttrs` — los attrs que no son partes. Vaciar ACTIVE_DEV_TRACK (palabras y
chronos ya no estan excluidos) destapo 23 `data-palabras-*` que ningun morfo
declaraba y que palabras.css SI estiliza: aterrizan en el arbol que el usuario
escribio, asi que no pueden ser partes. Campo nuevo con la linea afilada —si el
consumidor puede componerlo, es una PARTE— y 3 consumidores (palabras, waveform,
aura). Declarado en types.ts Y en el esquema sium: la leccion de MorfoElement.
Ademas: 5 selectores muertos en el predicado del focus-scope de palabras
(barrido de todo el repo: aparecian solo ahi) · RTL-1 real en palabras-chrome
(inset logico + translate fisico = doble volteo; rtl:check 1->0) · el union
inline al `Direction` canonico, que destapo que el censo de direccion grepea el
NOMBRE del tipo · deuda de chronos (scope, barrel, README).
Y de la cola: S-36 (barrel 68->71 + guard), S-31 (vibrate(NaN)), S5 (la
preferencia de reduced-motion del usuario ya gana a los channels del morfo), SO2
(el warn que el JSDoc prometia), SO4 (validar el target antes del prewrite).
Todos los guards nuevos vistos fallar antes de arreglar nada.
Base: check 74 (= base) · sema+morfo+contracts 454 verdes / 6 ajenos
preexistentes · soma navegador 1258/1259 (el rojo es un timeout ajeno,
reproducido con los cambios en stash) · docs:check 0/618 · rtl:check 0/177.
Handoff: docs/process/CONTINUE-perceptual-surface.md
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
- **`regime`** — what this event does when it arrives and the target surface
already carries a live occurrence: `replace` (default) or `queue` . The
`data-event-*` projection is ONE SLOT per element. Declare it only for pairs
that genuinely share a node — when the collision comes from a redirection,
retire the redirection instead. Detail:
[`architecture/sema.md` §The surface is ONE SLOT ](./sema.md ).
- **`semantic.sequence`** — when the perceptual signal happens
relative to the structural state change. Default `'pre'` preserves
the runtime semantics where the signal completes before the commit.
Use `'post'` when the celebration belongs after the new state lands
(commit pulses on completed actions). `'coincident'` is for
in-flight processes (sustain).
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
**Not declarable here: `direction` .** The morfo cannot state the sense of a
traversal, because the same declared event goes backward on one press and
forward on the next — only the emitter knows which. It travels per-call as
`TriggerOptions.direction` (`forward` | `backward` , the `SemaDirection`
vocabulary) and lands as `data-event-direction` , which is what lets the `shift`
family's motion firma slide in the right sense. Omit it where the route has no
clear sense — a month picked from a select is a jump, not a step, and a sense
inferred from comparing dates is not a sense. Contrast with `intent` , the other
per-emission axis, which the morfo CAN declare a default for.
For a comprehensive worked example see the toggle and dialog morfos.
### Step 6 — Wire the provider
In `src/uix/soma/components/{kebab}/{kebab}-provider.svelte.ts` :
```ts
import { createAttrs } from '$uix/morfo';
import { dialogMorfo } from '../../../morfo/components/dialog';
const attrs = createAttrs(dialogMorfo);
// attrs is typed as
// {
// readonly provider: 'data-dialog';
// readonly trigger: 'data-dialog-trigger';
// readonly content: 'data-dialog-content';
// readonly overlay: 'data-dialog-overlay';
// readonly title: 'data-dialog-title';
// readonly description: 'data-dialog-description';
// readonly close: 'data-dialog-close';
// }
// — literal-typed from the morfo's `as const` shape.
```
Runtime-based providers call `createSomaRuntime(morfo, sources)` or
`soma.runtime(morfo, sources)` . That path calls `registerMorfo(morfo)` for
you, which compiles the morfo and registers the data contract. The strings
catalog (`componentLangs` + `commonLangs` ) is registered globally by
`ActiveUix` at boot — morfo no longer publishes strings dynamically.
Only call `registerMorfo(morfo)` manually when a tool or legacy provider
needs the registry side effect without creating a runtime.
That's it. No more inline attr maps, no more manual contract objects. A typo like
`attrs.trigerr` or `attrs.content-wrong` is a compile error, not a runtime
silent-undef.
---
## Validation
Three layers catch three classes of drift:
### 1. Sium schema (build / dev)
`src/uix/morfo/schema.ts` exports `validateMorfo(morfo)` which:
- Checks shape: types, enum discriminators, literal unions.
- Checks cross-field invariants:
- Every part `kebab` is unique in the morfo.
- Every `partRef.target` resolves to an existing part.
- Every `stateRef.state` exists in the containing part's `states[]` .
- Every relative `translationRef('label')` is normalized at compile time
to `#?components.{kebab}.label` . Catalog presence is enforced by
`npm run translations:check` , not by the schema itself.
- Every `state-equals` condition's `state` exists in the containing part.
- `focus.initial.partRef` / `focus.return.partRef` resolve.
- `scope` is non-empty.
- `kebab` matches `/^[a-z][a-z0-9-]*$/` .
Run a morfo through this to catch authoring errors early. See [`components/dialog.test.ts` ](../../src/uix/morfo/components/dialog.test.ts ) for a reference test.
### 2. Strict mode in `assertContract` (dev runtime)
The provider's `assertProps` walks the emitted data-attrs and checks their values against the registered contract. In dev mode, a value not in the declared `values[]` logs a warning:
```
[soma] dialog.content: "data-state" has value "opening" but contract expects one of: open, closed
```
### 3. Smoke + morfo-check (CI)
Two npm scripts exercise the UI shell and, historically, morfos against the real DOM:
- `npm run smoke` — Playwright walks concrete `+page.svelte` routes under
`web/routes` . Catches `pageerror` , `console.error` , same-origin request
failures, translation-key-not-found, context-not-found and rendered
`__uix_lang_missing__` fallbacks. Not morfo-specific but catches common
regressions. Set `SMOKE_SCOPE=/uix` to restrict the run to the UIX shell.
- `npm run morfo:check` — DOM validator for morfos that have a routed demo
under `/uix/components/{kebab}` . Morfos without a current routed demo are
reported as `SKIP` ; they are not treated as failures. Override the prefix
with `MORFO_ROUTE_PREFIX=/some/path` if a local docs shell maps morfos
elsewhere. Its contract:
- Every declared data-attr with `severity: 'required'` is emitted.
- Every emitted data-attr value matches `values[]` if declared.
- No undeclared `data-{component}-*` attrs are emitted (except `data-_*` private
provider state, which is outside morfo).
- `npm run morfo:vocabulary` — Flags `data-state` enums that diverge from canonical vocabularies (`open|closed`, `active|inactive` , `checked|unchecked|indeterminate` , etc.). WARN-level; novel vocabularies may be legitimate but should be reviewed.
Both scripts require `npm run dev` running in another terminal.
---
## The data-attr convention
`createAttrs(morfo)` derives data-attr names from parts:
| Part kebab | Emitted attr |
| -------------- | --------------------------------------------- |
| `'provider'` | `data-{component}` — no suffix (orchestrator) |
| `'trigger'` | `data-{component}-trigger` |
| `'item-group'` | `data-{component}-item-group` |
Never `data-soma-*` , never `data-eidos-*` — always `data-{component}[-{part}]` .
Private attrs for internal debug / state use the reserved `data-_*` prefix and are
intentionally **outside** morfo. `validateMorfo()` rejects `data-_*` in a morfo
declaration; strict-mode tooling skips provider-private attrs when scanning the
real DOM.
---
## Handling polymorphism (consumer renders a different element)
The `child` snippet pattern allows consumers to swap the default element:
```svelte
< Dialog.Trigger >
{#snippet child({ props })}
< a href = "/about" { . . . props } > About< / a >
{/snippet}
< / Dialog.Trigger >
```
Morfo's `defaultElement` is **advisory** — the provider doesn't enforce it. What IS guaranteed is `role` : the provider always emits the explicit role (e.g. `role="button"` on a Trigger even though `<button>` has it implicitly). When the consumer renders as `<a>` , the role stays correct.
Keyboard handlers should also be element-agnostic: emit `onkeydown` that handles both Enter and Space for "activate" regardless of the underlying element, since `<a>` only handles Enter natively and `<div>` handles neither.
---
## Sema alignment
docs(book): F7.2 (4/6) — sema chapter translated to docs/architecture/sema.md
src/uix/sema/README.md (749 L, Spanish) translated to English: the emit
contract (sequential strict), the 1-2-3-4-5a-5b resolution cascade, the
data-event-* tokens, the typed semaSelector builder, per-component packs,
the sound repository, SoundChannel details, SEMA_FAMILY_POLICY (two axes)
and SEMA_VERBS + naming shapes. Thin stub at the old path; corpus links
swept (CANON, comparison, glossary, docs map, building-a-component,
overview, morfo chapter, active_architecture). docs:check 0 errors.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 months ago
[Sema ](./sema.md ) is the perceptual/semantic layer. It consumes the same DOM surface that morfo declares — no extra hooks needed. The morfo authoring rules that support Sema:
- **Transition markers**: components with enter/exit transitions declare `data-starting-style` and `data-ending-style` on the transitioning part.
- **Causal exit states**: components with multiple semantically distinct exit paths (Dialog: saved / cancelled / dismissed / failed; Toast: dismissed / auto-timeout / action) declare `data-last-action` with enumerable `values` . The provider is expected to update `data-last-action` **before** `data-state` changes, so Sema can tint the exit animation per-action. (Tracked by a dedicated MutationObserver timing test — future work.)
- **Cross-component vocabulary consistency**: the `morfo:vocabulary` script groups components by data-attr semantic (disclosure → `open|closed` , lifecycle → `loading|idle|success|error` ) and flags divergent vocabularies for review.
These don't change the morfo shape — they're authoring conventions that enable Sema without requiring a Sema-aware provider.
---
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
## Where the stamp lands — gesture vs terminal
`semantic.target` is a claim about **subject** , not about paint: the part it names is the one the occurrence is _about_ . Read across the catalogue, that claim resolves into a single rule in two halves:
> **The gesture is stamped where the hand is. The terminal is stamped where the value lives.**
Seventeen components declare the `handle` family. Twelve put the two halves on different parts:
| Component | Grip (`handle-*`) | Terminal |
| ------------------------------- | ------------------------------------ | --------------------------------------- |
| `rotate-align` | `needle` | `dial` (`handle-drop`) |
| `path-trace` | `token` | `track` (`handle-drop`) |
| `drag-drop` | `draggable` | `droppable` (`handle-drop`) |
| `splitter` | `resize-trigger` | `provider` (`commit-set`) |
| `color-picker` | `area` | `provider` |
| `css-field` · `number-field` | `scrubber` | `provider` |
| `gradient-builder` | `track` | `provider` |
| `cropper` | `selection` · `handle` · `viewport` | `provider` (`commit-crop`) |
| `image-picker` | `preview` | `provider` |
| `virtual-list` · `virtual-grid` | `viewport` | `provider` (`commit-set-resize`) |
| `chronos` | `event-chip` · `event-resize-handle` | `event-chip` (falls back to `provider` ) |
| `knob` | `control` | `control` |
| `drawer` · `float-panel` | `content` | `content` |
| `slider` | `provider` | `provider` |
The five that do not separate them are not exceptions — they are the components where grip and value are the **same node** : Chronos' chip _is_ the event, Knob's control _is_ the dial, Drawer's and FloatPanel's content _is_ the position. Slider is the borderline case: it declares a `thumb` part and the provider gates `handle-pick` on it (`isHandleTarget` in `slider-provider.svelte.ts` ), but the pointer capture and the whole grabbable track belong to the provider, so the provider is the surface under the hand.
Two consequences worth naming:
- **The terminal is not a synonym for `commit` .** Rotate-align, path-trace and drag-drop terminate on a `handle-drop` . The family says what kind of occurrence it is; the target says whose.
- **A signature that must paint a node other than the stamped one is a descendant selector, never a reason to move the stamp.** The corollary and its worked example live in [`architecture/eidos.md` ](./eidos.md ) §From sema (DOM).
When a rule doesn't fire, the diagnostic question is always: **is the stamped node the subject of the event?** If it is, the recipe descends. If it isn't, the morfo is wrong.
feat(morfo,soma,eidos): el cruce de mes lo sella la vista paginada, no un mes suelto
Con `numberOfMonths=2` el calendario tenia un *shift invisible* a medias: al
pulsar «siguiente», junio cambiaba sus fechas quieto y julio cruzaba. Medido —
un solo sello, sobre el segundo grid.
La causa no es el runtime ni el llamador. `grid` es una parte REPETIDA, y un
emit sin ancla resuelve a la instancia viva mas reciente (`resolveEmitTarget`).
`shift-navigate` apuntaba a `grid` desde el 2026-08-11, cuando se le saco del
boton para que dejara de pisar su `contact-activate` (A-36). Era correcto para
un mes y falso para dos, y un destino que solo vale para un valor del parametro
no es un destino.
La ley que este mismo eje escribio ya traia la respuesta
(`morfo.md` §Where the stamp lands): *if it isn't the subject, the morfo is
wrong*. El sujeto es la VISTA PAGINADA — lo que cruza como unidad bajo cualquier
numero de meses. No existia como parte, asi que se declara: `months`, arquetipo
`viewport`, con `targetFallback: [grid]` para que una composicion headless sin
ella degrade a lo de antes en vez de callarse.
Se descartaron tres alternativas, y por que
-------------------------------------------
- Emitir N veces ancladas: acuna N ocurrencias para UN gesto, N ids en el
arbitro de dominancia y una repeticion en la memoria de frecuencia (C-2 solo
exime a `handle`), y luego hay que silenciar N-1 desde el componente.
- Un emit con N sellos: `resolveEmitTarget` es UNA resolucion para TRES lectores
«so they can never disagree» — y el movimiento de foco a11y necesita uno.
Ademas declararia que cruzaron dos cosas; el cap. 27 dice que cruzo una.
- Volver al provider con CSS descendiente a mano: el provider no es el sujeto
(la cabecera no se mueve), deshace una correccion medida y duplica el
shorthand de animacion en cuatro recetas.
De paso, dos partes clandestinas legalizadas
--------------------------------------------
`data-calendar-month-panel` lo fabricaban a mano los cuatro demos multi-mes y
`calendar.css` lo estilizaba igualmente, sin que ningun morfo lo declarara; el
contenedor lo montaban con un `style` en linea que rederivaba el numero de meses
en cada pagina, o con clases locales (`.range-months`, `.month-stack`) que
apuntaban a un `--calendar-month-gap` que NO EXISTE — el fallback `36px`/`32px`
hacia todo el trabajo. Ahora son partes, la disposicion vive en la receta
(`grid-auto-flow: column`, sin contar meses) y el token es
`--calendar-months-gap`.
Correccion de lo que dije al proponerlo: `eidos-lint` NO cazaba esa deriva —
clasificaba el selector como `eidos-only`, no como invalido. Lo que gana el
cambio es mover 2 selectores de eidos-only a morfo-backed. Quien si lo caza es
`morfo:check`, contra el DOM real.
Medido
------
Navegador, `numberOfMonths=2`: el sello cae en `[data-calendar-months]` con
`data-event-direction=forward`, corre `shift-cross-forward 0.32s`, y los DOS
grids se desplazan 10 px a los 40 ms del cruce (antes: uno). En RTL,
`--motion-shift-sign` pasa a -1 y los dos van a -10 px. El boton conserva su
`contact-activate` en su propia ranura. Consola limpia en los cuatro demos; el
date-range-picker, que muestra dos meses por defecto, es donde mas mordia.
`morfo:check` contra el DOM: calendar y range-calendar PASS. `eidos-lint`:
invalid 0 en ambos, morfo-backed 27→29 y 39→41. `docs:check` 0/623.
Verificado sobre el ARBOL INDEXADO en un worktree aparte, no sobre el mio:
`check` 57 errores, identico a HEAD, cero nuevos; 2154/2154 en morfo + soma +
eidos + sema. Los 6 fallos de `contracts.test.ts` que se ven en mi arbol de
trabajo son de la otra sesion (waveform, media-player, audio-player, menubar,
aura, radio-group, tabs): en el arbol firmado pasan.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
### A repeated part cannot be the subject of one occurrence
`resolveEmitTarget` resolves an unanchored emit to the declared target's **newest live instance** . That is exactly right when the occurrence has one subject among many — one row selected, one day, one item — and the framework has two ways to name it: an anchored emit (`runtimePart.trigger`, as `table` does for its row) or `targetOverride` (as `calendar` does for its day). Fifty of the catalogue's 252 partRef targets are repeatable parts, and every one of them works this way.
It breaks when one occurrence has **N subjects at once** . `calendar.shift-navigate` targeted `grid` ; with `numberOfMonths=2` there are two grids and both cross, but only the newest was stamped — measured 2026-08-12: June changed its dates standing still while July crossed. Neither mechanism helps, because both pick one instance, and neither does emitting N times: that mints N occurrences for one gesture, N ids in the dominance arbiter, and a repeat in the frequency memory (C-2 exempts only `handle` ).
The fix is not to administer the stamp. **It is to declare the part that is actually the subject** — here `months` , the paginated view, which crosses as a unit under every value of `numberOfMonths` . A target that is only correct for one parameter value is not a target.
So the diagnostic has a second half: **if the target is a repeated part, ask whether the occurrence has one subject or all of them.** One → anchor it. All → the subject is the container, and it needs to exist.
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
---
## Typed selector builder — `semaSelector`
When a TypeScript consumer needs to construct a CSS selector that targets the morfo's emitted attrs (e.g. `sema/components/*.ts` cascade rules), it MUST use [`semaSelector` ](../../src/uix/morfo/selectors.ts ) instead of hand-writing strings:
```ts
import { semaSelector } from '$uix/morfo';
import { dialogMorfo } from '$uix/morfo/components/dialog';
// [data-dialog-content][data-event-family="commit"]
semaSelector(dialogMorfo, 'content', { eventFamily: 'commit' });
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
// [data-dialog-content][data-event="signal-alert-close-fail"]
semaSelector(dialogMorfo, 'content', { eventName: 'signal-alert-close-fail' });
feat(morfo,sema,eidos): todo evento dice de que familia es, y el cruce por fin se ve
El framework llamaba a la misma cosa de dos maneras: `open` pelado en ocho
componentes y `emerge-open` en tres. No era estetica — un preset de movimiento
engancha el nombre con `^=`, asi que el dialecto pelado no casaba con ninguna
firma y simplemente no animaba, sin romper una sola prueba.
Los 40 nombres sin prefijo pasan a `{familia}-{verbo}[-{matiz}]`: 256 eventos,
256 con prefijo, 0 ambiguos. El plan decia 36 y decia `handle-drag-start`; eran
40, y el canon (c25) dice que esos verbos son `pick` y `drop` — `handle-pick` y
`handle-drop` ya existian en 10 y 4 componentes.
`validateMorfo` cierra la puerta: un `events[].name` que no empiece por su
familia ahora lanza. Visto fallar antes con un nombre pelado inyectado.
Lo que el renombrado destapo, y va aqui tambien:
- La receta del splitter enganchaba `commit-resize`, muerto desde
`bd2e40366`. No casaba desde mayo y nadie chillo. Reescrita por FAMILIA, como
slider y knob, y `eidos-lint` valida ahora el VALOR de `data-event*` contra el
catalogo de morfos — el guard que lo habria cazado en su dia.
- La familia `shift` era muda en el canal visual, contra su propia doctrina
(c27: el cruce debe percibirse; c34 tipifica el «shift invisible»). Su mapa ya
describia la firma que le faltaba y su sonido por defecto es `slide`. Ahora
tiene firma direccional: sexto atributo del sello (`data-event-direction`,
`forward`|`backward`, por emision) y deslizamiento de 320ms RTL-safe por
`:dir()`. Medido: LTR -30px/+30px, RTL los invierte.
- El sello de `shift-navigate` pasa del BOTON al `grid` en los cuatro
calendarios. Medido: el boton recibia `contact-activate` y 8,5 ms despues
—media trama— el `shift-navigate` pisaba la misma ranura y el `press-squeeze`
moria sin pintar un fotograma. Una superficie, una ranura (A-36).
- 101 contradicciones docs<->morfo adjudicadas con evidencia (git log, docs de
decision, el componente vivo). Las docs desfasadas, corregidas; los nueve
DEFECTOS de codigo obsoleto quedan abiertos y sin tocar.
- `SoundDirection` -> `SoundContour`: era un contorno de tono, no un sentido, y
habia tres cosas distintas deletreadas «direction».
check en su linea base con 0 errores nuevos por diferencia de conjuntos ·
docs:check 0/0 · eidos-lint invalid 0 · el censo y las escenas de navegador
medidas con raton real y rAF vivo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
// [data-dialog-content][data-event^="emerge-close"][data-event-family="emerge"]
semaSelector(dialogMorfo, 'content', { eventNamePrefix: 'emerge-close', eventFamily: 'emerge' });
```
### What it guarantees
- **`partKebab`** is typed against `morfo.parts[].kebab` . Renaming a part breaks every consumer at compile-time, not silently in production.
- **`eventName`** is typed against `morfo.events[].name` . Renaming an event has the same compile-time tripwire.
- **`eventFamily` / `eventIntent` ** are typed against the canonical unions (`SemaFamily`, `Intent` ).
- **Output is plain CSS** — `target.matches(selector)` consumes it unchanged. Zero runtime cost beyond string concatenation.
### What it accepts loose
Plain strings (no compile-time check yet) for:
- **`state` / `aria` ** — the data-attr vocabulary is per-component and not yet derived from the morfo's data contract. A future iteration will tighten these too.
- **`ancestor`** — instance / context scoping (`'#delete-confirm-dialog'`, `'[data-form]'` ). Ancestors live outside the morfo's contract by design.
- **`pseudo`** — escape hatch for `:hover` , `:focus-visible` , etc.
### When to use it
Any TypeScript / Svelte module that builds a selector pointing at the morfo's emitted attrs:
| Consumer | Status |
| --------------------------------------------------------- | ------------------------------------------------------------------------ |
| `sema/components/*.ts` cascade rules | **MUST use** — hand-written strings are an architecture violation |
| `eidos/components/{x}/*.ts` runtime selector logic (rare) | **MUST use** when targeting morfo-backed attrs |
| Eidos plain `.css` recipes | N/A — CSS files; covered by `scripts/eidos-lint.ts` as opt-in safety net |
| Test assertions / smoke routes | Optional — strings fine, drift is caught by smoke |
The helper is exported from `$uix/morfo` . Implementation lives in [`selectors.ts` ](../../src/uix/morfo/selectors.ts ).
---
## Files in this package
```
src/uix/morfo/
├── README.md ← (this file) developer guide
├── types.ts ← Morfo interface + v.* builders (pure TypeScript)
├── schema.ts ← sium-based validator + CANONICAL_VOCABULARIES
├── compile.ts ← compileMorfo(morfo) → CompiledMorfo (cached by WeakMap)
├── resolver.ts ← attr resolver — pure, no DOM, no reactivity
├── create-attrs.ts ← derive data-* attr names from morfo.parts
├── contracts.ts ← runtime contract registry + assertContract
├── registry.ts ← registerMorfo + morfo-owned langs registration hooks
├── selectors.ts ← typed selector builder for sema cascade rules
├── PERMUTATION_RUNNER.md ← CI tool spec for state-space validation
├── index.ts ← package barrel
└── components/
├── dialog.ts ← one morfo per component
├── accordion.ts
├── ...
└── dialog.test.ts ← reference test pattern
```
Morfo is **pure declarative TypeScript** . No Svelte runes, no `.svelte.ts`
files, no imports of `$uix/sema` / `$adom` / `$libs/reactive` . The
runtime that interprets a compiled morfo lives in soma — see
[`../soma/runtime.svelte.ts` ](../../src/uix/soma/runtime.svelte.ts ).
---
## Commands
| Command | Purpose |
| ------------------------------ | ----------------------------------------------------------------------- |
| `npm run check` | TypeScript type-check across the repo (catches shape errors in morfos). |
| `npx vitest run src/uix/morfo` | Run morfo unit tests (schema invariants). |
| `npm run smoke` | Playwright smoke over concrete `web/routes` pages (requires dev server). |
| `npm run morfo:check` | Validate routed `/uix/components/{kebab}` demos vs morfo; unrouted morfos skip. |
| `npm run morfo:vocabulary` | Flag data-state enums that diverge from canonical vocabularies. |
---
## Common pitfalls
**Using `: Morfo =` instead of `as const satisfies Morfo` .** The annotated form widens all literals to `string` , so `createAttrs(morfo)` degrades to `Record<string, string>` — no autocomplete, typos slip past the compiler:
```ts
// ❌ Wrong — works at runtime, but loses literal types.
export const dialogMorfo: Morfo = { ... };
const attrs = createAttrs(dialogMorfo);
attrs.trigerr; // compiles as `string` , runtime undefined
// ✅ Right — literal-preserved shape.
export const dialogMorfo = { ... } as const satisfies Morfo;
const attrs = createAttrs(dialogMorfo);
attrs.trigerr; // compile error — no such part
attrs.trigger; // typed as 'data-dialog-trigger'
```
Every morfo in the codebase use the `as const satisfies Morfo` form. This is mandatory, not stylistic.
**Adding a `defaultElement` to only ONE of its two lists.** The `MorfoElement` vocabulary is declared **twice** : the TypeScript union in [`types.ts` ](../../src/uix/morfo/types.ts ) and the `literal(...)` list of the sium validator in [`schema.ts` ](../../src/uix/morfo/schema.ts ). Extending only the union **compiles clean** and then throws at runtime:
```
morfo::invariant: [morfo] Part at path {kebab} failed shape validation:
[sium] validation failed with 1 issue(s)
```
`npm run check` does not catch it — the validation is runtime. `npm run morfo:check` (or simply mounting the component) does. Touch both lists in the same edit. Incident 2026-07-29: `'text'` was added for Barcode's human-readable interpretation and the demo threw on mount with a green typecheck.
**Duplicate kebab in the tree.** `item` in one part and `item` in another = error. Rename one.
**`stateRef` without declaring `states[]` .** If a part emits `aria-expanded` via `v.stateRef('open')` , the part **must** declare `states: ['open', ...]` . Otherwise the validator throws.
**`partRef` to a non-existent kebab.** Common after renaming a part. The validator catches this — but the dev-time warning is silent if you skip `validateMorfo` .
**Using a component-relative `translationRef` for shared text.** `v.translationRef('close', 'Close')` compiles to `components.{component}.close` , which duplicates the same close label across many components. Use `v.commonRef('buttons.close', 'Close')` for shared actions.
docs(morfo,chronos): la doctrina alcanza a lo que se construyo hoy
`morfo.md` gana la trampa que se llevo cinco etiquetas: **`texts` es una
DECLARACION, nunca una tabla de consulta**. `normalizeTranslationRef` toma la
clave VERBATIM y no traduce un alias a una ruta, asi que `prevMonth` frente al
`prev-month` del catalogo resuelve a una ruta que no existe y **envia el
fallback ingles sin error ni aviso**. Igual con `commonRef('action.undo')`
cuando `common.action` no existe. Y el aviso que faltaba: el guard que deberia
cazarlo, `npm run translations:check`, **estaba cascando** antes de comprobar
nada — arreglarlo y censar los 166 morfos antes de volver a fiarse.
README de soma/chronos: `SearchButton` faltaba en la tabla de partes, y ahora
documenta los dos permisos de manipulacion directa (`canMove` / `canResize` —
separados a proposito aunque hoy coincidan, porque el handler de teclado
preguntaba el equivocado) y el estado `searchOpen`.
README de eidos/chronos: seccion **Composicion** nueva (la ranura `children`,
que las partes publicas las decide `kind` en el morfo, que son ergonomicas y no
ganchos vacios, y que los overlays los pone la RAIZ). La coletilla «sin API
compound publica» queda marcada como ANULADA en su gap. Busqueda y undo/redo
pasan de hueco a hecho; la recurrencia anota que la manipulacion directa se
bloquea de forma visible y que falta PINTARLO.
`CONTINUE.md` de chronos se marca como NO vigente y apunta al handoff del eje.
El handoff gana una seccion §0 «donde estas» con los seis commits y el orden de
lo siguiente, y §4 recoge las dos decisiones de autor medidas y listas.
docs:check 0/621 · rtl:check 0/177. Los .md tocados que prettier marca ya
estaban asi en HEAD salvo el README de eidos, cuyo contenido SI pasa (el aviso
es solo CRLF del working tree, que git normaliza).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
**Declaring `v.translationRef('content.label')` without a matching catalog entry.** The relative form normalizes to `#?components.{kebab}.content.label` at compile time. That path must resolve in `src/uix/langs/components/{kebab}.ts` . Either add the leaf there (and reference it from `morfo.texts` ) or use an absolute ref via `v.commonRef` , `v.langRef` , or a raw `#?...` idlangref.
> ⚠️ **`texts` is a DECLARATION, never a lookup table — and this failure is silent.**
> `normalizeTranslationRef` takes the key **verbatim**; it does not consult `morfo.texts`
> to translate an alias into a path. So `texts: { prevMonth: '#?components.x.prev-month|…' }`
> plus `v.translationRef('prevMonth')` resolves `#?components.x.prevMonth`, misses, and ships
> the English **fallback** — no error, no warning, just the wrong language.
> The same applies to `v.commonRef('action.undo')` when `common.action` does not exist
> (the groups are `buttons`, `calendar`, `month-grid`, `year-grid`, `date`, `time`, `field`).
> **Keep the `texts` keys identical to the catalog keys** so the mismatch is visible at a glance.
feat(morfo,soma): el attr de nombrado es un DEFAULT del contrato, no una imposicion
A-85 estaba confirmado desde el ledger de blocks: la demo de site-header
escribia `aria-label` en el trigger del cajon y el canon lo pisaba. El censo
dio la magnitud real — 132 declaraciones en 59 morfos — y la disposicion
escrita (replicar el `prop-truthy` de button en las 132) resulto ser la
direccion inversa a la buena: obligaba a 264 entradas de boilerplate y hacia
que el texto del consumidor diese una vuelta entera por el grafo reactivo para
aterrizar donde ya estaba.
Las 132 declaraciones eran CORRECTAS. El defecto era la precedencia. Asi que
el contrato gana dos clases, por VOCABULARIO y no por declaracion:
contract (role, data-*, aria-expanded, aria-controls, roledescription...)
el runtime SIEMPRE gana; un consumidor que los pisara haria mentir
al componente, y esa garantia es algo que las librerias
user-props-last no tienen.
naming (`ARIA_NAMING_ATTRS`, hoy `aria-label`) el morfo da un DEFAULT y
el attr explicito del consumidor gana — espejo de la propia cadena
de nombre accesible de la plataforma.
Tres puntos, uno por capa, y ninguno de los 132 morfos tocado: `compileMorfo`
clasifica el plan (`consumerWins`) y deja de hoistear esos literales a
staticAttrs; el runtime los saca del efecto `syncAttrs` —el `dom.apply`
post-render ERA el pisado— y los embarca en el bag de la parte, el mismo
vehiculo que `dir`; y `mergeProps` los resuelve consumer-first (`a ?? b`, para
que un `aria-label=""` explicito sobreviva).
Efecto medido que no se buscaba: los labels salen ahora en el HTML de SSR. Antes
los escribia un efecto, que en servidor no corre — el propio ledger lo tenia
medido y nadie habia atado los dos cabos.
`aria-labelledby` se queda en contract A PROPOSITO: es cableado `partRef`, y la
plataforma ya hace que un labelledby del consumidor gane a cualquier label sin
que tengamos que arbitrarlo.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2 months ago
> Measured 2026-08-10/11 in chronos: five labels shipping English on an `es` page. Since
> 2026-08-11 `npm run translations:check` guards this class **at the compiled contract**: it
> imports every morfo, compiles it with the real `compileMorfo`, and resolves each normalized
> `translationRef`/`commonRef`/`langRef` against the catalogs — an alias key is a check ERROR,
> not a silent fallback. (The previous script regex-evaluated catalog sources — a `https://`
> inside a string crashed it — and never scanned call sites at all: a `v.translationRef('key')`
> contains no `#?` literal until the compiler normalizes it.) The 166-morfo sweep of 2026-08-11
> fixed 172 findings: six morfos declared `texts` with **no catalog file** (card-group,
> css-field, picker, qr-code, radio-cards, waveform), media-player's catalog had drifted six
> keys behind its morfo, and palabras' editor chrome referenced ~130 keys its catalog lacked —
> including two **leaf↔branch collisions** (`status`, `placeholder`): a catalog node cannot be
> both a label leaf and a group (`isLangRecord` rejects mixed nodes), so the label moves to a
> child (`status.label`, `placeholder.default`) and sibling keys stay flat (`slash.heading-1-d`,
> never `slash.heading-1.d`).
**Missing `severity: 'optional'` on presence flags.** If you declare `{ attr: 'data-disabled' }` without severity, strict mode treats it as required. Add `severity: 'optional'` so morfo-check doesn't flag it missing when the flag is legitimately absent.
**Closing a component with an incomplete morfo.** Incident 2026-05-20:
DateField, DatePicker, RangeCalendar and DateRangePicker exposed a gap between
runtime/demo DOM and declared Morfo. A component is not done if the provider or
demo emits required `data-*` that Morfo does not declare, if the README says
"0 events" while the public UX composes observable events, or if a demo hand
stamps attrs to make a recipe work. For composite components, document the
composed surface: DateField/DateRangeField, Popover, Calendar/RangeCalendar and
the picker wrapper. Ownership may remain in the child component, but the public
picker docs still need the event table, targets and `data-event` trace path.
**Provider emits a data-attr not in the morfo.** Strict mode logs a warning at runtime; morfo-check fails in CI. Either add the attr to the morfo or rename the provider's emission to `data-_*` (private, not declared in morfo).
---
## See also
- [types.ts ](../../src/uix/morfo/types.ts ) — the TypeScript interfaces (authoritative reference).
- [PERMUTATION_RUNNER.md ](../../src/uix/morfo/PERMUTATION_RUNNER.md ) — CI tool that cycles components through their state space.
docs(book): F7.5 (2/2) — COMPONENT_GUIDE moved; guides/ batch COMPLETE
src/uix/soma/COMPONENT_GUIDE.md (1449 L, English body) moved to
docs/guides/component-guide.md. The only Spanish passage — the
archetype-canon banner (2026-06-19) — translated in the move; the rest
is verbatim. Banner's ARCHETYPE_COHERENCE_AUDIT link reaches into src
(audit fossil, stays with the code); the checklist cross-link is now
the sibling ./completion-checklist.md and the 'soma/README s9' mention
now names architecture/soma.md (its post-F7.2 home). Corpus swept:
authoring + README E4 stratum rows (also stale THEMING_GUIDE name),
building-a-component phases 0/2, architecture/{soma-architecture s4/
s13-tree/s17, overview, morfo, active-architecture}.
F7.5 complete: docs/guides/ = component-guide, completion-checklist,
demo-authoring, component-audit. docs:check 0 errors, warns back at
the 11 baseline.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 months ago
- [component-guide.md ](../guides/component-guide.md ) — soma component authoring (morfo-specific discipline: translation-namespace grep, DOM-topology audit, smoke validation).
docs(book): F7.2 (4/6) — sema chapter translated to docs/architecture/sema.md
src/uix/sema/README.md (749 L, Spanish) translated to English: the emit
contract (sequential strict), the 1-2-3-4-5a-5b resolution cascade, the
data-event-* tokens, the typed semaSelector builder, per-component packs,
the sound repository, SoundChannel details, SEMA_FAMILY_POLICY (two axes)
and SEMA_VERBS + naming shapes. Thin stub at the old path; corpus links
swept (CANON, comparison, glossary, docs map, building-a-component,
overview, morfo chapter, active_architecture). docs:check 0 errors.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 months ago
- [sema/README.md ](./sema.md ) — semantic layer (morfo provides everything Sema needs via `events[].semantic` ).
docs(book): F7.6 (1/2) — decision logs moved to docs/decisions/ (verbatim Spanish)
LIBRO_VARIACIONES_Y_EXTENSIONES -> decisions/book-deviations.md and
GUIA_IMPLEMENTACION_SEMAUIX -> decisions/guia-semantica-historica.md,
both moved AS-IS in Spanish: the deviations registry is a logbook of the
author's literal decisions ('transcrita literal') and carries proposed
doctrinal text destined for the Spanish book — translating it would
destroy that function (s G calls itself bitacora); the guia was already
status: historical (Fase 6) and the plan exempts it explicitly. English
frontmatter added to both; internal cross-links repointed (CANON,
theming/reference, book-deviations D.11). docs-check's I2 phantom-field
exemption follows the moved file (it matched by the LIBRO_VARIACIONES
filename; now also matches decisions/book-deviations.md). Corpus swept:
CANON x3, README (E2/E3 strata + tables — also fixed the pre-Fase-6
leftover row still calling the guia 'authoritative for any new wrapper'
and the unswept eidos/TSC.md stratum mention), building-a-component D.4,
completion-checklist G-1.1 + header, theming/reference, architecture
x5 (active-architecture, eidos, morfo, overview, sema x2).
docs:check 0 errors, 11-warn baseline.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 months ago
- [`guia-semantica-historica.md` ](../decisions/guia-semantica-historica.md ) — the original API conventions (historical seed).