sloplint-judge 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/JUDGE.md +37 -14
- data/lib/sloplint/judge/cli.rb +16 -8
- data/lib/sloplint/judge/engine.rb +6 -3
- data/lib/sloplint/judge/rules.rb +204 -22
- data/lib/sloplint/judge/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8d0f2ca219849b87d6bf196a574de47ecfd12954b4930d66ec58b5204283f6fe
|
|
4
|
+
data.tar.gz: 33f01aa98179abb5d16329e2731c52f55d20e00009e5c02749717f98398e4eea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 928d962a370cc1b47091b2cb9a0b8f2ec654cb2f07e9866a87c96f29147ed50d0b38d898f4196fce1689809554f32d3696de80c4826c73a6f071b752a5fb814e
|
|
7
|
+
data.tar.gz: 9fd7bb807b0e0a956ba9e10a8d5708cb9399a4ac9110ee2bae08437370f7eb99d938a2fb9d9460114b7a3d16d7e13a5675e15ac0c271587dfcd94044af9aa03b
|
data/docs/JUDGE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# sloplint-judge
|
|
1
|
+
# sloplint-judge
|
|
2
2
|
|
|
3
3
|
A second gem in this repository, with sloplint's shape and a different kind of rule. sloplint's rules are regexes: offline, milliseconds, every note traceable to a pattern. sloplint-judge's rules are questions put to a System One model, one that answers typed questions about a piece of text with calibrated probabilities and never writes prose. A rule here is still data. What changes is that the "pattern" is a question the model can answer and a regex cannot: does this paragraph end on a summary, a moral or a hope, does this sentence tell the stated reader anything new, does it name a thing a reader could look up.
|
|
4
4
|
|
|
@@ -6,6 +6,17 @@ Everything else is sloplint's, used directly rather than copied: the note object
|
|
|
6
6
|
|
|
7
7
|
This document is the contract. Phase one is what the spike settled and what ships first. Phase two lists the open items with the test each one must pass before it is built.
|
|
8
8
|
|
|
9
|
+
## Installing it, and the key
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
gem install sloplint sloplint-judge # or both in a Gemfile's :development group
|
|
13
|
+
sloplint-judge key set # the keychain tool prompts for the key, echo off
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Ruby 3.3+ and sloplint 0.9 or later. Jev is in early access behind a waitlist: sign up at [typesafe.ai](https://typesafe.ai) and issue a key at [console.typesafe.ai](https://console.typesafe.ai/settings/keys) once you are through. `TYPESAFE_API_KEY` in the environment takes precedence over the keychain item; `sloplint-judge status` says which one was found, without reading it. "Where the key lives" below has what the keychain protects and what it does not, and "Backend adapter" has the rest of the environment.
|
|
17
|
+
|
|
18
|
+
Then either `sloplint check --judge FILE`, which merges the two catalogs into one set of notes, or `sloplint-judge check FILE` for these rules alone. The README covers the first; the CLI surface below covers the second.
|
|
19
|
+
|
|
9
20
|
## What it is and is not
|
|
10
21
|
|
|
11
22
|
sloplint-judge is not a detector. The spike asked the model whether a careful editor would suspect a language model wrote a sentence, and the answer was wrong in the same direction every time: edited human prose scored as the most machine-written set and current model prose as the least. Detection stays with sloplint, which separates the same sets tenfold with no network call. No rule in this catalog asks who wrote the text.
|
|
@@ -29,11 +40,13 @@ The bar has two halves, and they do different jobs. A rule ships when a reader s
|
|
|
29
40
|
|
|
30
41
|
"Current model prose" means the models people are drafting with now, not the models a public corpus happened to sample. The next section says why that distinction cost us a section.
|
|
31
42
|
|
|
32
|
-
## Calibration corpus: RAID, plus current models on
|
|
43
|
+
## Calibration corpus: RAID and HAP-E, plus current models on their own titles
|
|
33
44
|
|
|
34
45
|
RAID is the standing corpus for both linters: eight domains of human prose written before language models, each title paired with model generations, fetched on demand and never committed. Its one gap is that the model side is GPT-4, llama-chat and mistral-chat, all sampled in 2023, and the rules are meant for the prose models write today. `script/calibrate generate MODEL` closes that gap in place: every RAID row carries the prompt its generation was written to, and the script writes a generation from a current model for each sampled prompt into `.corpus/raid/generated/MODEL/`, same domains, same titles, so the human pairing holds. The models are whatever is current when the script runs, named in the commit message that reports the numbers. Nothing generated is committed. `script/calibrate run` scores the first two paragraphs of three or more sentences in each text and their sentences, so a sentence tell that lives in one- and two-sentence paragraphs, which model news is mostly made of, is under-counted there; `check` sends those paragraphs to the sentence rules, and a rule whose numbers came from a scan of every sentence says so in its entry.
|
|
35
46
|
|
|
36
|
-
|
|
47
|
+
RAID has no opinion or essay writing, which is where the device and negation tics in this catalog live, so the `blogs` register reads from a second corpus instead: HAP-E, the Human-AI Parallel English Corpus (`browndw/human-ai-parallel-corpus` on Hugging Face, MIT). `script/calibrate fetch-hape` downloads it and writes `.corpus/hape/blogs.jsonl` and `.corpus/hape/blogs-chunk1.jsonl`, never committed. Each blog post is split into two chunks; every model side continues chunk 1 with the prompt "In the same style, tone, and diction of the following text, complete the next 500 words, generate exactly 500 words, and note that the text does not necessarily end after the generated words:" followed by the chunk, and the pairing `run` scores is that continuation against the human writer's own chunk 2, the same title continued twice. `script/calibrate generate MODEL --register blogs` writes a current model's continuation the same way, from chunk 1, into `.corpus/raid/generated/MODEL/blogs.jsonl` alongside the RAID-generated sides, so `run` and the gate treat it like any other register.
|
|
48
|
+
|
|
49
|
+
That is the whole calibration corpus. Earlier readings against Hacker News comments and IETF RFCs are retired: comments are not a register the tool is for, and RFCs paired against generated design documents were two genres, not a pair. The engineering register stays what it is for sloplint's regex rules, a reading discipline (CLAUDE.md), not a calibration gate. RAID and HAP-E are the floor for false positives; the generated side is the evidence about current models.
|
|
37
50
|
|
|
38
51
|
## Packaging: two gems, one repository, one plugin
|
|
39
52
|
|
|
@@ -65,7 +78,7 @@ The other `check` options apply to both linters, and each one costs something in
|
|
|
65
78
|
|
|
66
79
|
- `--markdown` blanks twice, once inside `Engine.scan` as today and once in the judge, because the engine keeps the raw source for each note's `context` window and a pre-blanked text would put runs of spaces where the code and URLs were.
|
|
67
80
|
- `--select` and `--ignore` take ids and categories from either catalog. Unknown-reference checking runs against the union of the two catalogs when `--judge` is set, and each linter is then handed only its own rules. This means the judge `Rule` answers `confidence` like sloplint's does; the rule model below says how.
|
|
68
|
-
- `--strict` runs the low-confidence rules of both catalogs, the judge's `same-weight`, `stated-stakes` and `
|
|
81
|
+
- `--strict` runs the low-confidence rules of both catalogs, the judge's `same-weight`, `stated-stakes`, `matched-shape`, `mirrored-opposites`, `positive-form`, `name-the-thing` and `dressed-pair` among them, runs the judge's sentence rules on every sentence, and keeps the judge's low-confidence notes, which are places to look, not findings.
|
|
69
82
|
|
|
70
83
|
That is a small change to how `cli.rb` validates and partitions rules and none to `engine.rb`. The regex engine never sees a judge rule.
|
|
71
84
|
|
|
@@ -82,14 +95,18 @@ commands:
|
|
|
82
95
|
global options:
|
|
83
96
|
-o, --output-format full | json (default: full)
|
|
84
97
|
--backend NAME which adapter to use (default: from SLOPLINT_JUDGE_BACKEND, else jev)
|
|
85
|
-
--register TEXT who the
|
|
98
|
+
--register TEXT who reads the document; every question is asked on that reader's behalf
|
|
99
|
+
(default: "the reader this document is written for")
|
|
86
100
|
|
|
87
101
|
check options:
|
|
88
102
|
paths ... files to scan; "-" or no paths reads stdin
|
|
89
|
-
--markdown skip fenced/inline code spans, HTML comments, and URLs
|
|
103
|
+
--markdown skip fenced/inline code spans, HTML comments, and URLs; drop furniture that
|
|
104
|
+
needs a Markdown reading (front matter, indented code, a lone HTML or
|
|
105
|
+
code-span line). Headings, lists, tables, and quotes drop either way.
|
|
90
106
|
--select IDS only run these rules (comma-separated ids or categories)
|
|
91
107
|
--ignore IDS skip these rules
|
|
92
108
|
--strict run the off-by-default rules too, ask about every sentence, keep low-confidence notes
|
|
109
|
+
(places to look, not findings)
|
|
93
110
|
|
|
94
111
|
compare options:
|
|
95
112
|
--drift also ask whether B changes what A says (sentence rewrites)
|
|
@@ -183,7 +200,7 @@ RULES = [
|
|
|
183
200
|
|
|
184
201
|
`question` is the System One question, verbatim in the shape the adapter sends. `%{register}` is interpolated from `--register`. `flag` says which answer makes a note: `{ level: 0 }` for a score, which is the only question type a rule flags on today; a first noul rule adds `{ yes: true }` and the branch that reads it. There is no threshold on the probability itself, only on the most likely answer and the model's confidence, because a threshold is a number nobody can defend and the confidence gate already does the job. A tie between levels has no most likely answer and flags nothing.
|
|
185
202
|
|
|
186
|
-
`confidence` on the rule means what it means in sloplint, how likely a flag is a false positive, and it is a ceiling: a note's confidence is the lower of the rule's and the model's band for that answer. A rule at `medium` never produces a `high` note however sure the model is. A rule at `low` stays out of the default run, so `--select`, `--ignore` and `--strict` work on judge rules exactly as they do on sloplint's; `same-weight`, `stated-stakes` and `
|
|
203
|
+
`confidence` on the rule means what it means in sloplint, how likely a flag is a false positive, and it is a ceiling: a note's confidence is the lower of the rule's and the model's band for that answer. A rule at `medium` never produces a `high` note however sure the model is. A rule at `low` stays out of the default run, so `--select`, `--ignore` and `--strict` work on judge rules exactly as they do on sloplint's; `same-weight`, `stated-stakes`, `matched-shape`, `mirrored-opposites`, `positive-form`, `name-the-thing` and `dressed-pair` sit there.
|
|
187
204
|
|
|
188
205
|
The engine never grows a branch for a rule. If a rule needs logic, the question is wrong, not the engine. That is sloplint's rule and it holds harder here: a question the model cannot answer from the text in front of it is a question that should not be asked.
|
|
189
206
|
|
|
@@ -195,7 +212,7 @@ Fixtures are synthetic, as in sloplint. No sentence read during calibration is p
|
|
|
195
212
|
|
|
196
213
|
## Rule catalog (v1)
|
|
197
214
|
|
|
198
|
-
|
|
215
|
+
Twenty rules, two categories. A number appears only where it decides something a reader can see in the rule: its severity, its confidence ceiling, or a caveat. It is the probability that a model unit scores higher than a human one in the same register; below 0.5 means the rule ranks model prose lower, which is what a rule is for. The full runs, with corpus sizes and the models on each side, are in the commit that added or last changed the rule.
|
|
199
216
|
|
|
200
217
|
### paragraph
|
|
201
218
|
|
|
@@ -210,16 +227,22 @@ Run on every paragraph of three or more sentences. One request per paragraph car
|
|
|
210
227
|
|
|
211
228
|
### sentence
|
|
212
229
|
|
|
213
|
-
Run on every sentence of the paragraphs a paragraph rule flagged, and on the sentences of the short paragraphs no paragraph rule looked at, so the expensive questions are asked where the cheap ones found something and no paragraph goes unexamined. Two details keep that shortcut honest. A paragraph is "flagged" only by a note that survives the confidence bands; a paragraph answer that fell to `low` and was dropped opens nothing. And when the run contains no paragraph rule at all, because `--select` named only sentence rules or `--ignore paragraph` removed them, the sentence rules run on every sentence, since there is nothing to triage by and a silent clean exit would be a lie. `--strict` runs them on every sentence regardless. One request per sentence carries every sentence question in the run,
|
|
230
|
+
Run on every sentence of the paragraphs a paragraph rule flagged, and on the sentences of the short paragraphs no paragraph rule looked at, so the expensive questions are asked where the cheap ones found something and no paragraph goes unexamined. Two details keep that shortcut honest. A paragraph is "flagged" only by a note that survives the confidence bands; a paragraph answer that fell to `low` and was dropped opens nothing. And when the run contains no paragraph rule at all, because `--select` named only sentence rules or `--ignore paragraph` removed them, the sentence rules run on every sentence, since there is nothing to triage by and a silent clean exit would be a lie. `--strict` runs them on every sentence regardless. One request per sentence carries every sentence question in the run, seven by default, with the sentence's paragraph and its index in the state so the model sees the neighbours.
|
|
214
231
|
|
|
215
|
-
- **stock-figure** (`warning`, `high`). The sentence uses a figure of speech that is stock, a figure that is the writer's own, or no figure. Flags at stock.
|
|
216
|
-
- **no-news** (`warning`, `high`). For the stated reader, the sentence explains what they already know, states what they could have guessed, or tells them something new. Flags at explains-known.
|
|
217
|
-
- **names-nothing** (`warning`, `high`). The sentence names nothing, names a kind of thing, or names a thing a reader could look up. Flags at names-nothing. This is the concreteness dimension from the spike, renamed to say what the flag means.
|
|
232
|
+
- **stock-figure** (`warning`, `high`). The sentence uses a figure of speech that is stock, a figure that is the writer's own, or no figure. Flags at stock. A command or identifier in code, one of a set of options, verdicts, statuses or modes the paragraph lists together, or a term defined in the same paragraph, the defining sentence included, is read as a name the writer chose, not a figure, and the rest of the sentence is still judged; a lone bold phrase the paragraph never sets up as a name still counts.
|
|
233
|
+
- **no-news** (`warning`, `high`). For the stated reader, the sentence explains what they already know, states what they could have guessed, or tells them something new. The explains-known level also catches a second-person sentence that reads the reader's own past actions or their own past words back to them: a fact they know because they did it or said it is not news, however specific it is. Flags at explains-known.
|
|
234
|
+
- **names-nothing** (`warning`, `high`). The sentence names nothing, names a kind of thing, or names a thing a reader could look up. It is judged with its paragraph: a short label that the next sentence spells out does not flag, and a sentence flags when nothing in its paragraph makes its own claim checkable, even if the paragraph names other things. Flags at names-nothing. This is the concreteness dimension from the spike, renamed to say what the flag means.
|
|
218
235
|
- **ends-on-verdict** (`info`, `high`). The sentence ends on a verdict or moral, trails off on a qualifier, or ends on the fact that carries it. Flags at verdict.
|
|
219
236
|
- **trailing-gloss** (`info`, `medium`). The sentence ends on a comma and an -ing clause that interprets the fact before it (highlighting, reflecting, underscoring), or it does not: no such clause, or one that adds a fact or a consequence. Two levels, so the score is the probability of the gloss and nothing else. Flags at the first. The regex catalog's `trailing-significance-participle` sees a short list of verbs; this is the reading of what the clause does. Ranks model prose lower in abstracts (0.32 against Claude Sonnet 5, 0.42 to 0.47 against 2023 models) and higher in news (0.60 to 0.73), where human sentences carry more trailing clauses of every kind and so a little more gloss probability across the bulk that never flags; the flags themselves run the other way, 4 human sentences in 30 articles against 18 for GPT-4 and 8 for Claude Sonnet 5. `info` because of that reversal, `medium` because the question has two parts.
|
|
220
|
-
- **unnamed-authority** (`info`, `medium`). Who the sentence attributes its claim to: an authority the reader could not find and that speaks for nobody in particular (experts, studies, research, critics, pundits, many, some, it is widely believed), or a named person, body, document or dataset, a source that speaks for a body and the register quotes by convention (officials, a spokesperson, the company, a court), prior work in an abstract, or the sentence's own voice. Two levels. Flags at the first. The regex catalog's `vague-attribution` sees three fixed frames; this is the reading of who is being cited. In news, at the confidence `check` reports, human sentences flag at 1 in 200 and model sentences at 4 to 5 in 100, most of them in the one- and two-sentence paragraphs model news is made of, which `script/calibrate` does not score; in abstracts neither side reaches 2 in 100, because prior work is let through. `info` because the human hits it does find ("it was widely believed", "as had been widely expected") are the convention at its loosest, not a fabrication.
|
|
237
|
+
- **unnamed-authority** (`info`, `medium`). Who the sentence attributes its claim to: an authority the reader could not find and that speaks for nobody in particular (experts, studies, research, critics, pundits, many, some, it is widely believed) or what is simply "known" with no source nearby, or a named person, body, document or dataset, a source that speaks for a body and the register quotes by convention (officials, a spokesperson, the company, a court), prior work in an abstract, a known fact the sentence or its paragraph cites a source for, or the sentence's own voice. Two levels. Flags at the first. The regex catalog's `vague-attribution` sees three fixed frames; this is the reading of who is being cited. In news, at the confidence `check` reports, human sentences flag at 1 in 200 and model sentences at 4 to 5 in 100, most of them in the one- and two-sentence paragraphs model news is made of, which `script/calibrate` does not score; in abstracts neither side reaches 2 in 100, because prior work is let through. `info` because the human hits it does find ("it was widely believed", "as had been widely expected") are the convention at its loosest, not a fabrication.
|
|
221
238
|
- **stated-stakes** (`info`, `low`). Whether a sentence that says something matters (crucial, vital, essential, key, matters) says why: it gives no fact, number or consequence, or it gives one, points to where it is, has it in the sentence right after, makes no importance claim (a rule, a requirement or a signpost is not one), or is quoted speech. Two levels. Flags at the first. Off by default: in news the model puts nearly every hit at low confidence, 4 in 100 GPT-4 sentences and 2 in 100 Claude Sonnet 5 sentences against 1 in 200 human under `--strict`, and one or two a side at the confidence `check` reports; and human abstracts state the stakes of their problem by convention, 4 in 243 against 4 in 163 for GPT-4 and none for Claude Sonnet 5. Read against 34,000 words of READMEs and design documents it made one hit, a fair one. `--select stated-stakes` or `--strict` runs it. It sits on the same sentence as `ends-on-verdict` about one time in ten.
|
|
222
239
|
- **matched-shape** (`info`, `low`). A matched pair or triple shaped the content, a list the content needed, or no matched structure. Flags at shaped-the-content. Off by default: near 0.5 against 2023 models and strong against current Claude models, so a tell of one model family, and read against real READMEs most hits were captions and parallels the writer built on purpose. `--select matched-shape` or `--strict` runs it.
|
|
240
|
+
- **mirrored-opposites** (`info`, `low`). Two different claims joined by opposite words so they read as a contrast (everywhere and nowhere, always and never, every and none), or opposites that compare one thing across two cases, or no opposites. Two levels. Flags at the first. The narrow case of `matched-shape`. The flag is rare everywhere it was tested, against a current-model side: in news, 3 of 3,959 human sentences against 1 of 2,283 pooled across four model sides; in abstracts, 0 of 1,683 human against 0 of 4,951 model, on every side; both reverse or sit flat. In the HAP-E blogs register, where the essay and advice-writing tic this rule is meant for actually lives, it separates: 1 of 5,921 human sentences against 2 to 3 per roughly 2,500-to-6,000-sentence model side (GPT-4o, Llama 3 70B, Claude Sonnet 5). `info` because of the reversal in news and abstracts. Off by default because under `--strict` it reads a plain "X, but not Y" as a pair of opposites: 6 low-confidence hits in 55,000 words of gem READMEs, none fair, and none at the confidence `check` reports. `--select mirrored-opposites` or `--strict` runs it.
|
|
241
|
+
- **positive-form** (`info`, `low`). Whether the sentence makes its claim by saying what is or by saying what is not: the claim rests on a negative (a denial, a correction with not, rather than or instead of, nothing or nobody as subject or object, a verb that performs an absence such as publishes no or records nothing, a denial set up for the next sentence, an instruction not to do something), or the claim is positive, or its negative sits outside the claim (a condition, a bound, a fixed name, a standard's MUST NOT, quoted speech, or an assumption or decision that says so and names the option it rules out, a design choice that gives the reason the option it rules out would fail, or an instruction that sends the reader to another command or option for a case it names), or the absence is stated as a property of the thing (has no, without), or an expected behavior is denied on its own (does not retry), or a courtesy line releases the reader (no need to reply). Two levels. Flags at the first. Strunk and White's rule 15. The regex catalog's `not-x-but-y`, `isnt-x-its-y` and `not-nothing` see a few frames of this; this is the reading of where the negative sits. `info` because in news and abstracts human prose denies more often than model prose: at the confidence `check` reports, 20 of 584 human news sentences flagged against 0 to 4 per 100 on the model sides (2 of 67 for Claude Sonnet 5), and 12 of 243 human abstract sentences against 1 of 163 for GPT-4 and 6 of 240 for Claude Sonnet 5. Blogs is the one register where Claude Sonnet 5 denies more: 73 of 483 sentences against 106 of 964 human, 50 of 959 for GPT-4o and 90 of 966 for Llama 3 70B. The rank statistic sits at 0.42 to 0.60. Off by default because reference documentation states its limits as negatives: in 48,000 words of gem READMEs, measured before instructions that send the reader to another option and reasoned design choices passed, it flagged 47 sentences and 18 of them were fair, and most of the rest were a limit the reader needs (not supported, not encrypted, cannot be used with). It also flags an absence whose scope is named precisely enough to check ("Nobody on the team has reviewed the migration yet"), which a careful writer may fairly keep, and that is another reason it is off by default. `--select positive-form` or `--strict` runs it.
|
|
242
|
+
- **name-the-thing** (`info`, `low`). Whether the sentence calls things by their names or makes the reader map a pointer back to one: a position (the former, the latter, the second one, the last of three, the fourth item), even when the list was named a clause earlier; a stand-in noun or figure for a named thing (the engine for a named service, the seat for a named role); an allusion to a divide it never names ("where you stood when the old scheduler went away"); or a self-reference such as "this entire writeup" standing for a point it never states. A position that is the thing's own name (step 4, the second retry, Q3, the first argument), a which-clause about named things, and a pronoun pointing at something just named all pass. Two levels. Flags at the first. `the-x-is-not-the-x` is the repeated-noun case; this is the general one. `info` because it reverses in news: human sentences flag at 17 in 584, model sentences at 0 to 2 per side of about 100, and the human hits are the sports desk's epithet for a player named a sentence earlier ("the striker", "the Leeds-born sprinter"), which the rule is right to flag and which news does by convention. In abstracts 1 human and 0 to 1 model sentences flag. Off by default because in 31,000 words of gem READMEs it made 5 hits at the confidence `check` reports and 24 under `--strict`, and none of them was fair: an argument or a request whose position is its name, and a "this" or "these" pointing at the code beside it. `--select name-the-thing` or `--strict` runs it.
|
|
243
|
+
- **maxim** (`info`, `medium`). Whether `target` is a saying, a general rule about how things always go stated in a turned phrase that could stand alone, or a fact about this system, team or event, how a particular tool, protocol or piece of code behaves, or a step, a requirement or a decision. Two levels. Flags at the first. `info` because the rule reverses in abstracts against 2023 models (rank statistic 0.52 to 0.58; it holds at 0.48 against Claude Sonnet 5 there), while it holds in news (0.37 to 0.50) and blogs (0.39 to 0.46). At the confidence `check` reports: news, human 0 of 584 against 0 to 5 per model side; abstracts, human 0 of 243 against 0 on every model side; blogs, where a saying is part of the register's own voice, human 37 of 964 against 13 to 43 per model side. Read against 30,600 words of gem READMEs, 0 hits. `medium` because the question turns on the sentence's shape, not a fixed list of words, and a plain general statement of fact ("adding a volatile-default column rewrites the table") has to be told apart from an aphorism built the same short, declarative way.
|
|
244
|
+
- **dressed-pair** (`info`, `low`). Whether the sentence says one fact as if it were two: a second clause that gives a second subject the first clause's verb and adds little beyond a tie back (X deploys and Y deploys with it), or a "both" or "those two things" summing up a pair set out earlier and handing the sum a verdict (is the real work, is the whole point). A pair whose halves carry different facts, a choice between two named options, a plain "both", and a pairing of groups with roles the paragraph defined all pass. Two levels. Flags at the first. `matched-shape` is any pair built to a rhythm and `name-the-thing` a pair pointed at by position or figure; this is the pair restated instead of named. `info` because no current model is caught doing it: at the confidence `check` reports, Claude Sonnet 5 flags 0 sentences in news, abstracts or blogs, against 5 of 964 human blog sentences, 12 of 959 for GPT-4o and 3 of 966 for Llama 3; news and abstracts flag at most 1 sentence a side. Read on a second draw, 2 of the 6 human blog hits are the device, a verb carried over to a second subject, and the rest are a pair of some other kind. Off by default because in 35,000 words of gem READMEs it made 2 hits at the confidence `check` reports and 13 under `--strict`, and none of them was this device. `--select dressed-pair` or `--strict` runs it.
|
|
245
|
+
- **device-before-claim** (`info`, `medium`). Whether the sentence makes its claim through a mirror, a riddle, a held-back answer, a coined figure or a maxim, or states it plainly. Two levels. Flags at the device. Ranks model prose lower in blogs against every side (0.34 to 0.43) and against the current model in news (0.39) and abstracts (0.44), but reverses against the 2023 models in news (0.51, 0.51) and abstracts (0.54 to 0.58). `info` because of that reversal. Flag counts at the confidence `check` reports: news, 37 of 584 human sentences against 8 to 26 of 67 to 133 model sentences; abstracts, 17 of 243 human against 8 to 37 of 155 to 240 model sentences; blogs, 104 of 964 human against 110 to 329 of 483 to 966 model sentences.
|
|
223
246
|
|
|
224
247
|
Each sentence rule reports on its own. There is no combined score and no threshold that combines them.
|
|
225
248
|
|
|
@@ -237,7 +260,7 @@ Tested, not shipped, kept here so nobody tests them again without new evidence.
|
|
|
237
260
|
|
|
238
261
|
## Splitting
|
|
239
262
|
|
|
240
|
-
Paragraphs are separated by sloplint's `PARA_BREAK
|
|
263
|
+
Paragraphs are separated by sloplint's `PARA_BREAK`. The judge drops headings, list items, table rows, block quotes, horizontal rules and reference lines whether or not `--markdown` is set, because a heading is not a paragraph and a bullet is not a sentence, and their line shape says so on its own. A heading written the setext way -- a title line followed by a line of nothing but `=` or two or more `-` -- drops both of its lines; only the underline is a horizontal rule when the line above it is blank, since a title has to sit right above its underline with nothing between them. A numbered line is a list item only where CommonMark says so: after a blank line or another piece of furniture, or when it starts at 1. A hard-wrapped prose line that happens to begin with a year stays prose. `--markdown` additionally uses sloplint's blanker, with one change: fenced code and HTML comments become spaces before splitting, as in the regex engine, but an inline code span or a URL becomes a run of one private-use character (U+E000) per character, so it keeps its length and cannot be mistaken for prose, because it is a word in its sentence. Blanked to spaces, a paragraph that opened with a code span lost its head and a sentence boundary followed by one merged two sentences; the placeholder keeps both, and a line that is only code or a bare link counts as furniture, but only under `--markdown` -- without it there is no placeholder to read, so that line is prose like any other. `--markdown` is also what turns YAML front matter, an indented code block and a lone HTML tag line into furniture; a document read without it keeps all three. Sentences are split on terminal punctuation followed by a space and a capital or an opening quote, with a short list of abbreviations that do not end a sentence, and a run of letters written one at a time (U.S., e.g.) does not end one either; a sentence that really ends on such a run merges with the next, and a lone capital before the period (Service A. Service B) still splits. This is the splitter the spike used, with one addition: every paragraph and sentence it returns carries its offset into the original text, so a note can be placed on the file as written after the furniture is gone. It lands in the core gem as `Sloplint::Split`, a public module the regex engine does not call, because the reader-test skill needs the same splitter and two consumers make it core's to own. A paragraph with fewer than three sentences is skipped by the paragraph rules and goes straight to the sentence rules, so a README written in two-sentence paragraphs is still examined. Splitting runs on the blanked copy, and every paragraph and sentence carries two strings cut at the same offsets: `text`, the span as the file has it, which is what a note quotes, so an excerpt is always a string that is in the file; and `asked`, the span with the furniture blanked, and, under `--markdown`, the HTML comments and fenced code blanked too, which is what the model is shown. Code spans and URLs stay in `asked`. Furniture is blanked line by line, so a list bound tight to the paragraph above it takes only its own lines out.
|
|
241
264
|
|
|
242
265
|
## Backend adapter
|
|
243
266
|
|
data/lib/sloplint/judge/cli.rb
CHANGED
|
@@ -52,13 +52,17 @@ module Sloplint
|
|
|
52
52
|
OptionParser.new do |o|
|
|
53
53
|
o.banner = "usage: sloplint-judge check [options] [paths...] (\"-\" or no paths = stdin)"
|
|
54
54
|
o.on("-o", "--output-format FORMAT", %w[full json], "Output format: 'full' or 'json' (default: full).") { |v| opts[:format] = v }
|
|
55
|
-
o.on("--markdown", "Skip fenced/inline code spans, HTML comments
|
|
55
|
+
o.on("--markdown", "Skip fenced/inline code spans, HTML comments and URLs, and drop the",
|
|
56
|
+
"furniture that needs a Markdown reading: front matter, an indented",
|
|
57
|
+
"code block, a lone HTML or code-span line. Headings, lists, tables",
|
|
58
|
+
"and quotes drop either way.") { markdown = true }
|
|
56
59
|
o.on("--select IDS", "Only run these rules (comma-separated rule ids or categories).") { |v| select = v.split(",").map(&:strip) }
|
|
57
60
|
o.on("--ignore IDS", "Skip these rules (comma-separated rule ids or categories).") { |v| ignore = v.split(",").map(&:strip) }
|
|
58
61
|
o.on("--strict", "Run the rules that are off by default, ask the sentence rules about",
|
|
59
62
|
"every sentence, and keep low-confidence notes; about three times the",
|
|
60
|
-
"requests of a default run.
|
|
61
|
-
|
|
63
|
+
"requests of a default run. Low-confidence notes are places to look,",
|
|
64
|
+
"not findings.") { strict = true }
|
|
65
|
+
o.on("--register TEXT", "Who reads the document (default: #{Engine::DEFAULT_REGISTER}).") { |v| opts[:register] = v }
|
|
62
66
|
o.on("--backend NAME", "Which adapter to use.") { |v| opts[:backend] = v }
|
|
63
67
|
# OptionParser answers -h itself when nobody else does, and it
|
|
64
68
|
# answers it on the real stdout and ends the process. This command
|
|
@@ -118,7 +122,7 @@ module Sloplint
|
|
|
118
122
|
return 2
|
|
119
123
|
end
|
|
120
124
|
|
|
121
|
-
Sloplint::CLI.emit(result.notes, opts[:format], out:, by_path: sources.count { |label, _| label != "-" } > 1, judge: result.usage)
|
|
125
|
+
Sloplint::CLI.emit(result.notes, opts[:format], out:, by_path: sources.count { |label, _| label != "-" } > 1, judge: result.usage, err:, strict:)
|
|
122
126
|
result.notes.empty? ? 0 : 1
|
|
123
127
|
end
|
|
124
128
|
|
|
@@ -129,7 +133,7 @@ module Sloplint
|
|
|
129
133
|
OptionParser.new do |o|
|
|
130
134
|
o.banner = "usage: sloplint-judge compare [--drift] A B (two files)"
|
|
131
135
|
o.on("--drift", "Also ask whether B changes what A says.") { drift = true }
|
|
132
|
-
o.on("--register TEXT", "Who the
|
|
136
|
+
o.on("--register TEXT", "Who reads the document (default: #{Engine::DEFAULT_REGISTER}).") { |v| opts[:register] = v }
|
|
133
137
|
o.on("--backend NAME", "Which adapter to use.") { |v| opts[:backend] = v }
|
|
134
138
|
o.on("-h", "--help", "Show this help.") { out.puts(o.help); help = true }
|
|
135
139
|
# permute!, so `compare A B --drift` sees the flag. There is no nested
|
|
@@ -240,7 +244,7 @@ module Sloplint
|
|
|
240
244
|
|
|
241
245
|
#{rule.message}
|
|
242
246
|
|
|
243
|
-
Asks: #{format(rule.question["instructions"], register:
|
|
247
|
+
Asks: #{format(rule.question["instructions"], register: "the reader")}
|
|
244
248
|
#{levels.join("\n")}
|
|
245
249
|
|
|
246
250
|
Why: #{rule.rationale}
|
|
@@ -260,7 +264,9 @@ module Sloplint
|
|
|
260
264
|
# Recommended for agents (both linters, one document). The judge sends the text to
|
|
261
265
|
# api.typesafe.ai, so ask the person before running it. Check first, ask, then run:
|
|
262
266
|
sloplint-judge status # exit 0 = a key is set up (reads no key), 2 = not
|
|
263
|
-
sloplint check --judge --markdown -o json FILE
|
|
267
|
+
sloplint check --judge --markdown -o json --register "READER" FILE
|
|
268
|
+
# READER names who the document is for. Every question is asked on that reader's behalf;
|
|
269
|
+
# without it the judge guesses the reader from the text.
|
|
264
270
|
# exit 0 = clean, 1 = notes found, 2 = usage error or not configured, 3 = the model could not be reached (nothing checked)
|
|
265
271
|
# output: {"notes": [...], "judge": {"backend","requests","input_tokens","output_tokens","cost_usd"}}
|
|
266
272
|
|
|
@@ -279,7 +285,9 @@ module Sloplint
|
|
|
279
285
|
global options:
|
|
280
286
|
BANNER
|
|
281
287
|
o.on("-o", "--output-format FORMAT", %w[full json]) { |v| opts[:format] = v }
|
|
282
|
-
o.on("--register TEXT", "Who the
|
|
288
|
+
o.on("--register TEXT", "Who reads the document; every question is asked on that reader's",
|
|
289
|
+
"behalf (default: #{Engine::DEFAULT_REGISTER}).",
|
|
290
|
+
"Name the reader when you know it.") { |v| opts[:register] = v }
|
|
283
291
|
o.on("--backend NAME", "Which adapter to use (default: $SLOPLINT_JUDGE_BACKEND or jev).") { |v| opts[:backend] = v }
|
|
284
292
|
o.on("-h", "--help", "Show this help, including the agent recipe above.") { out.puts(o.help); opts[:help_shown] = true }
|
|
285
293
|
o.on("-v", "--version", "Print the sloplint-judge version.") { out.puts(VERSION); opts[:version_shown] = true }
|
|
@@ -11,7 +11,7 @@ module Sloplint
|
|
|
11
11
|
# docs/JUDGE.md "Rule catalog" for the triage order and "Note" for how the
|
|
12
12
|
# confidence on each note is derived.
|
|
13
13
|
module Engine
|
|
14
|
-
DEFAULT_REGISTER =
|
|
14
|
+
DEFAULT_REGISTER = Sloplint::DEFAULT_REGISTER
|
|
15
15
|
RANK = { "high" => 0, "medium" => 1, "low" => 2 }.freeze
|
|
16
16
|
MIN_SENTENCES = 3
|
|
17
17
|
|
|
@@ -68,8 +68,11 @@ module Sloplint
|
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
# text: the source. rules: judge Rules to run. backend: answers `ask`.
|
|
71
|
-
# markdown: blank code, HTML comments and URLs, and drop furniture
|
|
72
|
-
#
|
|
71
|
+
# markdown: blank code, HTML comments and URLs, and drop the furniture
|
|
72
|
+
# that needs a Markdown reading (front matter, indented code, a lone
|
|
73
|
+
# HTML or code-span line). Headings, lists, tables and quotes drop
|
|
74
|
+
# either way. strict: run sentence rules on every sentence and keep
|
|
75
|
+
# low notes.
|
|
73
76
|
def scan(text, rules: RULES, backend: Backend.load, markdown: false, path: "-",
|
|
74
77
|
register: DEFAULT_REGISTER, strict: false,
|
|
75
78
|
concurrency: ENV.fetch("SLOPLINT_JUDGE_CONCURRENCY", "8").to_i)
|
data/lib/sloplint/judge/rules.rb
CHANGED
|
@@ -198,22 +198,22 @@ module Sloplint
|
|
|
198
198
|
id: "stock-figure", category: "sentence", unit: :sentence, severity: "warning", confidence: "high",
|
|
199
199
|
question: {
|
|
200
200
|
"type" => "score",
|
|
201
|
-
"instructions" => "Does `target` use figurative language, and if so, is the figure specific to this situation or a stock phrase?",
|
|
201
|
+
"instructions" => "Does `target` use figurative language, and if so, is the figure specific to this situation or a stock phrase? A word or phrase is a name the writer chose, not a figure, when `target` sets it in code as a command or identifier, when it is one of a set of options, verdicts, statuses or modes that the paragraph names or lists together, or when it is a term defined in this paragraph, the defining sentence included. Set aside only that span and judge every other word of the sentence as usual: a stock figure elsewhere in the sentence still counts. Bold used only for emphasis is not a name: a lone bold phrase the paragraph never sets up as a name is judged like plain prose.",
|
|
202
202
|
"criteria" => [
|
|
203
203
|
{ "what" => "Uses a stock figure or idiom anyone could use about anything: shouting into the void, double-edged sword, low-hanging fruit, moving the needle, a journey, a landscape, unlock, navigate.",
|
|
204
204
|
"examples" => ["The alert was shouting into an empty room.", "This unlocks a whole new landscape of possibilities."] },
|
|
205
205
|
{ "what" => "Uses a figure that could only have been made for this situation and that tells the reader something literal words would not.",
|
|
206
206
|
"examples" => ["The renewal script was a smoke detector with the battery pulled.", "The RFC hums rather than votes."] },
|
|
207
|
-
{ "what" => "Uses no figurative language
|
|
208
|
-
"examples" => ["The certificate expired at 09:14 and the load balancer rejected every handshake.", "Nobody read the channel."] }
|
|
207
|
+
{ "what" => "Uses no figurative language, or only names the writer chose (a status, an option, a command).",
|
|
208
|
+
"examples" => ["The certificate expired at 09:14 and the load balancer rejected every handshake.", "Nobody read the channel.", "Tickets move through **open**, **on ice** and **closed**."] }
|
|
209
209
|
]
|
|
210
210
|
},
|
|
211
211
|
flag: { level: 0 },
|
|
212
212
|
message: "Stock figure of speech.",
|
|
213
213
|
suggestion: "Say the literal thing, or make a figure that only fits this case.",
|
|
214
|
-
examples_bad: ["Migrating the auth service turned out to be a double-edged sword.", "We picked the low-hanging fruit first and moved the needle on latency."],
|
|
215
|
-
examples_ok: ["Migrating the auth service cut login time by half and broke password reset for a day.", "The retry loop kept redialing a number the kernel had already disconnected."],
|
|
216
|
-
rationale: "A figure anyone could use about anything tells the reader nothing about this case. Model prose reaches for the stock figure where human prose in these registers says the literal thing or makes a figure to fit."
|
|
214
|
+
examples_bad: ["Migrating the auth service turned out to be a double-edged sword.", "We picked the low-hanging fruit first and moved the needle on latency.", "The reviewer sent the proposal back to the drawing board.", "Moving to the new queue was a **game-changer** for the on-call rota.", "Our answer to flaky builds is the **silver bullet** everyone wanted: retry every step.", "The nightly job writes its errors to `sync-errors.csv`, and so far they are only the tip of the iceberg."],
|
|
215
|
+
examples_ok: ["Migrating the auth service cut login time by half and broke password reset for a day.", "The retry loop kept redialing a number the kernel had already disconnected.", "The reviewer returns one of three verdicts: **ship it**, **back to the drawing board**, or **shelve**.", "Run `burn-the-boats` to delete the staging stack and its volumes.", "We call a deploy that skips the canary a cold start. The cold start on Tuesday took checkout down for nine minutes."],
|
|
216
|
+
rationale: "A figure anyone could use about anything tells the reader nothing about this case. Model prose reaches for the stock figure where human prose in these registers says the literal thing or makes a figure to fit. A command in code, one of a set of options the paragraph lists, or a term the paragraph defines is a label, not a figure. Bold counts only when the paragraph sets the phrase up as a name."
|
|
217
217
|
),
|
|
218
218
|
Rule.new(
|
|
219
219
|
id: "no-news", category: "sentence", unit: :sentence, severity: "warning", confidence: "high",
|
|
@@ -221,8 +221,8 @@ module Sloplint
|
|
|
221
221
|
"type" => "score",
|
|
222
222
|
"instructions" => "Does `target` tell %{register} something they did not already know?",
|
|
223
223
|
"criteria" => [
|
|
224
|
-
{ "what" => "Defines a term the reader owns, or explains something every reader of this kind already knows.",
|
|
225
|
-
"examples" => ["A cache stores data so it can be served faster later.", "An RFC is a document published by the IETF."] },
|
|
224
|
+
{ "what" => "Defines a term the reader owns, or explains something every reader of this kind already knows, or tells the reader, in the second person, about their own past actions or their own past words — something they know because they did it or said it, however specific.",
|
|
225
|
+
"examples" => ["A cache stores data so it can be served faster later.", "An RFC is a document published by the IETF.", "You led the payments migration and then ran the platform team for two years.", "You said yourself the on-call load is the main reason to move."] },
|
|
226
226
|
{ "what" => "States something the reader could have guessed from the sentences before it, or a general truth that needed no saying.",
|
|
227
227
|
"examples" => ["Outages are bad for customers.", "Consensus is important in standards work."] },
|
|
228
228
|
{ "what" => "Tells the reader a fact, number, decision, or reason they did not have before reading it.",
|
|
@@ -232,9 +232,9 @@ module Sloplint
|
|
|
232
232
|
flag: { level: 0 },
|
|
233
233
|
message: "Explains what this reader already knows.",
|
|
234
234
|
suggestion: "Cut it, or replace it with the fact this reader does not have.",
|
|
235
|
-
examples_bad: ["A database index is a data structure that speeds up lookups on a column.", "Unit tests are small programs that check that a piece of code behaves as expected."],
|
|
236
|
-
examples_ok: ["The composite index on (tenant_id, created_at) cut the dashboard query from 900 ms to 40 ms.", "The flaky test was reading the clock; pinning it to a fixed time fixed 30 of the 31 failures."],
|
|
237
|
-
rationale: "A sentence that defines a term the reader owns is written for a reader who is not there. Model prose explains; human prose in these registers assumes."
|
|
235
|
+
examples_bad: ["A database index is a data structure that speeds up lookups on a column.", "Unit tests are small programs that check that a piece of code behaves as expected.", "You led the payments migration and then ran the platform team for two years.", "You said yourself the on-call load is the main reason to move."],
|
|
236
|
+
examples_ok: ["The composite index on (tenant_id, created_at) cut the dashboard query from 900 ms to 40 ms.", "The flaky test was reading the clock; pinning it to a fixed time fixed 30 of the 31 failures.", "You will need a staging account before Monday.", "Rotate the on-call key before Friday's handoff."],
|
|
237
|
+
rationale: "A sentence that defines a term the reader owns is written for a reader who is not there. Model prose explains; human prose in these registers assumes. The same goes for reading a reader's own past back to them: a fact is not news just because it is specific, if the reader is the one who lived it."
|
|
238
238
|
),
|
|
239
239
|
Rule.new(
|
|
240
240
|
id: "names-nothing", category: "sentence", unit: :sentence, severity: "warning", confidence: "high",
|
|
@@ -242,9 +242,9 @@ module Sloplint
|
|
|
242
242
|
"type" => "score",
|
|
243
243
|
"instructions" => "How concrete is `target`? Judge only what its nouns and verbs name.",
|
|
244
244
|
"criteria" => [
|
|
245
|
-
{ "what" => "Names no specific thing. Its nouns are categories or abstractions such as process, factor, framework, aspect, solution, approach, value, experience, and its claim could be made about many different situations.",
|
|
245
|
+
{ "what" => "Names no specific thing. Its nouns are categories or abstractions such as process, factor, framework, aspect, solution, approach, value, experience, and its claim could be made about many different situations. Nothing in its paragraph makes this claim checkable, even if the paragraph names other things: pointing back at something the paragraph named, with these or this design, does not make a new general claim about it checkable.",
|
|
246
246
|
"examples" => ["This approach provides significant value across a range of use cases.", "It is important to consider the various factors involved in the process."] },
|
|
247
|
-
{ "what" => "Names the kind of thing it is about but not which one. A reader knows the topic but could not point to, count, or look up the thing.",
|
|
247
|
+
{ "what" => "Names the kind of thing it is about but not which one. A reader knows the topic but could not point to, count, or look up the thing. Or it is a fragment with no verb, or a whole sentence of four words or fewer, that the next sentence of its paragraph spells out.",
|
|
248
248
|
"examples" => ["The service caches responses to reduce load on the database.", "Some users reported slow page loads after the update."] },
|
|
249
249
|
{ "what" => "Names a specific thing a reader could point to, count, look up, or check: a named system, a number, a date, a person, a quoted line, a particular event.",
|
|
250
250
|
"examples" => ["The checkout API returned 503 for 47 minutes on March 3 after the TLS certificate for api.example.com expired.", "RFC 2119 defines MUST, SHOULD and MAY for use in standards text."] }
|
|
@@ -253,8 +253,8 @@ module Sloplint
|
|
|
253
253
|
flag: { level: 0 },
|
|
254
254
|
message: "Sentence names nothing specific.",
|
|
255
255
|
suggestion: "Name the system, the number, the person or the event.",
|
|
256
|
-
examples_bad: ["This approach delivers meaningful improvements across a variety of scenarios.", "Several factors contributed to the overall outcome of the initiative."],
|
|
257
|
-
examples_ok: ["The search endpoint returned 503 for 47 minutes on March 3.", "Section 4.2 of RFC 7230 says a proxy MUST NOT forward a hop-by-hop header."],
|
|
256
|
+
examples_bad: ["This approach delivers meaningful improvements across a variety of scenarios.", "Several factors contributed to the overall outcome of the initiative.", "The retry queue holds 200 jobs and drains every 30 seconds. Over time, small gaps like these tend to grow into larger problems across the organisation."],
|
|
257
|
+
examples_ok: ["The search endpoint returned 503 for 47 minutes on March 3.", "Section 4.2 of RFC 7230 says a proxy MUST NOT forward a hop-by-hop header.", "Idempotent. Running the migration twice leaves the schema at version 14 and logs one skip line.", "Retries back off 1, 2, 4 and 8 seconds, then give up. That schedule keeps a failing job from holding its worker for long."],
|
|
258
258
|
rationale: "A sentence whose nouns are all categories could be about anything, and reads as written by someone who was not there."
|
|
259
259
|
),
|
|
260
260
|
Rule.new(
|
|
@@ -307,11 +307,11 @@ module Sloplint
|
|
|
307
307
|
id: "unnamed-authority", category: "sentence", unit: :sentence, severity: "info", confidence: "medium",
|
|
308
308
|
question: {
|
|
309
309
|
"type" => "score",
|
|
310
|
-
"instructions" => "If `target` attributes a claim to someone, who, for %{register}?",
|
|
310
|
+
"instructions" => "If `target` attributes a claim to someone, or calls it known, who, for %{register}?",
|
|
311
311
|
"criteria" => [
|
|
312
|
-
{ "what" => "To an authority the reader could not find and that speaks for nobody in particular: experts, studies, research, observers, analysts, critics, fans, pundits, many, some, it is widely believed.",
|
|
313
|
-
"examples" => ["Experts agree that the migration reduced operational risk.", "Studies show that smaller pull requests get better reviews.", "Many believe the old scheduler was the real bottleneck."] },
|
|
314
|
-
{ "what" => "To a named person, body, document or dataset the reader could go to, or to a source that speaks for a body and the register quotes by convention (officials, a spokesperson, the company, a court, police), or to prior work in a register that keeps its citations elsewhere (an abstract's existing methods, previous studies), or the sentence makes the claim in its own voice.",
|
|
312
|
+
{ "what" => "To an authority the reader could not find and that speaks for nobody in particular: experts, studies, research, observers, analysts, critics, fans, pundits, many, some, it is widely believed; or the claim is only called known, with nobody in the sentence or its paragraph who found it: a known cause, it is well known that, as is widely known.",
|
|
313
|
+
"examples" => ["Experts agree that the migration reduced operational risk.", "Studies show that smaller pull requests get better reviews.", "Many believe the old scheduler was the real bottleneck.", "It is well known that users abandon a form after the third required field."] },
|
|
314
|
+
{ "what" => "To a named person, body, document or dataset the reader could go to, or to a source that speaks for a body and the register quotes by convention (officials, a spokesperson, the company, a court, police), or to prior work in a register that keeps its citations elsewhere (an abstract's existing methods, previous studies), or to a known fact the sentence or its paragraph cites, or the sentence makes the claim in its own voice. In an abstract, and only there, a result the field is said to know is prior work however it is phrased: an abstract that opens \"it is well known that the lattice is rigid\" or \"the solver is known to diverge on sparse inputs\" is pointing at the literature. A person or group described as known or well known is a reputation, not a claim, and attributes nothing.",
|
|
315
315
|
"examples" => ["The April postmortem counts three fewer pages a week since the migration.", "A spokesperson for the airline said the flight was cancelled because of crew hours.", "The migration reduced pages from nine a week to six."] }
|
|
316
316
|
]
|
|
317
317
|
},
|
|
@@ -320,14 +320,17 @@ module Sloplint
|
|
|
320
320
|
suggestion: "Name the source, or say it yourself.",
|
|
321
321
|
examples_bad: [
|
|
322
322
|
"Research suggests that teams with a single on-call rotation recover faster.",
|
|
323
|
-
"Many in the industry expect event-driven designs to dominate within a few years."
|
|
323
|
+
"Many in the industry expect event-driven designs to dominate within a few years.",
|
|
324
|
+
"Long-lived feature branches are a known source of merge pain."
|
|
324
325
|
],
|
|
325
326
|
examples_ok: [
|
|
326
327
|
"The 2024 DORA report puts the median recovery time for teams with one rotation at under an hour.",
|
|
327
328
|
"Officials said the bridge would stay closed until the inspection was complete.",
|
|
328
|
-
"Existing methods segment the vessel tree slice by slice and lose the branching structure between slices."
|
|
329
|
+
"Existing methods segment the vessel tree slice by slice and lose the branching structure between slices.",
|
|
330
|
+
"Long-lived feature branches are a known source of merge pain: in our 2023 repository audit, branches open longer than two weeks hit three times as many conflicts.",
|
|
331
|
+
"A well-known campaigner for cycle lanes told the council that the painted lanes on Mill Road had halved cyclist injuries."
|
|
329
332
|
],
|
|
330
|
-
rationale: "A claim handed to experts, studies or many is a claim the reader cannot check and the writer has not owned. The regex catalog's vague-attribution sees three fixed frames; this is the reading of who is being cited, so \"studies show\" and \"research suggests\" and a bare \"many believe\" are caught and a source the register names by convention, officials, a spokesperson, the company, is not. Two levels. Info because news attributes to unnamed officials by convention, and an abstract to prior work, and the rule must let both through."
|
|
333
|
+
rationale: "A claim handed to experts, studies or many is a claim the reader cannot check and the writer has not owned. The regex catalog's vague-attribution sees three fixed frames; this is the reading of who is being cited, so \"studies show\" and \"research suggests\" and a bare \"many believe\" are caught and a source the register names by convention, officials, a spokesperson, the company, is not. Two levels. Info because news attributes to unnamed officials by convention, and an abstract to prior work, and the rule must let both through. An appeal to what is \"known\" hands the claim to everyone, and so to no one."
|
|
331
334
|
),
|
|
332
335
|
Rule.new(
|
|
333
336
|
id: "stated-stakes", category: "sentence", unit: :sentence, severity: "info", confidence: "low",
|
|
@@ -376,6 +379,185 @@ module Sloplint
|
|
|
376
379
|
examples_bad: ["The new pipeline is faster, simpler, and cleaner.", "It's not about the tooling, it's about the culture."],
|
|
377
380
|
examples_ok: ["The new pipeline runs in four minutes instead of eleven.", "The migration dropped the column in production but not in staging."],
|
|
378
381
|
rationale: "A pair or triple whose items are interchangeable was built to a rhythm, not to the content. Off by default: it separates strongly against current Claude models and barely against 2023 models, which is a tell of one model family, and much of what it flags in documentation is a parallel the writer built on purpose."
|
|
382
|
+
),
|
|
383
|
+
Rule.new(
|
|
384
|
+
id: "mirrored-opposites", category: "sentence", unit: :sentence, severity: "info", confidence: "low",
|
|
385
|
+
question: {
|
|
386
|
+
"type" => "score",
|
|
387
|
+
"instructions" => "Does `target` set opposite words against each other (everywhere and nowhere, always and never, every and none, loud and silent), and if so, are the opposites comparing one thing or stitching two claims together, for %{register}?",
|
|
388
|
+
"criteria" => [
|
|
389
|
+
{ "what" => "Two different claims are joined by opposite words so that they read as a contrast. The opposition is between the words, not between the facts: the second claim said plainly (not, isn't, nobody, not anywhere) would tell the reader exactly as much.",
|
|
390
|
+
"examples" => ["The retry logic is identical everywhere it runs and documented nowhere.", "The dashboard is always open and never checked.", "Every team cites the style guide and none of them has read it."] },
|
|
391
|
+
{ "what" => "The opposites compare the same thing across cases the reader needs to tell apart (the same action in two places, the same cost at two stages, before and after), or the sentence has no opposites set against each other.",
|
|
392
|
+
"examples" => ["The job runs every night in staging and never in production.", "The cache is cheap to build and expensive to run.", "Nobody has documented the retry logic.", "The alert posted to a channel nobody read."] }
|
|
393
|
+
]
|
|
394
|
+
},
|
|
395
|
+
flag: { level: 0 },
|
|
396
|
+
message: "Opposite words make two separate claims read as a contrast.",
|
|
397
|
+
suggestion: "Say the claim that matters plainly and drop the half that only sets it up.",
|
|
398
|
+
examples_bad: [
|
|
399
|
+
"The naming convention is followed in every service and written down in none.",
|
|
400
|
+
"The feature flag is respected by every client and owned by no one."
|
|
401
|
+
],
|
|
402
|
+
examples_ok: [
|
|
403
|
+
"The migration runs nightly in staging and never in production.",
|
|
404
|
+
"Reads return in two milliseconds; writes can block for a full second.",
|
|
405
|
+
"Nobody wrote the naming convention down."
|
|
406
|
+
],
|
|
407
|
+
rationale: "Setting everywhere against nowhere, or always against never, makes two unrelated facts sound like one finding. The reader learns nothing from the mirror: 'identical everywhere it runs and documented nowhere' says what 'identical, but not documented' says. Opposites that compare one thing in two cases, a job that runs in staging and not in production, carry the contrast in the facts and are fine. matched-shape flags any pair built to a rhythm; this is the narrower case where the pair is a pair of opposites."
|
|
408
|
+
),
|
|
409
|
+
Rule.new(
|
|
410
|
+
id: "positive-form", category: "sentence", unit: :sentence, severity: "info", confidence: "low",
|
|
411
|
+
question: {
|
|
412
|
+
"type" => "score",
|
|
413
|
+
"instructions" => "Does `target` make its claim by saying what is, or by saying what is not, for %{register}? Judge the claim the sentence makes, not every negative word in it.",
|
|
414
|
+
"criteria" => [
|
|
415
|
+
{ "what" => "The claim is carried by a negative. The sentence says what something is not in place of what it is. Or it corrects with not, rather than, instead of, or isn't X, it's Y, anywhere in the sentence, including a trailing or subordinate clause (because it is A rather than B; which is A, not B). Or it makes nothing, nobody, none or no X its subject, or nothing or nobody its object. Or its verb performs an absence: it gives an act to something that nobody did (publishes no figure, shows no incident, lists no changes, records nothing, offers no support), where the absence could be stated as a property of the thing. Or it denies something so that the next sentence can give the positive. Or it tells the reader what not to do. The reader has to work out what is true from what is denied.",
|
|
416
|
+
"examples" => ["The retry queue is a buffer, not a store.", "Nothing about the schema changes.", "The vendor publishes no uptime figure.", "The audit shows no finding for the payments service.", "Do not mention the cutover date in the release note.", "The problem isn't the index, it's that the query scans every partition.", "Two services write to the table, which is by design rather than an oversight.", "The real limit is disk throughput instead of memory."] },
|
|
417
|
+
{ "what" => "The claim is carried by a positive statement: the sentence says what is, has or does. It has no negative, or its negative sits outside the claim: in a condition (unless, if not), a bound (no more than, zero rows), a fixed name (non-blocking, NOT NULL, 404 Not Found), or a requirement keyword in a standard (MUST NOT). Or the sentence says in so many words that it states an assumption or a decision (we assume, we chose) and names the option it rules out. Or it states a design choice, what a thing was built, set up or configured to be, names the option it rules out, and gives the reason that option would fail; a corrected cause or a corrected fact is not a choice, whatever reason comes with it. Or it is an instruction that sends the reader to a different command, tool, section or option for a case it names (run, see, try, switch to); an instead of or rather than there only names the other option and denies nothing. Or the sentence states an absence as a property of the thing, with has no, there is no or without (the batch API has no SLA; the export ships without a schema file). Or it denies a behavior the reader would expect, stated on its own, not set against another option in the same sentence (does not retry, will not overwrite). Or it is a courtesy line that releases the reader from an action (no need to reply). Or the sentence reports someone's words in quotation marks: a quoted denial belongs to the speaker, not the writer, whatever it says.",
|
|
418
|
+
"examples" => ["The retry queue keeps each message for seven days.", "We assume the export runs nightly rather than hourly.", "The uploader writes to local disk rather than straight to S3, since a dropped connection would leave a partial object there.", "If you need the raw events instead of the daily totals, query the events table.", "The client gives up after no more than three attempts.", "If the token is not set, the CLI reads it from the keychain.", "The vendor's API has no published uptime figure.", "The CLI does not overwrite an existing config file.", "No need to RSVP if you already signed up.","\"The fix is not ready,\" the lead said."] }
|
|
419
|
+
]
|
|
420
|
+
},
|
|
421
|
+
flag: { level: 0 },
|
|
422
|
+
message: "Says what isn't where it could say what is.",
|
|
423
|
+
suggestion: "Say what is there instead, or state the absence as a property of the thing (has no, without).",
|
|
424
|
+
examples_bad: [
|
|
425
|
+
"The sidecar is a proxy, not a cache.",
|
|
426
|
+
"The changelog lists no breaking changes for 4.0.",
|
|
427
|
+
"The worker retries the failed chunk, not the whole upload.",
|
|
428
|
+
"Nobody on the platform team owns the deploy script.",
|
|
429
|
+
"Don't page the database team for replica lag.",
|
|
430
|
+
"The slow part is the serializer instead of the network.",
|
|
431
|
+
"The deploy stalled because the registry throttled pulls, not because the image was large."
|
|
432
|
+
],
|
|
433
|
+
examples_ok: [
|
|
434
|
+
"We assume the importer runs once a day rather than on every upload.",
|
|
435
|
+
"We chose Postgres rather than DynamoDB because the reports need joins.",
|
|
436
|
+
"Sessions live in Redis rather than the app database, because the app database fails over in minutes and a session lookup cannot wait that long.",
|
|
437
|
+
"If you deploy on bare metal, see the ops guide instead of this page.",
|
|
438
|
+
"To rebuild one package rather than the whole tree, run `make -C pkg/auth`.",
|
|
439
|
+
"If the lock is not released within 30 seconds, the worker exits.",
|
|
440
|
+
"Each upload holds no more than 200 files.",
|
|
441
|
+
"The email column is declared NOT NULL and indexed.",
|
|
442
|
+
"A client MUST NOT reuse a nonce within the same session.",
|
|
443
|
+
"\"We are not shipping on Friday,\" the release manager said.",
|
|
444
|
+
"The batch endpoint has no rate limit.",
|
|
445
|
+
"The client does not retry a failed upload.",
|
|
446
|
+
"No need to reply if this doesn't apply to you."
|
|
447
|
+
],
|
|
448
|
+
rationale: "A sentence that says what a thing is not makes the reader work out what it is, and a model reaches for the denial because it sounds decisive without having to know the positive fact. The corrective (a buffer, not a store) sets up a contrast nobody raised. A sentence whose subject is nothing or nobody, or an instruction about what not to do, names the gap and leaves the reader to fill it. The regex rules not-x-but-y, isnt-x-its-y and not-nothing see a few fixed frames of this; this rule reads where the negative sits, so a negative inside a condition, a bound, a fixed name, a standard's MUST NOT or quoted speech passes, and so does a stated assumption or decision that names the option it rules out, a design choice that gives the reason the other option would fail, and a pointer that sends the reader to another option for a case it names. mirrored-opposites flags opposite words that make two claims read as one; this is any claim made by denial. Off by default: reference documentation states limits as negatives on purpose (not supported, not encrypted, cannot be used with), and most of what the rule flags there is a limit the reader needs."
|
|
449
|
+
),
|
|
450
|
+
Rule.new(
|
|
451
|
+
id: "name-the-thing", category: "sentence", unit: :sentence, severity: "info", confidence: "low",
|
|
452
|
+
question: {
|
|
453
|
+
"type" => "score",
|
|
454
|
+
"instructions" => "Does `target` call things by their names, or does it make %{register} map a pointer back to a name?",
|
|
455
|
+
"criteria" => [
|
|
456
|
+
{ "what" => "Refers to something by anything other than its name when a name exists or is available. It picks a thing out by position, order or number in a list (the former, the latter, the first one, the second one, the last of three, the fourth item, the third alert), even when the list was just named; or it uses a stand-in noun or a figure for a named thing (the engine for a named service, the seat for a named role); or it rests its point on an allusion to a divide it never names (which side, which end or which slot someone is on, where someone stood when a system changed) or on the document pointing at itself ('this entire writeup', 'this entire proposal') standing in for a point it never states. The reader has to map the pointer back to a name. One pointer is enough: a sentence full of names still flags if one clause in it points instead of naming, such as an \"only the latter\" after a semicolon or a trailing \"which is this entire writeup\" after a list of facts.",
|
|
457
|
+
"examples" => ["We tried Kafka and SQS, and the latter needed no cluster to run.", "Both jobs read the same table; only the former writes to it.", "The third alert on that dashboard is the only one worth waking up for.", "We run the ledgerd service in two regions, and the engine is the thing that pages us.", "Hiring managers care where you stood when the monolith was split.", "The March outage, which is this entire proposal in a single afternoon."] },
|
|
458
|
+
{ "what" => "Names what it means. A position word is fine only when the position is the thing's own name (step 4 of the runbook, the second retry, Q3, the first argument). A which-clause that asks about named things (which region, which port, which of the two replicas) is fine. An ordinary pronoun (it, they, this, these) pointing back to something named in the same or the previous sentence, or at a code sample or list beside it, is fine.",
|
|
459
|
+
"examples" => ["SQS needed no cluster to run.", "Step 4 of the runbook restarts the consumer.", "The second retry waits thirty seconds.", "Which region you deploy to decides the latency floor.", "The on-call engineer decides which of the two replicas to promote.", "The ingest worker reads from the events queue. It restarts every night.", "You can stub a method like this:"] }
|
|
460
|
+
]
|
|
461
|
+
},
|
|
462
|
+
flag: { level: 0 },
|
|
463
|
+
message: "Sentence points at something instead of naming it.",
|
|
464
|
+
suggestion: "Write the name: the service, the option, the role or the point itself.",
|
|
465
|
+
examples_bad: [
|
|
466
|
+
"Whether you trust the new alerting depends on where you stood when the old scheduler went away.",
|
|
467
|
+
"We load-tested Envoy and HAProxy last month, and the latter held 40,000 connections without tuning.",
|
|
468
|
+
"Payments run on a Rust service called tallyd, and the engine has not been patched since June."
|
|
469
|
+
],
|
|
470
|
+
examples_ok: [
|
|
471
|
+
"Step 4 of the runbook drains the queue before the consumer restarts.",
|
|
472
|
+
"Which availability zone the replica lands in decides whether it survives a zone outage.",
|
|
473
|
+
"Register the retry hook in the initializer like this:",
|
|
474
|
+
"The ingest worker reads from the events queue, and it restarts every night at 02:00 UTC."
|
|
475
|
+
],
|
|
476
|
+
rationale: "The latter, the second one, the engine, where you stood when the old scheduler went away, this entire writeup: each makes the reader map a pointer back to a name the writer had and did not write. Naming the thing costs a word or two and saves the reader the lookup, even when the list was named one clause earlier. A position that is the thing's own name (step 4, the second retry, Q3) is a name, and a pronoun pointing at something just named is ordinary grammar; both pass. The-x-is-not-the-x catches the repeated-noun case; this is the general one."
|
|
477
|
+
),
|
|
478
|
+
Rule.new(
|
|
479
|
+
id: "maxim", category: "sentence", unit: :sentence, severity: "info", confidence: "medium",
|
|
480
|
+
question: {
|
|
481
|
+
"type" => "score",
|
|
482
|
+
"instructions" => "Is `target` a saying: a general rule about how people, teams or systems always behave, where %{register} wants the fact about this case?",
|
|
483
|
+
"criteria" => [
|
|
484
|
+
{ "what" => "A saying. It states how things always go for anyone, in a turned phrase that could be lifted out and quoted on its own: every X is Y until Z, nobody does X until Y, you learn X the day Y, X stops being Y the moment Z, the X you Y is the one that Z. It is still a saying when the sentences around it are the example that illustrates it, or when it is about people rather than code.",
|
|
485
|
+
"examples" => ["A cache you never invalidate is a bug you haven't met yet.", "Nobody values a backup until the day they need a restore.", "Every quick fix becomes a permanent one.", "The meeting you skip is the one where they decide."] },
|
|
486
|
+
{ "what" => "Not a saying. It states a fact about this system, team or event; or it says in plain words how a particular tool, protocol, data structure or piece of code behaves, which a reader could test; or it is a step, a requirement or a decision.",
|
|
487
|
+
"examples" => ["The queue holds 40,000 messages before the broker starts rejecting writes.", "A TCP connection in TIME_WAIT holds its port for twice the maximum segment lifetime.", "Writes to the ledger must be append-only, so a correction is a new row.", "Priya owns the billing client."] }
|
|
488
|
+
]
|
|
489
|
+
},
|
|
490
|
+
flag: { level: 0 },
|
|
491
|
+
message: "Sentence states a saying where the fact belongs.",
|
|
492
|
+
suggestion: "Cut the saying and let the fact beside it make the point, or replace it with the fact.",
|
|
493
|
+
examples_bad: [
|
|
494
|
+
"A dashboard nobody looks at is a postmortem waiting to happen.",
|
|
495
|
+
"The rollback you never test is the one that fails when you need it."
|
|
496
|
+
],
|
|
497
|
+
examples_ok: [
|
|
498
|
+
"The dashboard for queue depth has had no viewers in the last 90 days.",
|
|
499
|
+
"Adding a column with a volatile default rewrites the whole table in Postgres."
|
|
500
|
+
],
|
|
501
|
+
rationale: "A sentence that reaches for a general rule about how things always go tells the reader nothing about this case, whatever specific sentences sit next to it. Medium because the question turns on the sentence's shape, a turned phrase that could stand alone, not on a fixed list of words, and a plain general statement of fact ('adding a volatile-default column rewrites the table') has to be told apart from an aphorism with the same short, declarative build."
|
|
502
|
+
),
|
|
503
|
+
Rule.new(
|
|
504
|
+
id: "dressed-pair", category: "sentence", unit: :sentence, severity: "info", confidence: "low",
|
|
505
|
+
question: {
|
|
506
|
+
"type" => "score",
|
|
507
|
+
"instructions" => "Does `target` state its facts plainly, or does it dress them up as a matched pair? Judge only the words of `target`; earlier sentences are context.",
|
|
508
|
+
"criteria" => [
|
|
509
|
+
{ "what" => "Dresses a plain fact up as a pair. Either the second clause gives a second subject the first clause's verb and adds little beyond a tie back to the first (X deploys and Y deploys with it, A restarts and B restarts on its own), so the fact reads as a parallel when the plain version is one clause; or it sums up two things set out in earlier sentences as both, those two things or the two, and then gives that sum a verdict (is the real work, is the whole point, is what matters).",
|
|
510
|
+
"examples" => ["The release goes out and the on-call week goes out with it.", "The API falls over and the status page falls over right behind it.", "One team writes the schema and the other reads it, and keeping those two things in step is the whole job."] },
|
|
511
|
+
{ "what" => "States its facts plainly. A pair whose halves carry different facts (reads go to the replica, writes go to the primary), a choice between two named options (either team can own it), a both that says what is true of two named things, even more than once, with no verdict on the pair, a pairing of groups with roles the paragraph already defined, or no pair at all.",
|
|
512
|
+
"examples" => ["The on-call engineer ships with each release.", "Either the web team or the mobile team can take the bug.", "Staging and production both run the same image, and both restart at midnight.", "Teams that own a database get the pager; teams that only read from one get the digest.", "The alert posted to a Slack channel nobody read."] }
|
|
513
|
+
]
|
|
514
|
+
},
|
|
515
|
+
flag: { level: 0 },
|
|
516
|
+
message: "Sentence dresses a plain fact up as a matched pair.",
|
|
517
|
+
suggestion: "Say it once: what the second thing does, or what the two things are and what follows.",
|
|
518
|
+
examples_bad: [
|
|
519
|
+
"The schema changes, and the client changes right along with it, and the question every migration still leaves open is who finds out first.",
|
|
520
|
+
"A cache stores what the database returns. A queue holds what the writer sends. This service does both, and keeping those two things apart is the whole trick."
|
|
521
|
+
],
|
|
522
|
+
examples_ok: [
|
|
523
|
+
"Reads go to the replica and writes go to the primary.",
|
|
524
|
+
"Either the database team or the platform team can own the failover runbook.",
|
|
525
|
+
"We run Postgres for orders and Redis for sessions. Both sit behind the same VPC and both are backed up nightly.",
|
|
526
|
+
"Contractors get read access. Employees get write access."
|
|
527
|
+
],
|
|
528
|
+
rationale: "Two ways of saying one fact as if it were two. The first echoes a verb: 'the release goes out and the on-call week goes out with it' is 'the on-call engineer ships with the release' set to a rhythm. The second sums up a pair as 'both' or 'those two things' and hands the sum a verdict, 'is the whole job', which names neither thing and tells the reader nothing the two sentences before it did not. A pair whose halves carry different facts, a plain 'both', and a pairing of groups with roles the paragraph defined are the facts themselves and pass. matched-shape flags pairs built to a rhythm in general; name-the-thing flags a pair pointed at by position or figure; this is the pair restated instead of named."
|
|
529
|
+
),
|
|
530
|
+
Rule.new(
|
|
531
|
+
id: "device-before-claim", category: "sentence", unit: :sentence, severity: "info", confidence: "medium",
|
|
532
|
+
question: {
|
|
533
|
+
"type" => "score",
|
|
534
|
+
"instructions" => "Look at `target` inside its paragraph. Does it make its claim through a device - opposites or a matched pair set against each other, a noun repeated to pose a riddle, singling out one item's place in a list or order as the one that matters, the sentence that finally tells %{register} what the specifics before it add up to, a coined figure, or a maxim that generalizes or restates the paragraph's point - or does it state the claim plainly, as one more fact among the others?",
|
|
535
|
+
"criteria" => [
|
|
536
|
+
{ "what" => "The sentence is a device: opposites or a matched pair set against each other (everyone and nobody, always and never, the frontend ships one thing and the backend ships another); a noun or phrase repeated to pose a riddle; singling out one item's position in a list or order, the second one, the last one, the fourth item, as the one that actually matters; the payoff sentence that tells the reader what a run of specifics before it adds up to; a coined figure; or a maxim, a general rule stated as if it simply follows, that sums up or restates the point the paragraph was already making. It reads as a turn or a landing, not as one more fact.",
|
|
537
|
+
"examples" => ["The retry logic is identical everywhere it runs and documented nowhere.", "The frontend team ships the button and the backend team owns the endpoint, and neither one works without the other.", "The third name on the escalation list is the one who actually picks up.", "A deploy that never gets rolled back was never really tested."] },
|
|
538
|
+
{ "what" => "The sentence states its claim directly, as one more fact in the paragraph, with no matched pair, no riddle, no singled-out position, no payoff over a run of specifics, and no maxim.",
|
|
539
|
+
"examples" => ["Nobody has documented the retry logic.", "The frontend team ships the button and the backend team ships the endpoint; both went out this morning.", "The third name on the escalation list is the database team's manager.", "This deploy has never been tested under real failure."] }
|
|
540
|
+
]
|
|
541
|
+
},
|
|
542
|
+
flag: { level: 0 },
|
|
543
|
+
message: "Sentence makes its claim through a device.",
|
|
544
|
+
suggestion: "Check whether the device carries anything a plain statement of the claim would not.",
|
|
545
|
+
examples_bad: [
|
|
546
|
+
"The cache holds the last hour of queries once it's warm. A cold instance rebuilds that from scratch on every request. The service is fast for the cache that's warm and slow for the one that's cold.",
|
|
547
|
+
"We wrote a rollback plan before the migration ran. It covers every table we're touching. A migration that needs a rollback plan already knows it might fail.",
|
|
548
|
+
"The build failed twice this morning. Nobody could find a code change that explained it. Here's what actually broke the build: a comment.",
|
|
549
|
+
"The incident review named five follow-up tasks. Three were closed within a week without much discussion. The fourth one is the only task that would have prevented the outage.",
|
|
550
|
+
"Every cache in the fleet shares one eviction policy. The eviction policy that keeps memory free is the same eviction policy that evicts the entry you needed two seconds later."
|
|
551
|
+
],
|
|
552
|
+
examples_ok: [
|
|
553
|
+
"The cache holds the last hour of queries once it's warm. A cold instance takes about four seconds to rebuild that on its first request.",
|
|
554
|
+
"We wrote a rollback plan before the migration ran because the migration might fail. It covers every table we're touching.",
|
|
555
|
+
"The build failed twice this morning. A stray comment in the config file caused both failures.",
|
|
556
|
+
"The deploy at 09:40 tripled error rates on the billing endpoint. The Redis connection pool was maxed at 20 for six minutes. We rolled back to the previous build and error rates returned to normal within two minutes.",
|
|
557
|
+
"The incident review named five follow-up tasks, including a rewrite of the retry budget. The retry-budget rewrite would have prevented the outage. The other four tasks were closed within a week.",
|
|
558
|
+
"Every cache in the fleet shares one eviction policy. It frees memory by evicting the least recently used entry, even when that entry is needed again a few seconds later."
|
|
559
|
+
],
|
|
560
|
+
rationale: "A sentence can make its claim by mirroring opposites against each other, posing a riddle with a repeated noun, holding an answer back until a run of specifics resolves into it, coining a figure, or drawing a maxim that restates what the paragraph already showed. mirrored-opposites and the-x-is-not-the-x in the regex catalog each catch one syntactic shape of this; this rule reads the sentence's role in the paragraph instead, so a form neither regex expects is still caught. It only says a device is present, not whether the device earns its place: a figure that explains how something works or a real tradeoff dressed as a mirror is still flagged, and it is for the reader to decide whether cutting it loses anything."
|
|
379
561
|
)
|
|
380
562
|
].freeze
|
|
381
563
|
end
|