validateContent and the shared config seam
The entry point every other item in SPEC-135 sits on. Pure packages/content work, no CLI, and it is where D14's invariant is established.
The entry point every other item in SPEC-135 sits on. Pure packages/content work, no CLI, and it is where D14's invariant is established.
Tracking started Sep 18 — check back for trends.
The per-page loop (packages/content/src/site.ts:382) does six things. Validation needs two:
| Step | Needed |
|---|---|
parseFrontmatter | yes |
router.resolve | no |
resolveLayouts | no |
resolveTimestamps — git, batched once at :735 | no |
Markdoc.parse | yes |
transformContent — config, validatePage, then Markdoc.transform | config and validatePage, not the transform |
runPipeline (:545) | no — that is --deep |
transformContent validates and transforms against one shared config object, and SPEC-132 chose that deliberately (site.ts:114-118):
validate against
config, the very object handed totransformbelow, so the two cannot disagree about which tags and attributes exist.
A validateContent that assembles its own tag set re-opens exactly that disagreement — and then nothing holds up SPEC-135 D5a's guarantee that the CLI and the build report the same findings. The extraction is the mechanism, not tidying.
transformContent (site.ts:90-113) into a function both it and validateContent calltransformContent behaviour is unchanged — same findings, same renderable, for every existing testvalidateContent is exported from @refrakt-md/content and accepts a ContentTree or a directory path plus optionsSite, partially populated or otherwiserouter.resolve, resolveLayouts, resolveTimestamps, Markdoc.transform or runPipelineValidationSettings and resolves them through resolveValidationIds, rather than reimplementing the dispositionsvalidateContent and a full loadContent produce the same findings for the same site, including on a config with disableIds set — the D5a agreement testtransformContent. This should be a pure refactor with no behaviour change — land it first, verify the existing suite is untouched, then build on it.validateContent using that function plus validatePage.The agreement test is the deliverable, not a formality. A validateContent that quietly disagrees with the build is worse than no CLI at all: it would send someone chasing a finding the build does not have, or bless content the build would reject.
packages/content/src/site.ts — transformContent, the per-page loop, loadContentpackages/content/src/validate.ts — validatePage, resolveValidationIds, ValidationSettings