wikt-count-text-command
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 |
| composition | partial | composition |
| 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-behavior_complement | behavior_complement | partial source derived model | behavior_complement |
wikt-count-text-command-reverse_reconstruction | reverse_reconstruction | partial source derived model | reverse_reconstruction |
wikt-count-text-command-section_byte_envelope | section_byte_envelope | partial source derived model | section_byte_envelope |
wikt-count-text-command-definition_partition | definition_partition | partial source derived model | definition_partition |
wikt-count-text-command-pending_template_join | pending_template_join | partial source derived model | pending_template_join |
wikt-count-text-command-report_order_limits | report_order_limits | partial source derived model | report_order_limits |
Parts
Model text
descriptant
wikt-count-text-command
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.
Line-based export parser collects Page, aggregates on close; truncation/no pages fail before writers. Namespace counters separate redirects. English L2 and Ukrainian language/block aggregates consume unescaped page text; pending Ukrainian etymology templates checked against namespace10 pages at write, then TSVs then summary.
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
Line-based export parser collects Page, aggregates on close; truncation/no pages fail before writers. Namespace counters separate redirects. English L2 and Ukrainian language/block aggregates consume unescaped page text; pending Ukrainian etymology templates checked against namespace10 pages at write, then TSVs then summary.
Domain
Export0.11 one-tag-per-line escaped-text conventions; bounded u64 counters and UTF-8 conversion; malformed data may be lossy. No full dump or CLI effects executed.
composition
Local composition
The scoped english-sections fragment models its declared source interval. Parent relation: Line-based export parser collects Page, aggregates on close; truncation/no pages fail before writers. Namespace counters separate redirects. English L2 and Ukrainian language/block aggregates consume unescaped page text; pending Ukrainian etymology templates checked against namespace10 pages at write, then TSVs then summary.
Shared representation/invariant: Namespace pages count closed pages; nonredirect text bytes trust bytes attr, not decoded bytes. Sections count language occurrences not unique titles. Some HashMap report tie orders lack a final key. No semantic dictionary quality inference. Child costs are included in parent costs, not added a second time. Other command paths are tagged alternatives; the child alone does not establish whole-file behavior.
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
Redirect cannot contribute ns bytes/linked/year/editor or language counters; translation subpage bypasses normal En language sections.
Domain: Export0.11 one-tag-per-line escaped-text conventions; bounded u64 counters and UTF-8 conversion; malformed data may be lossy. No full dump or CLI effects executed. Observation: Namespace pages count closed pages; nonredirect text bytes trust bytes attr, not decoded bytes. Sections count language occurrences not unique titles. Some HashMap report tie orders lack a final key. No semantic dictionary quality inference. 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
Aggregated counts admit many page orders/content revisions; trusted byte attr need not recover text length. Top100 editors loses tail identities/counts.
Domain: Export0.11 one-tag-per-line escaped-text conventions; bounded u64 counters and UTF-8 conversion; malformed data may be lossy. No full dump or CLI effects executed. Observation: Namespace pages count closed pages; nonredirect text bytes trust bytes attr, not decoded bytes. Sections count language occurrences not unique titles. Some HashMap report tie orders lack a final key. No semantic dictionary quality inference. 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.
section_byte_envelope
Each language section includes header through next language header; off increments bytes+newline but slicing clamps to text.len at boundaries.
Domain: Export0.11 one-tag-per-line escaped-text conventions; bounded u64 counters and UTF-8 conversion; malformed data may be lossy. No full dump or CLI effects executed. Observation: Namespace pages count closed pages; nonredirect text bytes trust bytes attr, not decoded bytes. Sections count language occurrences not unique titles. Some HashMap report tie orders lack a final key. No semantic dictionary quality inference. 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.
definition_partition
English defs_formof<=defs; Ukrainian defs_filled derives letters or definition templates, with plain-def fallback only defs==0.
Domain: Export0.11 one-tag-per-line escaped-text conventions; bounded u64 counters and UTF-8 conversion; malformed data may be lossy. No full dump or CLI effects executed. Observation: Namespace pages count closed pages; nonredirect text bytes trust bytes attr, not decoded bytes. Sections count language occurrences not unique titles. Some HashMap report tie orders lack a final key. No semantic dictionary quality inference. 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.
pending_template_join
Uk write drains pending names, exists-any in tpl_pages determines valid template etymology; add any only if !text to avoid double count.
Domain: Export0.11 one-tag-per-line escaped-text conventions; bounded u64 counters and UTF-8 conversion; malformed data may be lossy. No full dump or CLI effects executed. Observation: Namespace pages count closed pages; nonredirect text bytes trust bytes attr, not decoded bytes. Sections count language occurrences not unique titles. Some HashMap report tie orders lack a final key. No semantic dictionary quality inference. 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.
report_order_limits
English langs ties by name; templates lang then section count then name. Ukrainian morph/emptydef sort lang then count without key tie; equal counts may nondeterministically order.
Domain: Export0.11 one-tag-per-line escaped-text conventions; bounded u64 counters and UTF-8 conversion; malformed data may be lossy. No full dump or CLI effects executed. Observation: Namespace pages count closed pages; nonredirect text bytes trust bytes attr, not decoded bytes. Sections count language occurrences not unique titles. Some HashMap report tie orders lack a final key. No semantic dictionary quality inference. 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
Native evidence โ 2026-10-31
Package/bin: wikt-count. Exact selected names:
wave33::entities_sections_and_translation_partition
All 1 selected checks passed twice in debug and twice in release, one exact name per invocation with one test thread. Numeric exits are zero; sorted named outcomes match across all four runs. Added test blocks were formatted before these receipts; original source prefix (including earlier tests) remains byte-identical.
One compiled production mutant changed translation subpage early return to disable early return. The new wave33 test compiled and failed its runtime assertion (exit 101). Exact original/restored SHA-256 equality and a restored positive exact test (exit 0) were verified. No assertion-only mutant is counted; existing negative assertions remain ordinary tests. No surviving compiled mutant is omitted.
The external wave33 text receipts retain native-commands.json, verified-outcomes.json, mutation-report.json, raw logs/statuses, paired syntax projections and prospective.md. No private filesystem path is part of this public model.
Scope: actual helpers on synthetic in-memory data only. Export0.11 one-tag-per-line escaped-text conventions; bounded u64 counters and UTF-8 conversion; malformed data may be lossy. No full dump or CLI effects executed. The scoped fragment reuses these tests where its helper is reached; other declared paths remain source-derived. Macro expansion, full command/effect execution, corpus accuracy and universal correctness are not established.
invariant-and-cost
Invariant and cost
Invariant
Namespace pages count closed pages; nonredirect text bytes trust bytes attr, not decoded bytes. Sections count language occurrences not unique titles. Some HashMap report tie orders lack a final key. No semantic dictionary quality inference.
Cost
O(input bytes) scanner plus template scans and aggregation; memory largest page plus distinct languages/templates/editors and pending/audio data, not constant memory. Sorted reports O(K log K), buffered output costs.
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/