coref-main-diagnostics
The groupant beside coref/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 |
| descriptant | present | descriptant |
| invariant | partial | invariant |
| 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 |
|---|---|---|---|
behavior_complement | behavior_complement | partial source derived model | behavior_complement |
reverse_reconstruction | reverse_reconstruction | partial source derived model | reverse_reconstruction |
argument_grammar | argument_grammar | partial source derived model | argument_grammar |
dispatch_effects | dispatch_effects | partial source derived model | dispatch_effects |
load_transport | load_transport | partial source derived model | load_transport |
diagnostic_zero | diagnostic_zero | partial source derived model | diagnostic_zero |
Model text
descriptant
coref-main-diagnostics
Explanation rendering and mention diagnostics with zero/count behavior.
Epoch 2026-10-31: scoped view of parent state; no independent completeness claim.
approximant
Scoped forward relation
Explanation rendering and mention diagnostics with zero/count behavior.
Parent transition model (restricted to this byte scope): args takes first argument as command; --trees/out/label consume next token with missing-value error; --exact boolean; all other tokens positional. Repeated values last-win. resolve requires1, score2, eval1+out, mentions1; explain accepts>=1 and uses second as optional id, ignoring further positionals. load reads gold then optional tree, retrees and builds documents. Eval creates directory before input load, then run outputs and report write.
invariant
Scoped invariant/cost
Resolve gold stripping is implicit in detector behavior, not removal before load. Score loads both files without --trees and checks document count only; heads use each file's tree. Mention diagnostics use zip and zero denominators can print NaN. CLI results depend on filesystem and may leave partial effects.
Argument bytes linear; load holds raw cloned input plus tree/document views. Resolve/eval costs delegated; mention_stats matching plus map counts and sorted top-k summaries. Whole input/output strings are buffered, no resource cap.
Scope: Explanation rendering and mention diagnostics with zero/count behavior.. Parent bounds are conservative; no separate timing measured.
models
Scope: Explanation rendering and mention diagnostics with zero/count behavior.. Relations below are restricted to this fragment's transitions and retained parent state.
Typed models
behavior_complement
Invalid dispatch arity cannot execute chosen processing arm and returns usage after argument parsing. Missing flag value errors before usage. Eval input failure does not exclude a newly created output directory. Unknown option tokens are accepted as positionals, not rejected as unknown flags.
reverse_reconstruction
For stdout y, compatible argv/files may vary in ignored flags, extra explain positionals and discarded data. load output admits any aligned tree source with matching replacement columns; output does not uniquely identify file bytes or path. Error messages constrain failing stage rather than full prior state.
argument_grammar
Flags are recognized after command, values consume even flag-looking tokens; duplicate path/label last wins. No -- terminator.
dispatch_effects
resolve prints raw updated text; explain may print multiple documents; score computes two policies; eval creates dir, writes diagnostics/output then report; mentions prints counts.
load_transport
load(path,Some(t))=documents(retree(read(path),read(t))); gold read failure precedes tree read/alignment, documents validates resulting trees.
diagnostic_zero
mention_stats head recall=100 hit/ng and precision=100 hit/np without zero guard; exact conditional denominator max(hit,1). Ties in top tables sort count descending then lexical key.
No executable percentage surrogate: categorical state/effect semantics currently lack a useful cheaper observation metric. Supported future caps are 1%, 2%, 5%, 10%; no profile is claimed here.
tests
Evidence โ 2026-10-31
Safe synthetic command: env -u COREF_X -u COREF_MD -u PRAG_OFF cargo test -p coref tests:: -- --skip score::. Two debug and two release executions are retained externally with numeric exit status and sorted named outcomes. Selected checks:
- wave27_tests::synthetic_load_preserves_gold_and_rejects_mismatched_trees
See source-test-map.json and controls.json in the wave27 coref run receipts. The library declaration file has compilation evidence only. No corpus, teacher, GPU or speed measurement.
Partial scope: Arg parser/process dispatch and output formatting not fully executed; synthetic load test only. No broad CLI or I/O-failure control.
Measured receipts
Final source state: 13 named tests (12 library, 1 binary) passed twice debug and twice release, 52 total executed test instances; all four command exits0 and sorted named outcomes identical. Five added tests are four library boundary tests plus one main load test. The pre-existing score tests and groupant_transfers were filtered out.
Compiled actual-source control: wave27_tests::synthetic_load_preserves_gold_and_rejects_mismatched_trees. Compile exit0, assertion-run exit101, exact bytes restored, positive rerun exit0. Retained logs: control-main-compile.log, control-main-red.log, control-main-restored.log.
Nine source AST projections were generated twice identically. Shared ancestor declarations are deferred to root integration; local owned leaves have no structural diagnostics. No timings or general accuracy claim.
This page in Markdown โ https://md.groupants.elamur.ai/free/en/mova/coref/src/main.rs.groupant/diagnostics.groupant/