wikt-count-text-command-english-sections
The groupant beside tools/wikt-count/src/main.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.
Facts
Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.
Components
| component | label | where |
|---|---|---|
| approximant | partial | approximant |
| ast | partial | ../syntax.json |
| cost | symbolic source derived | invariant-and-cost |
| descriptant | present | descriptant |
| invariant | partial | invariant-and-cost |
| tests | executed bounded checks | tests |
Obernants
The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.
| id | type | label | where |
|---|---|---|---|
wikt-count-text-command-english-sections-behavior_complement | behavior_complement | partial source derived model | behavior_complement |
wikt-count-text-command-english-sections-reverse_reconstruction | reverse_reconstruction | partial source derived model | reverse_reconstruction |
wikt-count-text-command-english-sections-header_ownership | header_ownership | partial source derived model | header_ownership |
wikt-count-text-command-english-sections-template_presence | template_presence | partial source derived model | template_presence |
wikt-count-text-command-english-sections-no_language_sample | no_language_sample | partial source derived model | no_language_sample |
wikt-count-text-command-english-sections-formonly_partition | formonly_partition | partial source derived model | formonly_partition |
Model text
descriptant
wikt-count-text-command-english-sections
Epoch 2026-10-31
Full source read preceded changes. Prospective model predicted branch/order, resource and information-loss behavior. Tests exercise actual helpers on bounded synthetic inputs; command workflows remain unexecuted. Production source prefix is preserved; only inline tests added.
page increments pages; /translations counts translation templates separately and returns. Otherwise L2 starts a section, flush previous body and counters; final flush; no-L2 increments bounded sample. flush gathers focus-language template occurrences and section presence.
Executable percentage approximation is unsupported: categorical parsing/effects have no useful certified metric here. Partial syntax excludes macro expansion and name resolution.
approximant
Forward relation
page increments pages; /translations counts translation templates separately and returns. Otherwise L2 starts a section, flush previous body and counters; final flush; no-L2 increments bounded sample. flush gathers focus-language template occurrences and section presence.
Domain
UTF-8 wikitext heading heuristic; non-overflowing counters; no macro expansion or semantic template evaluation.
models
Typed source models
All models are partial source-derived relations at this manifest snapshot. Scope is one call/trace under the stated domain; no universal semantic proof.
behavior_complement
/translations cannot also increment langs in same call; language other than English/Ukrainian cannot contribute focus tpl map.
Domain: UTF-8 wikitext heading heuristic; non-overflowing counters; no macro expansion or semantic template evaluation. Observation: Each ordinary L2 causes exactly one flush, sections preserve repeated language counts. tpl occurrence count counts all sightings; section count increments once per template per section. Assumptions: bounded resources and source branch semantics. Oracle: selected actual-helper tests in tests.md constrain only their finite fixtures; remaining branches are source-derived.
reverse_reconstruction
Counts identify compatible number of sections and sightings, not text or order. Identical tpl occurrence totals can have different per-section presence.
Domain: UTF-8 wikitext heading heuristic; non-overflowing counters; no macro expansion or semantic template evaluation. Observation: Each ordinary L2 causes exactly one flush, sections preserve repeated language counts. tpl occurrence count counts all sightings; section count increments once per template per section. Assumptions: bounded resources and source branch semantics. Oracle: selected actual-helper tests in tests.md constrain only their finite fixtures; remaining branches are source-derived.
header_ownership
L2 line starts included byte body but is not passed to en_line; following lines until next L2 belong to current section.
Domain: UTF-8 wikitext heading heuristic; non-overflowing counters; no macro expansion or semantic template evaluation. Observation: Each ordinary L2 causes exactly one flush, sections preserve repeated language counts. tpl occurrence count counts all sightings; section count increments once per template per section. Assumptions: bounded resources and source branch semantics. Oracle: selected actual-helper tests in tests.md constrain only their finite fixtures; remaining branches are source-derived.
template_presence
For each local name n>0, tpl.occ+=n and tpl.sections+=1, so presence<=occurrences.
Domain: UTF-8 wikitext heading heuristic; non-overflowing counters; no macro expansion or semantic template evaluation. Observation: Each ordinary L2 causes exactly one flush, sections preserve repeated language counts. tpl occurrence count counts all sightings; section count increments once per template per section. Assumptions: bounded resources and source branch semantics. Oracle: selected actual-helper tests in tests.md constrain only their finite fixtures; remaining branches are source-derived.
no_language_sample
No L2 increments pages_nolang; sample retains first30 such titles in input order; later titles unrecoverable.
Domain: UTF-8 wikitext heading heuristic; non-overflowing counters; no macro expansion or semantic template evaluation. Observation: Each ordinary L2 causes exactly one flush, sections preserve repeated language counts. tpl occurrence count counts all sightings; section count increments once per template per section. Assumptions: bounded resources and source branch semantics. Oracle: selected actual-helper tests in tests.md constrain only their finite fixtures; remaining branches are source-derived.
formonly_partition
defs==0 increments nodefs; else defs_formof==defs increments formonly. The two classifications are disjoint.
Domain: UTF-8 wikitext heading heuristic; non-overflowing counters; no macro expansion or semantic template evaluation. Observation: Each ordinary L2 causes exactly one flush, sections preserve repeated language counts. tpl occurrence count counts all sightings; section count increments once per template per section. Assumptions: bounded resources and source branch semantics. Oracle: selected actual-helper tests in tests.md constrain only their finite fixtures; remaining branches are source-derived.
tests
Evidence
Selected exact tests: ["wave33::entities_sections_and_translation_partition"].
Each runs twice in debug and twice in release with normalized named outcomes compared. Compiled production-boundary mutants are recorded in the external wave33 text receipts with original/restored hashes and positive reruns. Existing negative assertions are separate from compiled mutants. No CLI, download, teacher, corpus or model execution. For this fragment, source-derived paths not reached by these tests remain unverified.
invariant-and-cost
Invariant and cost
Invariant
Each ordinary L2 causes exactly one flush, sections preserve repeated language counts. tpl occurrence count counts all sightings; section count increments once per template per section.
Cost
O(B+T) scanning plus hash map expected operations; focus template local map memory O(distinct templates); report sorting O(L log L+T log T).
Arithmetic and allocation premises are conditional. No timing or percentage surrogate claimed.
This page in Markdown โ https://md.groupants.elamur.ai/free/en/mova/tools/wikt-count/src/main.rs.groupant/english-sections.groupant/