chore(gate): scripts/ entra en el comprobador de tipos y debe cero como src/; fuera csstype, esm-env y generate:contracts-docs; prettier ignora web/ y .claude/ (F5 del cierre, parte 1)

Preparación del formateo de una sola vez, en un commit aparte para que ese
commit sea formato puro y quepa en .git-blame-ignore-revs.

- scripts/ nunca se había tipado. svelte.config.js lo añade al include de Kit;
  tsconfig.json excluye las sondas de agentes (scripts/__*: el exclude de la
  raíz pisa el que genera Kit, por eso va ahí). Medido: 7 errores en 4 scripts,
  todos de tipos. Arreglados sin casts nuevos: tres casts que el compilador
  rechazaba (component-audit, docs-vocabularies) y un Set tipado estrecho
  (morfo-vocabulary-check, 3 errores) — el JavaScript que emite esbuild para
  esos tres scripts es byte-idéntico antes y después. add-contracts-imports.ts
  es una migración muerta (apunta a $terra, capa borrada): sus 2 errores se
  arreglan (index ?? 0, e instanceof Error) y borrarla es decisión del autor.
- check-gate.ts: src/ y scripts/ deben cero (un ledger no puede absolverlos).
  Visto fallar: con un cast roto en docs-vocabularies, exit 1 «src/ and
  scripts/ owe zero»; restaurado byte a byte.
- package.json: fuera generate:contracts-docs (su script no existe) y las
  dependencias csstype y esm-env, que nadie importa (esm-env sigue como
  transitiva de kit y svelte; npm ls lo confirma).
- .prettierignore: web/ (árbol congelado) y .claude/ (configuración de la
  herramienta, incluido settings.local.json del autor).

Verificación: check:gate OK (89 de web/ dentro del ledger; src/ y scripts/ a
cero) · morfo:vocabulary exit 0 · docs:check 0/0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
alpha-0.1-background
dev 3 weeks ago
parent adb680899a
commit e31ac3ce35

@ -14,3 +14,7 @@ src/uix/active-uix/generated/
docs/audit/theming/
apps/*/src/generated/
apps/*/static/
# Frozen demo tree (docs/process plan de cierre, F5): not formatted until it is rebuilt.
web/
.claude/

11
package-lock.json generated

@ -10,10 +10,6 @@
"workspaces": [
"apps/*"
],
"dependencies": {
"csstype": "^3.2.3",
"esm-env": "^1.1.2"
},
"devDependencies": {
"@floating-ui/core": "^1.7.1",
"@floating-ui/dom": "^1.7.1",
@ -1997,12 +1993,6 @@
"node": ">=4"
}
},
"node_modules/csstype": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
"license": "MIT"
},
"node_modules/data-urls": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-7.0.0.tgz",
@ -2131,6 +2121,7 @@
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz",
"integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==",
"dev": true,
"license": "MIT"
},
"node_modules/esrap": {

@ -37,7 +37,6 @@
"blocks:check": "node --import tsx/esm scripts/blocks-check.ts",
"layer:check": "node --import tsx/esm scripts/layer-check.ts",
"docs:vocabularies": "node --import tsx/esm scripts/docs-vocabularies.ts",
"generate:contracts-docs": "node --import tsx/esm scripts/generate-contracts-docs.ts",
"generate:eidos-css": "node --import tsx/esm scripts/generate-eidos-css.ts",
"generate:boot": "node --import tsx/esm scripts/generate-boot.ts",
"generate:emoji-data": "node --import tsx/esm scripts/generate-emoji-data.ts",
@ -69,9 +68,5 @@
"vite": "^7.3.1",
"vitest": "^4.1.0",
"vitest-browser-svelte": "^2.0.2"
},
"dependencies": {
"csstype": "^3.2.3",
"esm-env": "^1.1.2"
}
}

@ -88,7 +88,7 @@ for (const file of files) {
const lastAttrsLineEnd = content.indexOf(
'\n',
attrsImportMatch.index + attrsImportMatch[0].length
(attrsImportMatch.index ?? 0) + attrsImportMatch[0].length
);
if (lastAttrsLineEnd === -1) {
skipped++;
@ -109,7 +109,7 @@ for (const file of files) {
console.log(`✅ ${componentName}`);
}
} catch (e) {
console.log(`❌ Error procesando ${file}:`, e.message);
console.log(`❌ Error procesando ${file}:`, e instanceof Error ? e.message : e);
}
}

