refactor(sema,morfo)!: M6 — los alias deprecados mueren; un nombre por concepto

`IntentExpectedFamily` y `SemaEventLabel` eran alias de compatibilidad de
`IntentRequiredFamily` y `SemaEventKey`, y el codigo nuevo seguia importando el
nombre viejo — la mitad de los tipos hablaba el vocabulario de antes del
renombrado. La regla dura del repo (no backward-compat shims: actualiza los
consumidores y borra el camino viejo) decide el destino: 13 usos migrados a los
canonicos y los DOS alias borrados del tipo y del barrel.

La unica duda doctrinal se resolvio antes de tocar: D.3 (book-deviations:489)
nombra `IntentExpectedFamily`, pero DESCRIBE la implementacion con el nombre que
existia entonces — registro historico, no prescripcion. El precedente es la
casa misma: se ha renombrado vocabulario entero sin reescribir los registros de
decisiones.

Ademas, y declarado en la exposicion: `semaIntentExpectedFamilySchema` (const
local de morfo/schema.ts, mismo vocabulario viejo) pasa a
`semaIntentRequiredFamilySchema` — y el guard S-34 de contracts.test.ts, que lo
busca por nombre LITERAL, se actualiza en el mismo commit; separarlos habria
dejado el guard ciego un commit entero. Los 2 `as never` de compile.ts se
retiran: eran vestigio de antes de que existiera `DepSink` (un `() => void`
encaja en `(value: string) => void`), y el compilador lo confirma. Y
`_resetCompileCache`, tercera pata de la ficha, resulto YA borrado — cero
apariciones en src/; se anota para que no vuelva a la cola.

Censo previo al borrado: cero consumidores de los alias en src/, web/ y
scripts/ fuera de los 13 migrados. Las funciones `is/parse/toSemaEventLabel` y
el tipo `ParsedSemaEventLabel` conservan su nombre: son API propia, no el
alias, y su renombrado quedo explicitamente FUERA de lo firmado.

Verificado: sema+morfo+contracts 541 ✓ / 6 ajenos · check 69 = base aislada,
diff VACIO · prettier: types.ts era mio y queda limpio; compile.ts y
contracts.test.ts ya fallaban en HEAD y no se reformatean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
alpha-0.1-dir-prefs
dev 2 months ago
parent 4e7d0be670
commit 13246a2c23

@ -221,8 +221,13 @@ por los dos caminos.
3. ~~**S-30/S-38**~~ EJECUTADO · ~~**S-19**~~ EJECUTADO PARCIAL (firma alineada; encender el canal sigue abierto, ver §3).
4. **§3.5 fable** — `M1 emission` (aceptada y nunca implementada; cerraría los
waivers de tooltip y gradient-picker) · `M4` (`enumPair` frágil con 3+
valores) · `M5` (tipar el matcher `state`) · **`M6`** (`IntentExpectedFamily`
deprecado ×2 — **vive en las líneas de S-33, tocarlas una sola vez**) ·
valores) · `M5` (tipar el matcher `state`) · ~~`M6`~~ **EJECUTADO
2026-08-13**: los alias `IntentExpectedFamily`/`SemaEventLabel` BORRADOS
(no-shims; D.3 los nombra como HISTORIA, no como prescripción), 13 usos
migrados a los canónicos, `semaIntentExpectedFamilySchema` renombrado
`…Required…` CON el guard S-34 actualizado en el mismo commit, los 2
`as never` de `compile.ts` retirados (vestigio pre-`DepSink`), y
`_resetCompileCache` resultó YA borrado — fuera de la cola ·
`E2` (`globalThis.matchMedia` crudo en eidos) · `E3` (catch mudo en
`#renderSchemeCss`).
5. **§3.6 blocks** — `A-47` (anillo de foco 1,43:1 sobre panel sólido) ·

@ -932,7 +932,7 @@ describe('UIX layer contracts', () => {
.sort();
const drift = 'intent policy drift — the schema partition no longer matches SEMA_FAMILY_POLICY';
expect([...(unions.get('semaIntentExpectedFamilySchema') ?? [])].sort(), drift).toEqual(
expect([...(unions.get('semaIntentRequiredFamilySchema') ?? [])].sort(), drift).toEqual(
fromPolicy(true)
);
expect([...(unions.get('semaIntentOptionalFamilySchema') ?? [])].sort(), drift).toEqual(

@ -449,7 +449,7 @@ function walkParts(
add: () => {
needsTranslations = true
}
} as never)
})
collectConditionDeps(plan.condition, partStates, partProps, partRefs)
collectConditionDeps(plan.condition, stateSet, propSet, partRefSet)
// Pre-resolve literal sources into staticAttrs when there's no
@ -472,7 +472,7 @@ function walkParts(
add: () => {
needsTranslations = true
}
} as never)
})
collectConditionDeps(plan.condition, partStates, partProps, partRefs)
collectConditionDeps(plan.condition, stateSet, propSet, partRefSet)
// Naming attrs never hoist to staticAttrs even as unconditional

