website-htmx-rustelo/.ontoref/reflection/modes/validate-content.ncl
Jesús Pérez 3ccd15a14b init repo
2026-07-10 03:33:46 +01:00

47 lines
2.1 KiB
Text

let d = import "../defaults.ncl" in
d.make_mode String {
id = "validate-content",
trigger = "Validate bilingual content integrity: diff EN vs ES routes, verify content files exist for both languages, and check FTL translation-key parity. Enforces the bilingual-parity axiom.",
preconditions = [
"code/site/config/routes/ contains language-specific route config files",
"code/site/content/ exists",
"rg (ripgrep) available on PATH",
],
steps = [
{
id = "diff-routes",
action = "Compare EN and ES route configurations under code/site/config/routes/. Extract route paths from both language config files and report asymmetries (routes present in one language but not the other).",
actor = 'Both,
on_error = { strategy = 'Continue },
},
{
id = "count-content",
action = "Count content files per language and report any language whose count trails the other, with the specific gap. These become content-coverage publication blockers.",
cmd = "for lang in en es; do printf '%s: ' \"$lang\"; find code/site/content/$lang -name '*.md' 2>/dev/null | wc -l; done",
actor = 'Both,
depends_on = [{ step = "diff-routes" }],
on_error = { strategy = 'Continue },
},
{
id = "diff-ftl-keys",
action = "Compare Fluent FTL translation keys between EN and ES locales. Report keys present in one locale but missing in the other.",
cmd = "diff <(rg '^[a-z]' code/site/i18n/locales/en/ -h --no-line-number 2>/dev/null | sort) <(rg '^[a-z]' code/site/i18n/locales/es/ -h --no-line-number 2>/dev/null | sort)",
actor = 'Both,
depends_on = [{ step = "diff-routes" }],
on_error = { strategy = 'Continue },
},
{
id = "report",
action = "Generate a content integrity report: route symmetry, content-file completeness, FTL key coverage. Classify missing content as warnings and missing routes as errors against the bilingual-parity gate.",
actor = 'Both,
depends_on = [
{ step = "count-content" },
{ step = "diff-ftl-keys" },
],
on_error = { strategy = 'Stop },
},
],
}