2-4 sentences is not a range
Every reply-length rule in a chat agent is a range: long enough not to sound curt, short enough to fit a phone screen. We took a clean billing agent, wrote its one range nine ways, and added two edits: one that goes under the floor, one that goes over the ceiling.
TL;DR TypeGlish compares a bound only when it is written at least N or at most N with a unit word, so 2-4 sentences, between 2 and 4 and 2 to 4 are never compared, and a joined at least 2 and at most 4 keeps only its ceiling; write a range as two rules, one per edge, and both edits are refused.
A range is the most natural way to write a reply length. The brand guide says two to four sentences, the prompt says 2-4 sentences, and the model reads it without trouble. This run measures what the checker does with a range, which matters the day somebody adds a rule that wants a reply shorter than the floor or longer than the ceiling.
§1The baseline
A chat assistant for a mobile network's billing desk: an account lookup, a security-question limit, a hardship hand-off, and one range. The digital team wants every reply between two and four sentences: one sentence reads as curt, five reads as an essay in a chat bubble. The prompt writes it the way the brand guide does.
$TOOL find_account - description:: Find a customer account by its account number. - input:: - account_number:: string: the account number. # Role @@ role: one chat assistant for a mobile network's billing desk You are Ash, the billing assistant for Pellow Mobile. # Constraints @@ lookup: never answer about a bill from memory - WHEN the customer gives an account number THEN MUST call @[find_account]. @@ length: one sentence reads as curt, five reads as an essay in a chat bubble - MUST keep every reply to 2-4 sentences. @@ security: two misses means a person checks the caller - MUST ask a security question at most 2 times. @@ hardship: payment difficulty goes to the specialist team - WHEN the customer says they cannot pay their bill THEN MUST escalate to a hardship specialist.
$ npx typeglish check dash.tg ✓ 1 file — 0 error, 0 warning, 0 info $ npx typeglish score dash.tg dash.tg — A (99/100) proven errors: none tiers: base+z3 planes runtime 99 (what the model reads) · hygiene 100 (source only) facets enforceability 100 x.21 · hardness 100 x.12 · directness 91 x.08 · consistency 100 x.17 · structure 100 x.12 (hygiene) · annotation 100 x.12 (hygiene) · style 100 x.08 · security 100 x.08 rules 4 of 4 rule-shaped lines read $ npx typeglish build dash.tg ✓ built .typeglish/dist/dash.txt ← dash.tg (79c76bed9613, full)
§2Nine ways to write two to four
Each variant is dash.tg with the range respelled and nothing else changed. The spellings are the ones that turn up in real prompts: the hyphen (2-4 sentences), the two prepositions (2 to 4, from 2 to 4), between 2 and 4 with and without a second unit, words from a style guide (two to four), a list (2, 3 or 4), the two bounds joined in one rule (at least 2 sentences and at most 4 sentences), and the two bounds as two rules, each with its own @@ note.
Then each file gets an edit, one at a time. Both are the kind of line that lands months after the range. The service team wants short answers to short questions: WHEN the customer asks a yes-or-no question THEN MUST keep the reply to at most 1 sentence. That goes under the floor. The devices team wants the eSIM steps written out in chat: WHEN the customer asks how to set up their eSIM THEN MUST keep the reply to at least 6 sentences. That goes over the ceiling. Against a range the checker can read, each is a contradiction: on a yes-or-no question, every reply must be at least two sentences and at most one.
# range written as alone + yes-or-no edit (at most 1) + eSIM edit (at least 6) at least 2 sentences / at most 4 sentences A (99) logic/numeric F (83) logic/numeric F (82) (two rules) at least 2 sentences and at most 4 sentences A (99) passes A (95) logic/numeric F (78) 2-4 sentences A (99) passes A (95) passes A (95) from 2 to 4 sentences A (99) passes A (95) passes A (95) 2 to 4 sentences A (98) passes A (94) passes A (94) between 2 and 4 sentences A (98) passes A (94) passes A (94) between 2 sentences and 4 sentences A (98) passes A (94) passes A (94) two to four sentences A (98) passes A (94) passes A (94) 2, 3 or 4 sentences A (98) passes A (94) passes A (94)
check exits 0 with 0 error and 1 warning, prompt/count-alignment, which §4 reads. Alone, every spelling scores an A: the range the checker never compares costs at most a point against the one it does.Three patterns sit in that table. The first is the one from A maximum of 3 is not a maximum: the numeric layer compares a number that sits behind at least or at most and is followed by a unit word. A range has neither. 2-4 is one token with a hyphen in it, between and to are not bounds, and the list is three numbers with nothing in front of them.
The second is the joined rule. at least 2 sentences and at most 4 sentences has both bounds in the compared shape, and the ceiling was compared: the eSIM edit is refused. The floor was not. The yes-or-no edit went under it and passed. Swapping the order to at most 4 sentences and at least 2 sentences in a smaller test file gave the same split: ceiling compared, floor not. One rule, two edges, one of them checked.
$ npx typeglish check andf.tg andf.tg:14:1 warn prompt/count-alignment Count alignment — "sentence" carries two different count rules (line 20): one names a unit, one does not. Two spellings of one limit read as drift — state ONE bound with ONE unit. ↳ line 20: - WHEN the customer asks a yes-or-no question THEN MUST keep the reply to at most 1 sentence. ✓ 1 file — 0 error, 1 warning, 0 info $ npx typeglish check andc.tg andc.tg:14:1 error logic/numeric Conflicts with line 20. Numeric conflict — "at most 4 sentences" and "at least 6 sentences" can't both hold. ↳ line 20: - WHEN the customer asks how to set up their eSIM THEN MUST keep the reply to at least 6 sentences. andc.tg:14:1 warn prompt/count-alignment Count alignment — "sentence" carries two different count rules (line 20): one names a unit, one does not. Two spellings of one limit read as drift — state ONE bound with ONE unit. ↳ line 20: - WHEN the customer asks how to set up their eSIM THEN MUST keep the reply to at least 6 sentences. andc.tg:20:1 error logic/numeric Conflicts with line 14. Numeric conflict — "at most 4 sentences" and "at least 6 sentences" can't both hold. ↳ line 14: - MUST keep every reply to at least 2 sentences and at most 4 sentences. ✗ 1 file — 2 error, 1 warning, 0 info
The third is the two-rule version, which is the only row where both edits are refused. That is the lesson of Or is two rules moved to numbers: a range is two constraints, a floor and a ceiling, and each one is checked when it has a line of its own.
$ npx typeglish check splitf.tg splitf.tg:14:1 error logic/numeric Conflicts with line 22. Numeric conflict — "at least 2 sentences" and "at most 1 sentence" can't both hold. ↳ line 22: - WHEN the customer asks a yes-or-no question THEN MUST keep the reply to at most 1 sentence. splitf.tg:22:1 error logic/numeric Conflicts with line 14. Numeric conflict — "at least 2 sentences" and "at most 1 sentence" can't both hold. ↳ line 14: - MUST keep every reply to at least 2 sentences. ✗ 1 file — 2 error, 0 warning, 0 info $ npx typeglish check splitc.tg splitc.tg:16:1 error logic/numeric Conflicts with line 22. Numeric conflict — "at most 4 sentences" and "at least 6 sentences" can't both hold. ↳ line 22: - WHEN the customer asks how to set up their eSIM THEN MUST keep the reply to at least 6 sentences. splitc.tg:22:1 error logic/numeric Conflicts with line 16. Numeric conflict — "at most 4 sentences" and "at least 6 sentences" can't both hold. ↳ line 16: - MUST keep every reply to at most 4 sentences. ✗ 1 file — 2 error, 0 warning, 0 info
§3The edit that shipped
Here is how it ships. The range went in as 2-4 sentences, copied from the brand guide. Months later the devices team adds its eSIM line with its own note, and the check is green.
$ diff dash.tg dashc.tg 18a19,20 > @@ esim: setting up an eSIM takes every step written out > - WHEN the customer asks how to set up their eSIM THEN MUST keep the reply to at least 6 sentences. $ npx typeglish check dashc.tg dashc.tg:14:1 warn prompt/count-alignment Count alignment — "sentence" carries two different count rules (line 20): one names a unit, one does not. Two spellings of one limit read as drift — state ONE bound with ONE unit. ↳ line 20: - WHEN the customer asks how to set up their eSIM THEN MUST keep the reply to at least 6 sentences. ✓ 1 file — 0 error, 1 warning, 0 info $ npx typeglish build dashc.tg ✓ built .typeglish/dist/dashc.txt ← dashc.tg (c61a5df8216f, full) $ grep -n "sentence" .typeglish/dist/dashc.txt 6:- MUST keep every reply to 2-4 sentences. 9:- WHEN the customer asks how to set up their eSIM THEN MUST keep the reply to at least 6 sentences.
Stripped to the rules, the effect fits in the playground. Same edit, same agent, the range written once and then written as two rules.
# Role You are Ash, the billing assistant for Pellow Mobile. # Constraints - MUST keep every reply to 2-4 sentences. - WHEN the customer asks how to set up their eSIM THEN MUST keep the reply to at least 6 sentences.
# Role You are Ash, the billing assistant for Pellow Mobile. # Constraints - MUST keep every reply to at least 2 sentences. - MUST keep every reply to at most 4 sentences. - WHEN the customer asks how to set up their eSIM THEN MUST keep the reply to at least 6 sentences.
prompt/count-alignment warning; its C is the missing @@ notes and the warning, not a conflict. The second is refused at F (70/100).§4What the other signals said
The range does leave a trace, and it is worth knowing what it says. Every edit that crossed an uncompared range raised prompt/count-alignment, a warning. Its message reads the range as a count rule with no unit and asks for ONE bound with ONE unit. That is good advice, but it is a warning: check exits 0 and build writes the artifact. In typeglish review it is the one fix listed, worth four points.
$ npx typeglish review dashc.tg
dashc.tg — A (95/100) → A (99) projected if every fix below lands check: 0 error, 1 warning, 0 info tiers: base+z3
FIXES ranked by projected gain
+4 fix the 1 prompt/count-alignment finding (L14) — One counted thing, two count spellings (a unitless bound beside a per-unit one, or a count inside an either/or) — sta…
RULES 5 of 5 rule-shaped lines read
FINDINGS
dashc.tg:14:1 warn prompt/count-alignment Count alignment — "sentence" carries two different count rules (line 20): one names a unit, one does not. Two spellings of one limit read as drift — state ONE bound with ONE unit.
↳ line 20: - WHEN the customer asks how to set up their eSIM THEN MUST keep the reply to at least 6 sentences.
TESTS no $TEST cases — add one beside a rule; `test --dry` validates it offline
The score's rules table is the second trace, and only for one spelling. between 2 and 4 is read as two objects joined by and, marked unprovable, and the table prints the fix in so many words:
$ npx typeglish score between.tg
between.tg — A (98/100) proven errors: none tiers: base+z3
planes runtime 97 (what the model reads) · hygiene 100 (source only)
facets enforceability 93 x.21 · hardness 100 x.12 · directness 91 x.08 · consistency 100 x.17 · structure 100 x.12 (hygiene) · annotation 100 x.12 (hygiene) · style 100 x.08 · security 100 x.08
lever enforceability 93/100 (up to +1 overall) — 1 hard rule it cannot prove (L14): one action, one object, a catalog verb or a bound. The rules table below has the edit per line
rules 4 of 4 rule-shaped lines read · 1 not provable
L14 ~ unprovable MUST keep every reply between 2 and 4 sentences.
the checker knows "keep" but cannot prove this shape: two objects or actions joined by "and" — it proves one at a time → one object per line: split into two rules
2-4, from 2 to 4 and the joined rule score enforceability 100: read, counted as provable, and, in the case of the hyphen, never compared.A range has two edges. Give each one its own line, or neither gets checked.
§5Two rules, one per edge, then test them
The fix is a house style and a decision. The style: a range is two rules, at least on one line and at most on the next, each with its own @@ note saying why that edge exists. The audit becomes a search for a hyphen between digits, between, or to after a number in any rule.
The decision is the one the refusals force, and splitting the range makes it easy because each edit now collides with one named edge. The yes-or-no team was right: a one-sentence answer to is my direct debit active is not curt. So the floor gets an UNLESS for that case, and the check accepts the scoped floor beside the yes-or-no ceiling with nothing flagged. The devices team was right that eSIM setup needs every step and wrong about where they go: six sentences in a chat bubble is the essay the ceiling exists to stop. The steps move into a guide the agent sends with a tool, and the ceiling stays. Two tests pin both edges to real replies.
$TOOL find_account - description:: Find a customer account by its account number. - input:: - account_number:: string: the account number. $TOOL send_esim_guide - description:: Send the customer the step-by-step eSIM setup guide for their phone. - input:: - account_number:: string: the account number. # Role @@ role: one chat assistant for a mobile network's billing desk You are Ash, the billing assistant for Pellow Mobile. # Constraints @@ lookup: never answer about a bill from memory - WHEN the customer gives an account number THEN MUST call @[find_account]. @@ length-ceiling: five sentences reads as an essay in a chat bubble - MUST keep every reply to at most 4 sentences. @@ length-floor: one sentence reads as curt, except as the answer to a yes-or-no question - UNLESS the customer asks a yes-or-no question THEN MUST keep the reply to at least 2 sentences. @@ yesno: a yes-or-no question gets a one-sentence answer - WHEN the customer asks a yes-or-no question THEN MUST keep the reply to at most 1 sentence. @@ esim: the setup steps live in the guide, not in a long reply - WHEN the customer asks how to set up their eSIM THEN MUST call @[send_esim_guide]. @@ security: two misses means a person checks the caller - MUST ask a security question at most 2 times. @@ hardship: payment difficulty goes to the specialist team - WHEN the customer says they cannot pay their bill THEN MUST escalate to a hardship specialist. $TEST esim_setup_reply - input:: How do I set up the eSIM on my new phone? The QR code in the email won't scan. - expect:: - matches /^(?!(?:[^.!?]*[.!?]+){5})/ - keeps every reply to at most 4 sentences - calls send_esim_guide $TEST yes_no_reply - input:: Is my direct debit still active? - expect:: - matches /^(?!(?:[^.!?]*[.!?]+){2})/ - keeps the reply to at most 1 sentence
$ npx typeglish check fixed.tg ✓ 1 file — 0 error, 0 warning, 0 info $ npx typeglish score fixed.tg fixed.tg — A (99/100) proven errors: none tiers: base+z3 planes runtime 99 (what the model reads) · hygiene 100 (source only) facets enforceability 100 x.21 · hardness 100 x.12 · directness 89 x.08 · consistency 100 x.17 · structure 100 x.12 (hygiene) · annotation 100 x.12 (hygiene) · style 100 x.08 · security 100 x.08 rules 7 of 7 rule-shaped lines read · 5/7 covered by $TEST $ npx typeglish test fixed.tg --dry ✓ fixed.tg coverage: 5/7 rules exercised uncovered (no case shares the rule's wording): L27 ask a security question at most 2 times. L29 escalate to a hardship specialist. · esim_setup_reply — "How do I set up the eSIM on my new phone? The QR code in the" (not run) ✓ matches /^(?!(?:[^.!?]*[.!?]+){5})/ · rubric — 2 prose expectations, judged on a live run (needs ANTHROPIC_API_KEY) · yes_no_reply — "Is my direct debit still active?" (not run) ✓ matches /^(?!(?:[^.!?]*[.!?]+){2})/ · rubric — 1 prose expectation, judged on a live run (needs ANTHROPIC_API_KEY) ✓ 1 prompt — 0 failed $ npx typeglish build fixed.tg ✓ built .typeglish/dist/fixed.txt ← fixed.tg (c792e96622f1, full)
And the payoff, which is the reason for the house style: the next edit that goes under the floor is refused before it ships, and the error names the edge it crossed.
$ npx typeglish check fixed-thanks.tg fixed-thanks.tg:21:1 error logic/numeric Conflicts with line 27. Numeric conflict — "at least 2 sentences" and "at most 1 sentence" can't both hold. ↳ line 27: - WHEN the customer says thank you THEN MUST keep the reply to at most 1 sentence. fixed-thanks.tg:27:1 error logic/numeric Conflicts with line 21. Numeric conflict — "at least 2 sentences" and "at most 1 sentence" can't both hold. ↳ line 21: - UNLESS the customer asks a yes-or-no question THEN MUST keep the reply to at least 2 sentences. ✗ 1 file — 2 error, 0 warning, 0 info
UNLESS on the floor, or drop the new rule. Either way the decision is made in the prompt, by a person, not in the chat by the model.§6Common questions
- How do I write a reply-length range in a system prompt?
- Write it as two rules: MUST keep every reply to at least 2 sentences, and MUST keep every reply to at most 4 sentences, each with a note saying why that edge exists. In this run that was the only spelling where an edit under the floor and an edit over the ceiling were both refused as logic/numeric.
- Does TypeGlish check 2-4 sentences or between 2 and 4 sentences?
- It reads them but does not compare them. In this run 2-4, 2 to 4, from 2 to 4, between 2 and 4, two to four, and 2, 3 or 4 sentences all let a contradicting edit through with only a prompt/count-alignment warning, and the build wrote the artifact.
- Why did my prompt pass the check when a new rule breaks my reply-length limit?
- Look at how the limit is written. A range with a hyphen, to, between or a list is never compared, and a single rule joining at least and at most kept only its ceiling in this run. Split the range into an at least rule and an at most rule and run the check again; the conflict should appear as logic/numeric.
- What does prompt/count-alignment mean on a range?
- It is a warning that one counted thing, here sentences, carries two count rules spelled differently. Beside a range it is the only sign that a later bound was not compared with it. It does not block the build, so treat it as a request to split the range into two rules.
Reply length is the range every CX prompt has, and it is rarely alone: hold-time promises, callback windows, credit bands, and the number of retries before a hand-off are all written as ranges in the documents prompts are built from. TypeGlish's numeric layer proves bounds with Z3 when each one is an at least or at most followed by a unit word, and in this run it compared bounds across rules with different guards. A range in one line gives it one edge at best. Two habits close the gap: write every range as two rules, so a search for a hyphen between digits is the audit, and give each edge a $TEST with a deterministic assert, so a live run fails when the reply crosses it. If the agent's replies are already running long, Why your agent writes an essay in a chat bubble is the place to start.