Elamur Groupants⌕
☰

octopus-question-frame

The groupant beside tools/octopus/src/frame.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

componentlabelwhere
approximantpartial source derivedForward
astpartialsyntax.json
compositionpartial source derivedComposition
costpartial source derivedCost
descriptantpartial source derivedDescriptant
invariantpartial source derivedInvariant
testsfinite native checkschecks

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.

idtypelabelwhere
behavior_complementbehavior_complementsource derived finite checkedbehavior_complement
reverse_reconstructionreverse_reconstructionsource derived finite checkedreverse_reconstruction

Model text

model

Deputy question frame — source-bound model

Descriptant

frame.rs reads the deputy's own role frame from the native UD tree of one sentence: the mood (imperative, modal_request, polar, wh, declarative), the subject node and the verb node. world::ans::parse_question reads story wh-questions token by token and leaves the verb slot empty for "Is Crab running normally?" or "Could you start Eel?" («subj crab running normally | verb -»); the deputy needs the roles, so it reads them from the parse.

Forward

root r = the node with head 0. Wh if one of the first two words is a wh-word: verb = r, subject = nsubj(r). ModalRequest if the first word is an AUX modal (can, could, would, will) and the second is «you»: subject = «you», verb = the VERB «you» hangs on, else r. Polar if the first word is any other AUX: verb = r and subject = nsubj(r) when r is predicate-like (VERB, ADJ, -ing NOUN) with a subject; for a present-tense question whose root is a NOUN/PROPN (the copula's subject read as root), repaired: verb = the first later acl/amod/xcomp dependent that is predicate-like («Is the documenter running?», «Is Eel busy?»), or the -ing root itself with its preceding compound as subject («Is the Nautilus running?»); otherwise verb = r and subject = nsubj(r) or the preceding compound («Is Opus busy?»). Imperative if r is a bare VB without a subject; Declarative otherwise. text = mood[ repaired] | subj «phrase» | verb lemma.

Invariant

subject ≠ verb when both exist; a repaired frame names both; a past-tense polar question (first AUX tagged VBD) is never repaired, so its reading stays as parsed and the deputy keeps refusing history questions.

Cost

O(n) passes over at most 160 words; no model call.

Composition

lib.rs records the frame in every observation (deputy_frame). In resolve, a repaired polar frame removes the subject noun from the predicates and makes the recovered verb the checked clause head; a polar frame also marks inversion when the auxiliary hangs on a name inside the subject. The world frame stays recorded as native_question_frame for comparison.

behavior_complement

Not read: embedded questions («whether Eel is running» stays a complement clause of the request), coordination of several predicates, passive voice, questions without inversion («Eel is running?»), negation (refused later by the resolver), tense beyond the VBD check, and any repair other than subject-as-root. A frame is no proof that the parse is right; it constrains only which node may serve as the request head.

reverse_reconstruction

Many sentences share one frame (word order, determiners, adverbs, politeness words are dropped), so from a frame only the compatible set of sentences with that mood, subject phrase and verb lemma is recoverable, never the text.

checks

Checks (2026-11-04)

Unit tests on the native parses (en.bin 0.4) of real refused prompts: polar verb slot, subject-as-root repair (documenter, Eel busy, Nautilus compound), compound subject, modal request; negative controls: past-tense copula and noun-predicate polar not repaired, declarative and imperative moods. Disabling the repair turns the unit and the native deputy test red (restored).

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/tools/octopus/src/frame.rs.groupant/