@ -213,7 +213,7 @@ const semaIntentOptionalFamilySchema = union(
literal('contact'),
literal('handle')
);
const semaIntentExpectedFamilySchema = union(literal('commit'), literal('signal'));
const semaIntentRequiredFamilySchema = union(literal('commit'), literal('signal'));
/**
* Structural / frame families where the book keeps intent OUT
@ -251,7 +251,7 @@ const persistenceSchema = union(
literal('stateBound')
);
const semaFamilySchema = union(semaIntentOptionalFamilySchema, semaIntentExpectedFamilySchema);
const semaFamilySchema = union(semaIntentOptionalFamilySchema, semaIntentRequiredFamilySchema);
// Polymorphism (book §5.3) is ADDITIVE on the canonical event shape:
// the morfo declares its default `family` + `intent` + `verb` as usual
@ -271,7 +271,7 @@ const eventSemanticSchema = union(
targetFallback: optional(array(partRefSchema))
}),
object({
family: semaIntentExpectedFamilySchema,
family: semaIntentRequiredFamilySchema,
target: partRefSchema,
intent: union(semaIntentSchema, semanticIntentSchema),
intentRationale: optional(string()),

@ -33,7 +33,7 @@ import type {
SemaRegime,
SemaScope,
SemaFamily,
IntentExpectedFamily,
IntentRequiredFamily,
IntentOptionalFamily,
IntentForbiddenFamily,
SignalPersistence
@ -433,7 +433,7 @@ export type MorfoEventSemantic = (
allowedFamilies?: readonly SemaFamily[];
}
| {
family: IntentExpectedFamily;
family: IntentRequiredFamily;
target: PartRef;
intent: Intent | MorfoSemanticIntent;
verb?: string;

@ -4,7 +4,6 @@ import {
type SemaActionEvent,
type SemaEvent,
type SemaEventKey,
type SemaEventLabel,
type SemaFamily,
type IntentBinding,
type IntentForbiddenFamily,
@ -85,7 +84,7 @@ export function isIntent(value: unknown): value is Intent {
return typeof value === 'string' && INTENT_SET.has(value as Intent);
}
export function isSemaEventLabel(value: unknown): value is SemaEventLabel {
export function isSemaEventLabel(value: unknown): value is SemaEventKey {
return typeof value === 'string' && LABEL_SET.has(value as SemaEventKey);
}
@ -141,7 +140,7 @@ export function isSemaEvent(value: unknown): value is SemaEvent {
*/
export type ParsedSemaEventLabel = { family: SemaFamily } | { family: SemaFamily; intent: Intent };
export function parseSemaEventLabel(label: SemaEventLabel): ParsedSemaEventLabel {
export function parseSemaEventLabel(label: SemaEventKey): ParsedSemaEventLabel {
const [family, rawIntent] = label.split('-');
if (rawIntent === undefined) {
return { family: family as SemaFamily };
@ -181,7 +180,7 @@ export function normalizeSemaEvent(
): {
family: SemaFamily;
intent: Intent | null;
label: SemaEventLabel;
label: SemaEventKey;
} {
if (typeof event === 'string') {
const parsed = parseSemaEventLabel(event);
@ -204,7 +203,7 @@ export function normalizeSemaEvent(
return {
family: event.family,
intent: null,
label: event.family as SemaEventLabel
label: event.family as SemaEventKey
};
}
@ -212,13 +211,13 @@ export function normalizeSemaEvent(
return {
family: event.family,
intent,
label: `${event.family}-${intent}` as SemaEventLabel
label: `${event.family}-${intent}` as SemaEventKey
};
}
export function toSemaEventLabel(
event: SemaActionEvent,
props?: Record<string, unknown>
): SemaEventLabel {
): SemaEventKey {
return normalizeSemaEvent(event, props).label;
}

@ -2,7 +2,6 @@ export type {
SemaValencedFamily,
SemaTransitionalFamily,
SemaFamily,
IntentExpectedFamily,
IntentOptionalFamily,
SemaMode,
SemaDirection,
@ -10,7 +9,6 @@ export type {
SemaScope,
SemaCause,
SemaEventKey,
SemaEventLabel,
IntentBinding,
SemaEvent,
SemaEventExtensions,

@ -115,12 +115,6 @@ export type IntentRequiredFamily = {
: never;
}[SemaFamily];
/**
* @deprecated Use {@link IntentRequiredFamily}. Kept as alias for
* backward compatibility with the `intentPolicy: 'expected'` naming.
*/
export type IntentExpectedFamily = IntentRequiredFamily;
export type IntentOptionalFamily = {
[K in SemaFamily]: (typeof SEMA_FAMILY_POLICY)[K]['intentRequirement'] extends 'optional'
? K
@ -268,13 +262,6 @@ export type SemaEventKey =
| IntentForbiddenFamily
| `${IntentOptionalFamily | IntentRequiredFamily}-${Intent}`;
/**
* @deprecated Use {@link SemaEventKey}. Kept as an alias for backward
* compatibility — the two are structurally identical post-Phase 2 of
* the codex refactor (`refactorizacion_codex.md`).
*/
export type SemaEventLabel = SemaEventKey;
// ── Structured semantics ───────────────────────────────────────────────────
export interface IntentBinding {
@ -341,7 +328,7 @@ export type SemaEvent = (
intent?: Intent | IntentBinding;
}
| {
family: IntentExpectedFamily;
family: IntentRequiredFamily;
intent: Intent | IntentBinding;
}
| {
@ -351,7 +338,7 @@ export type SemaEvent = (
) &
SemaEventExtensions;
export type SemaActionEvent = SemaEvent | SemaEventLabel;
export type SemaActionEvent = SemaEvent | SemaEventKey;
// ── DOM-oriented writes used by Morfo events ──────────────────────────────

Loading…
Cancel
Save

Powered by TurnKey Linux.