Skip to main content

Module validate

Module validate 

Source
Expand description

What a well-formed answer must still satisfy. The reply format (reply) has already turned away anything that isn’t an ANSWER: or SKIP; these checks judge the answer text itself: its size, and whether it is a real title (a stored one too, from an older build), or a safe suggestion.

The absence and refusal lists below are frozen. They judge titles that older builds stored, before the reply format existed, and the frontend’s port of is_usable_title shares them through title_corpus.json. New wordings are the reply format’s job, not a new list entry.

Structs§

Limits
Size bounds for a one-line reply.

Constants§

ABSENCE_EXACT 🔒
Text that is ABOUT the absence of a title rather than a title. Compared after absence_form, so brackets, quotes and punctuation do not matter.
ABSENCE_PREFIXES 🔒
Deliberately few and specific. A prefix rejects every title that begins with it, so “no title” and “title not” are NOT here: “No title bar on Windows” and “Title not updating in swarm row” are real titles (ReAgent on #4185). Anything that is only absence when it is the WHOLE reply belongs in ABSENCE_EXACT.
CONTINUED_NOTE
A continued session’s pick-up note: two or three sentences (asked for under 60 words), still one line.
LEGACY_KEEP_TOKEN 🔒
The word the title prompts used for “no change” before the reply format.
NAME
A subagent or workflow-batch name (asked for ~5 words).
NARRATION
A one-sentence narration (asked for under 20 words).
NEXT_PROMPT
A next-prompt suggestion is one short imperative; anything longer is an explanation, not a command.
PREVIEW
A definition’s conversation preview (asked for 12 words or fewer).
REFUSAL_PHRASES 🔒
First-person refusals and offers: a model talking to the reader instead of producing the text. Specific enough not to fire on an ordinary title.
RISKY_PHRASES 🔒
Things a ghost suggestion must not propose on its own initiative: one Tab and Enter away from the user sending them without having thought of them.
STORED_TITLE
Bounds for judging a title that is ALREADY stored. Generous: a title written under an older word target or by an older build may be longer than today’s.

Functions§

absence_form 🔒
Lower-case, every non-alphanumeric run collapsed to one space, trimmed. So (None yet), "none yet." and none-yet all become none yet, while No-op rename threshold becomes no op rename threshold.
accept_line
Returns the line to use, or None if the reply is not usable text: empty, multi-line, over the limits, a placeholder, or a model refusal. This is the check every ambient reply gets.
accept_next_prompt
Returns the suggestion to show, or None if the answer is not a usable next prompt: anything accept_line rejects, a question, or a risky command.
has_any 🔒
has_phrase 🔒
Whether phrase occurs in lower as whole words. A bare substring match would read “has an AI summary bug” as the refusal “as an ai”.
is_absence 🔒
is_usable_title
Is this stored value a real title? The one predicate behind accepting a reply, feeding a stored title back into a prompt, and (in the frontend’s port of it) displaying one. A value already in a database from before the check existed, such as (none yet), is judged here too, so it is never fed back to the model and never shown.
is_wrapped_note 🔒
A reply that is entirely a parenthetical or bracketed note. A title is not a note about the title.
leads_with_abstain_token 🔒
A reply that LEADS with the abstain token in capitals, “KEEP — the title still fits”: the model said “no change” and explained itself. Case-sensitive on purpose: “Keep alive pings” and “Keep the swarm summary fresh” are real titles, while an upper-case KEEP is the token the prompt asked for.
normalized 🔒
Lower-cased text with typographic apostrophes straightened, for phrase matching only (the text handed back is untouched).
title_limits
A pane/session title asked for word_target words. The slack covers a model that runs a little over; a paragraph is still rejected.