@ -2,7 +2,9 @@
* check-gate — svelte-check with the debt ledger applied.
*
* Policy (P0 fase A, audit 2026-08-26):
* - Any ERROR under `src/` fails the gate: framework source owes zero.
* - Any ERROR under `src/` or `scripts/` fails the gate: framework source and
* the tooling that guards it owe zero (scripts/ is type-checked since the
* closure plan's F5; agent probes `scripts/__*` are excluded in tsconfig.json).
* - ERRORs elsewhere (the demo tree) are measured against the per-file
* ledger in `check-debt.ts`. A file above its ledgered count — or an
* erroring file the ledger does not name — fails. Counts only shrink:
@ -50,15 +52,20 @@ if (parsedErrors !== reportedErrors) {
let failed = false;
const srcErrors = [...errorsByFile].filter(([file]) => file.startsWith('src/'));
const OWES_ZERO = ['src/', 'scripts/'];
const owesZero = (file: string) => OWES_ZERO.some((prefix) => file.startsWith(prefix));
const srcErrors = [...errorsByFile].filter(([file]) => owesZero(file));
if (srcErrors.length > 0) {
failed = true;
console.error('check-gate: framework source has type errors (src/ owes zero):');
console.error(
'check-gate: framework source or tooling has type errors (src/ and scripts/ owe zero):'
);
for (const [file, count] of srcErrors) console.error(` ${file}: ${count}`);
}
for (const [file, count] of errorsByFile) {
if (file.startsWith('src/')) continue;
if (owesZero(file)) continue;
const allowed = CHECK_DEBT[file];
if (allowed === undefined) {
failed = true;

@ -117,7 +117,7 @@ const KEYBOARD_KEY_RE = /key:\s*['"]([^'"]+)['"]/g;
const VALENCED_FAMILIES = new Set(['commit', 'signal']);
const ALL_VERBS = new Set<string>(
(Object.values(SEMA_VERBS as Record<string, readonly string[]>) as readonly string[][]).flat()
Object.values(SEMA_VERBS as Record<string, readonly string[]>).flat()
);
const VERBS_BY_FAMILY = SEMA_VERBS as Record<string, readonly string[]>;
const ARCHETYPE_SET = new Set(ARCHETYPE_VOCABULARY);

@ -131,7 +131,7 @@ export function generateVocabulariesDoc(): string {
L.push('| Family | Verbs |');
L.push('| --- | --- |');
for (const [family, verbs] of Object.entries(SEMA_VERBS)) {
L.push(`| \`${family}\` | ${(verbs as string[]).map((v) => `\`${v}\``).join(' · ')} |`);
L.push(`| \`${family}\` | ${(verbs as readonly string[]).map((v) => `\`${v}\``).join(' · ')} |`);
}
L.push('');

@ -112,7 +112,7 @@ type Classification =
function classify(values: readonly string[]): Classification {
const valueSet = new Set(values);
for (const [name, canonical] of Object.entries(CANONICAL_VOCABULARIES)) {
const canonicalSet = new Set(canonical);
const canonicalSet = new Set<string>(canonical);
if (
canonicalSet.size === valueSet.size &&
[...valueSet].every((v) => canonicalSet.has(v))

@ -16,9 +16,11 @@ const config = {
alias: resolveUixAliases(__dirname),
typescript: {
// Kit's generated include lists routes, lib and src — not the root module
// every tool now imports. Checked like the rest.
// every tool now imports, nor the tooling in scripts/. Checked like the rest;
// agent probes (`scripts/__*`) are excluded in tsconfig.json.
config: (config) => {
config.include.push('../uix.aliases.js');
config.include.push('../scripts/**/*.ts');
}
},
},

@ -20,6 +20,7 @@
".svelte-kit/**",
"build/**",
"dist/**",
"tmp/**"
"tmp/**",
"scripts/__*"
]
}
Loading…
Cancel
Save

Powered by TurnKey Linux.