Skip to content

feat(templates): the constructor contract is the module kinds - #594

Open
DemchaAV wants to merge 1 commit into
feature/cv-constructor-layerfrom
feat/cv-constructor-kinds
Open

feat(templates): the constructor contract is the module kinds#594
DemchaAV wants to merge 1 commit into
feature/cv-constructor-layerfrom
feat/cv-constructor-kinds

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Why

The runtime CV layer treated CvRenderKit (paragraph / row / entry primitives) as the template contract, and SectionRole as what a module is. That is the wrong axis for a constructor: a template in the raw does not know Experience from Projects. It knows how to draw prose, a list, a timeline. JSON picks the kind; the template implements the kind. A kit of primitives can absorb a new shape (dash) without any template noticing.

What changed

  • CvConstructor is the contract: one method per CvKind (paragraph, bullets, bulletsStacked, inlineList, entries, entriesDated) and no defaults. render(...) is the exhaustive dispatcher — a new constant without a method is a compile error there too.
  • ModularCvTemplate extends CvConstructor and no longer has kit(). Every modular preset declares the six methods. Canonical ones forward to ModuleRenderer; BlueBanner / EditorialBlue forward through their existing drawing.
  • CvRenderKit stays as the optional primitive hook under a kind method, not the template surface. ClassicSerif (not modular yet) still uses a private kit.
  • CvConstructorKindGateTest holds the bijection and that every modular template declares the methods rather than inheriting a default.

Two-column claimed slots still lower through SectionRouter by role; that placement rewrite is the next PR. Visual output of the existing sample CVs is unchanged.

Verification

./mvnw -B -ntp -pl :graph-compose-templates testBUILD SUCCESS, 143 tests, 0 failures (including CvConstructorKindGateTest 8/8).

./mvnw -B -ntp -pl :graph-compose-templates,:graph-compose-qa -am test -Dtest=CvConstructorKindGateTest,ModularCvTemplateFidelityTest,ModuleSectionParityTest,ModuleSectionKindCoverageTest,CvTemplatesCoverageTest,RoleRoutingTest,LeftoverSectionTestBUILD SUCCESS, 139 tests in qa (+ templates gate). DocumentationSnippetCompileTest 6/6 green.

Lane: templates — constructor contract for runtime CV modules.

Base: feature/cv-constructor-layer. Next: place runtime modules by kind/slot, then drop SectionRole from ModuleSection.

A modular template implements one method per CvKind, with no defaults.
JSON picks the shape; the template draws the shape. It does not know
whether the section is Experience. Adding a kind is adding a method,
and every ModularCvTemplate has to implement it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant