Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/rulvar / sectionPatternCountValidator

Function: sectionPatternCountValidator()

ts
function sectionPatternCountValidator(options): FinishValidator;

Defined in: packages/core/dist/index.d.ts

Counted collections inside named sections (RV2206, the subscription parity series). The engine validated citations per section since the v1.71 review, but the numbered collections the parity contract demands (48 N-case ids, 16 counterexample ids) were policed by nothing: the second accepted dossier carried 0 and 0 against an instruction naming both, and only a runner-side format pre-teach closed the gap, by hope rather than contract. Each entry slices its section exactly like sectionCitationsValidator (first marker occurrence to the next marker in position order) and counts matches, DISTINCT by first capture when the pattern captures; the reasons name the section, the label, the found count against the minimum, and with a capturing pattern the missing count in ids, so a repair turn knows exactly what to add (the RV2105 lesson). Default name 'section-pattern-counts'.

Parameters

ParameterType
options{ entries: readonly SectionPatternEntry[]; fencedCode?: FencedCodeMode; match?: SectionMatchMode; name?: string; sections: readonly string[]; }
options.entriesreadonly SectionPatternEntry[]
options.fencedCode?FencedCodeMode
options.match?SectionMatchMode
options.name?string
options.sectionsreadonly string[]

Returns

FinishValidator