proofix 0.5.0__tar.gz
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.
- proofix-0.5.0/.gitignore +6 -0
- proofix-0.5.0/LICENSE +21 -0
- proofix-0.5.0/PKG-INFO +137 -0
- proofix-0.5.0/README.md +118 -0
- proofix-0.5.0/examples/typos.md +9 -0
- proofix-0.5.0/man/proofix.1 +235 -0
- proofix-0.5.0/proofix/__init__.py +3 -0
- proofix-0.5.0/proofix/cli.py +328 -0
- proofix-0.5.0/proofix/commas.py +325 -0
- proofix-0.5.0/proofix/consistency.py +234 -0
- proofix-0.5.0/proofix/hygiene.py +106 -0
- proofix-0.5.0/proofix/lt.py +71 -0
- proofix-0.5.0/proofix/report.py +73 -0
- proofix-0.5.0/proofix/tiers.py +133 -0
- proofix-0.5.0/pyproject.toml +46 -0
- proofix-0.5.0/tests/conftest.py +16 -0
- proofix-0.5.0/tests/fixtures/typos.lt.json +1 -0
- proofix-0.5.0/tests/test_docs.py +104 -0
- proofix-0.5.0/tests/test_e2e.py +117 -0
- proofix-0.5.0/tests/test_endpoint_cli.py +67 -0
- proofix-0.5.0/tests/test_units.py +149 -0
proofix-0.5.0/.gitignore
ADDED
proofix-0.5.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Andrew Brož
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
proofix-0.5.0/PKG-INFO
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: proofix
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: Fix typos and punctuation in Markdown: LanguageTool detects, a language model adjudicates, comma placement is corrected under a diff guard.
|
|
5
|
+
Project-URL: Homepage, https://github.com/AndrewBroz/proofix
|
|
6
|
+
Project-URL: Issues, https://github.com/AndrewBroz/proofix/issues
|
|
7
|
+
Author: Andrew Brož
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
16
|
+
Requires-Python: >=3.11
|
|
17
|
+
Requires-Dist: adjudicate<0.4,>=0.3
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# proofix
|
|
21
|
+
|
|
22
|
+
Fix typos and punctuation in a Markdown file, under audit. Every change is
|
|
23
|
+
one bounded, logged, reasoned edit; the model never rewrites prose.
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
proofix draft.md # -> draft.proofed.md (US English)
|
|
27
|
+
proofix draft.md --target uk --changes
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Run it after [stylefix](https://github.com/AndrewBroz/stylefix), so the grammar checker sees the target variety.
|
|
31
|
+
|
|
32
|
+
## Five tiers
|
|
33
|
+
|
|
34
|
+
| tier | what | how | who decides |
|
|
35
|
+
|---|---|---|---|
|
|
36
|
+
| 0 hygiene | text that renders fine but is not what it looks like: HTML entities Markdown can carry plainly (` `, `"`, `—`), zero-width spaces, byte-order marks, soft hyphens, control characters, Windows line endings, decomposed accents | fixed deterministically and logged; entities that would change Markdown's parsing (`<`, `>`, `&`) or carry meaning (` `) are left alone and reported | applied outright, or noted |
|
|
37
|
+
| 1 mechanical | space before a comma or period, missing space after one, doubled punctuation, doubled words, known misspellings | LanguageTool's single-answer rules, the `typos` tool, a small missing-space rule | applied outright |
|
|
38
|
+
| 2 adjudicated | unknown words with candidate spellings, grammar rules with candidate fixes ("a comma may be missing after However") | LanguageTool proposes, a language model picks one or KEEP from the sentence and the rule's message | model |
|
|
39
|
+
| 3 compounds and consistency | how a compound is written: "cyber attack" or "cyberattack", "non-profit" or "nonprofit", "long term" or "long-term"; and terms the document capitalises two ways | candidates found from the dictionaries (an open or hyphenated pair whose closed form is a word; a non-word that splits into two words; anything the document itself writes two ways). The model chooses closed, hyphenated, open or KEEP, told which dictionary rules (Merriam-Webster for US, Oxford for UK) and the rule that a compound modifier before a noun is hyphenated while a noun phrase is open | model |
|
|
40
|
+
| 4 commas | a comma between subject and verb, a missing comma after an introductory phrase or around a non-restrictive clause, a stray comma before "and" joining objects: nothing a rule engine detects | the model returns the sentence with commas corrected; a diff guard admits only insertions and deletions of commas, rejects anything else, and reports it | model, under the guard |
|
|
41
|
+
|
|
42
|
+
LanguageTool runs twice: once for the mechanical fixes, which are applied,
|
|
43
|
+
and again on the cleaned text for the judgement calls, so overlapping
|
|
44
|
+
faults on one span ("clear.However" needs a space *and* a comma) are both
|
|
45
|
+
fixed. Code spans, fenced code, link targets, URLs, HTML and front matter
|
|
46
|
+
are never touched; link text is prose and is checked.
|
|
47
|
+
|
|
48
|
+
Variety spellings ("programme", "analysed") are left to stylefix. Serial
|
|
49
|
+
commas are left to stylefix's style guide. Compound spelling follows the
|
|
50
|
+
target variety's dictionary, because that is what every style guide
|
|
51
|
+
defers to; the guide only adds AP's lighter hyphenation. Comma splices are not "fixed"
|
|
52
|
+
by changing punctuation; they are reported as notes.
|
|
53
|
+
|
|
54
|
+
## What goes to the model, and how much
|
|
55
|
+
|
|
56
|
+
Only the residue after the rule engines:
|
|
57
|
+
|
|
58
|
+
- Tier 2: one item per LanguageTool suggestion, with the sentence and one
|
|
59
|
+
neighbour as context. Typically 1 to 4 per page.
|
|
60
|
+
- Tier 3: one item per occurrence of a compound that has a question: a
|
|
61
|
+
closed form exists, or the document writes it two ways. A document that
|
|
62
|
+
is consistent and closes what the dictionary closes sends nothing.
|
|
63
|
+
- Tier 4: sentences pass a gate first. A sentence is sent only if it
|
|
64
|
+
contains a comma, opens with an introductory word (After, Although,
|
|
65
|
+
However, In, When ...), contains a clause trigger (which, for example,
|
|
66
|
+
such as, said ...), or is long and joins clauses with a conjunction.
|
|
67
|
+
About two thirds of sentences pass. The model returns only the sentences
|
|
68
|
+
it changed, so replies are short. `--commas all` sends every sentence;
|
|
69
|
+
`--max-sentences N` caps the tier.
|
|
70
|
+
|
|
71
|
+
Measured on a 20-page document (8,000 words, 390 sentences). One measurement, on a DGX Spark serving Qwen3.8-27B, 8 requests in parallel:
|
|
72
|
+
|
|
73
|
+
| stage | sent to the model | time |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| stylefix | 119 words | 43 s |
|
|
76
|
+
| LanguageTool, one pass | nothing (local Java) | 4.5 s |
|
|
77
|
+
| proofix tier 2 | 77 items | included below |
|
|
78
|
+
| proofix tier 4, gated | 260 sentences | 19 s |
|
|
79
|
+
| proofix tier 4, all | 390 sentences | 24 s |
|
|
80
|
+
| proofix, everything | | 57 s |
|
|
81
|
+
|
|
82
|
+
Costs scale linearly with length: expect a 100-page document to take
|
|
83
|
+
about four minutes in stylefix and five in proofix. Decisions are cached
|
|
84
|
+
by sentence, so re-runs after edits pay only for what changed.
|
|
85
|
+
|
|
86
|
+
## Install
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
uv tool install proofix # or: pipx install proofix
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Optional, and worth having:
|
|
93
|
+
|
|
94
|
+
- [LanguageTool](https://languagetool.org) on your PATH as `languagetool`
|
|
95
|
+
(`brew install languagetool`; it needs Java). Without it, LanguageTool's
|
|
96
|
+
tier 1 fixes and all of tier 2 are skipped with a warning; hygiene, the
|
|
97
|
+
`typos` fixes, compounds and commas still run.
|
|
98
|
+
- [typos](https://github.com/crate-ci/typos) (`brew install typos-cli` or
|
|
99
|
+
`cargo install typos-cli`) for known-misspelling fixes in tier 1.
|
|
100
|
+
|
|
101
|
+
Run `proofix --setup` to choose and test a model endpoint, and
|
|
102
|
+
`proofix --check-endpoint` to see which one proofix will use. The endpoint
|
|
103
|
+
is configured as for stylefix: `--url`/`--model`,
|
|
104
|
+
`PROOFIX_LLM_URL`/`_MODEL`/`_KEY`, `~/.config/proofix/config.toml`, then
|
|
105
|
+
the shared `ADJUDICATE_LLM_*` and `~/.config/adjudicate/config.toml`; with
|
|
106
|
+
nothing configured, a local Ollama if one is running. A `--url` or
|
|
107
|
+
`PROOFIX_LLM_URL` drops keys set in lower layers; set `PROOFIX_LLM_KEY` (or
|
|
108
|
+
`api_key_env` in the same config file) alongside it. Without a model, tiers
|
|
109
|
+
0 and 1 still apply; tier 2's fixes are listed for review, tier 3 is skipped
|
|
110
|
+
and sentences are not checked for commas. See
|
|
111
|
+
[adjudicate](https://github.com/AndrewBroz/adjudicate#choosing-the-model-endpoint)
|
|
112
|
+
for the config table. `STYLEFIX_LLM_*` no longer configures proofix; use the
|
|
113
|
+
shared file or `ADJUDICATE_LLM_*` to set both tools at once.
|
|
114
|
+
|
|
115
|
+
Accept lists: `--accept FILE`, `~/.config/proofix/accept.txt`,
|
|
116
|
+
`./.proofix/accept.txt`, and stylefix's `~/.config/stylefix/accept.txt` and
|
|
117
|
+
`./.stylefix/accept.txt` are all honoured for spelling.
|
|
118
|
+
|
|
119
|
+
## Output
|
|
120
|
+
|
|
121
|
+
`<name>.proofed.md`, a report next to it, and with `--changes` a log on
|
|
122
|
+
stderr: every edit with its line, before and after, context and how it was
|
|
123
|
+
decided; the comma corrections with the model's reasons; comma suggestions
|
|
124
|
+
the guard rejected, with what the model wanted; notes on faults the model
|
|
125
|
+
noticed but is not allowed to fix (comma splices, agreement errors, a
|
|
126
|
+
missing closing quote); and LanguageTool matches with no fix.
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
MIT (see `LICENSE`).
|
|
131
|
+
|
|
132
|
+
## Development
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
uv sync
|
|
136
|
+
uv run pytest # LanguageTool is replayed from a fixture; the model is a stub
|
|
137
|
+
```
|
proofix-0.5.0/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# proofix
|
|
2
|
+
|
|
3
|
+
Fix typos and punctuation in a Markdown file, under audit. Every change is
|
|
4
|
+
one bounded, logged, reasoned edit; the model never rewrites prose.
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
proofix draft.md # -> draft.proofed.md (US English)
|
|
8
|
+
proofix draft.md --target uk --changes
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Run it after [stylefix](https://github.com/AndrewBroz/stylefix), so the grammar checker sees the target variety.
|
|
12
|
+
|
|
13
|
+
## Five tiers
|
|
14
|
+
|
|
15
|
+
| tier | what | how | who decides |
|
|
16
|
+
|---|---|---|---|
|
|
17
|
+
| 0 hygiene | text that renders fine but is not what it looks like: HTML entities Markdown can carry plainly (` `, `"`, `—`), zero-width spaces, byte-order marks, soft hyphens, control characters, Windows line endings, decomposed accents | fixed deterministically and logged; entities that would change Markdown's parsing (`<`, `>`, `&`) or carry meaning (` `) are left alone and reported | applied outright, or noted |
|
|
18
|
+
| 1 mechanical | space before a comma or period, missing space after one, doubled punctuation, doubled words, known misspellings | LanguageTool's single-answer rules, the `typos` tool, a small missing-space rule | applied outright |
|
|
19
|
+
| 2 adjudicated | unknown words with candidate spellings, grammar rules with candidate fixes ("a comma may be missing after However") | LanguageTool proposes, a language model picks one or KEEP from the sentence and the rule's message | model |
|
|
20
|
+
| 3 compounds and consistency | how a compound is written: "cyber attack" or "cyberattack", "non-profit" or "nonprofit", "long term" or "long-term"; and terms the document capitalises two ways | candidates found from the dictionaries (an open or hyphenated pair whose closed form is a word; a non-word that splits into two words; anything the document itself writes two ways). The model chooses closed, hyphenated, open or KEEP, told which dictionary rules (Merriam-Webster for US, Oxford for UK) and the rule that a compound modifier before a noun is hyphenated while a noun phrase is open | model |
|
|
21
|
+
| 4 commas | a comma between subject and verb, a missing comma after an introductory phrase or around a non-restrictive clause, a stray comma before "and" joining objects: nothing a rule engine detects | the model returns the sentence with commas corrected; a diff guard admits only insertions and deletions of commas, rejects anything else, and reports it | model, under the guard |
|
|
22
|
+
|
|
23
|
+
LanguageTool runs twice: once for the mechanical fixes, which are applied,
|
|
24
|
+
and again on the cleaned text for the judgement calls, so overlapping
|
|
25
|
+
faults on one span ("clear.However" needs a space *and* a comma) are both
|
|
26
|
+
fixed. Code spans, fenced code, link targets, URLs, HTML and front matter
|
|
27
|
+
are never touched; link text is prose and is checked.
|
|
28
|
+
|
|
29
|
+
Variety spellings ("programme", "analysed") are left to stylefix. Serial
|
|
30
|
+
commas are left to stylefix's style guide. Compound spelling follows the
|
|
31
|
+
target variety's dictionary, because that is what every style guide
|
|
32
|
+
defers to; the guide only adds AP's lighter hyphenation. Comma splices are not "fixed"
|
|
33
|
+
by changing punctuation; they are reported as notes.
|
|
34
|
+
|
|
35
|
+
## What goes to the model, and how much
|
|
36
|
+
|
|
37
|
+
Only the residue after the rule engines:
|
|
38
|
+
|
|
39
|
+
- Tier 2: one item per LanguageTool suggestion, with the sentence and one
|
|
40
|
+
neighbour as context. Typically 1 to 4 per page.
|
|
41
|
+
- Tier 3: one item per occurrence of a compound that has a question: a
|
|
42
|
+
closed form exists, or the document writes it two ways. A document that
|
|
43
|
+
is consistent and closes what the dictionary closes sends nothing.
|
|
44
|
+
- Tier 4: sentences pass a gate first. A sentence is sent only if it
|
|
45
|
+
contains a comma, opens with an introductory word (After, Although,
|
|
46
|
+
However, In, When ...), contains a clause trigger (which, for example,
|
|
47
|
+
such as, said ...), or is long and joins clauses with a conjunction.
|
|
48
|
+
About two thirds of sentences pass. The model returns only the sentences
|
|
49
|
+
it changed, so replies are short. `--commas all` sends every sentence;
|
|
50
|
+
`--max-sentences N` caps the tier.
|
|
51
|
+
|
|
52
|
+
Measured on a 20-page document (8,000 words, 390 sentences). One measurement, on a DGX Spark serving Qwen3.8-27B, 8 requests in parallel:
|
|
53
|
+
|
|
54
|
+
| stage | sent to the model | time |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| stylefix | 119 words | 43 s |
|
|
57
|
+
| LanguageTool, one pass | nothing (local Java) | 4.5 s |
|
|
58
|
+
| proofix tier 2 | 77 items | included below |
|
|
59
|
+
| proofix tier 4, gated | 260 sentences | 19 s |
|
|
60
|
+
| proofix tier 4, all | 390 sentences | 24 s |
|
|
61
|
+
| proofix, everything | | 57 s |
|
|
62
|
+
|
|
63
|
+
Costs scale linearly with length: expect a 100-page document to take
|
|
64
|
+
about four minutes in stylefix and five in proofix. Decisions are cached
|
|
65
|
+
by sentence, so re-runs after edits pay only for what changed.
|
|
66
|
+
|
|
67
|
+
## Install
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
uv tool install proofix # or: pipx install proofix
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Optional, and worth having:
|
|
74
|
+
|
|
75
|
+
- [LanguageTool](https://languagetool.org) on your PATH as `languagetool`
|
|
76
|
+
(`brew install languagetool`; it needs Java). Without it, LanguageTool's
|
|
77
|
+
tier 1 fixes and all of tier 2 are skipped with a warning; hygiene, the
|
|
78
|
+
`typos` fixes, compounds and commas still run.
|
|
79
|
+
- [typos](https://github.com/crate-ci/typos) (`brew install typos-cli` or
|
|
80
|
+
`cargo install typos-cli`) for known-misspelling fixes in tier 1.
|
|
81
|
+
|
|
82
|
+
Run `proofix --setup` to choose and test a model endpoint, and
|
|
83
|
+
`proofix --check-endpoint` to see which one proofix will use. The endpoint
|
|
84
|
+
is configured as for stylefix: `--url`/`--model`,
|
|
85
|
+
`PROOFIX_LLM_URL`/`_MODEL`/`_KEY`, `~/.config/proofix/config.toml`, then
|
|
86
|
+
the shared `ADJUDICATE_LLM_*` and `~/.config/adjudicate/config.toml`; with
|
|
87
|
+
nothing configured, a local Ollama if one is running. A `--url` or
|
|
88
|
+
`PROOFIX_LLM_URL` drops keys set in lower layers; set `PROOFIX_LLM_KEY` (or
|
|
89
|
+
`api_key_env` in the same config file) alongside it. Without a model, tiers
|
|
90
|
+
0 and 1 still apply; tier 2's fixes are listed for review, tier 3 is skipped
|
|
91
|
+
and sentences are not checked for commas. See
|
|
92
|
+
[adjudicate](https://github.com/AndrewBroz/adjudicate#choosing-the-model-endpoint)
|
|
93
|
+
for the config table. `STYLEFIX_LLM_*` no longer configures proofix; use the
|
|
94
|
+
shared file or `ADJUDICATE_LLM_*` to set both tools at once.
|
|
95
|
+
|
|
96
|
+
Accept lists: `--accept FILE`, `~/.config/proofix/accept.txt`,
|
|
97
|
+
`./.proofix/accept.txt`, and stylefix's `~/.config/stylefix/accept.txt` and
|
|
98
|
+
`./.stylefix/accept.txt` are all honoured for spelling.
|
|
99
|
+
|
|
100
|
+
## Output
|
|
101
|
+
|
|
102
|
+
`<name>.proofed.md`, a report next to it, and with `--changes` a log on
|
|
103
|
+
stderr: every edit with its line, before and after, context and how it was
|
|
104
|
+
decided; the comma corrections with the model's reasons; comma suggestions
|
|
105
|
+
the guard rejected, with what the model wanted; notes on faults the model
|
|
106
|
+
noticed but is not allowed to fix (comma splices, agreement errors, a
|
|
107
|
+
missing closing quote); and LanguageTool matches with no fix.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
MIT (see `LICENSE`).
|
|
112
|
+
|
|
113
|
+
## Development
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
uv sync
|
|
117
|
+
uv run pytest # LanguageTool is replayed from a fixture; the model is a stub
|
|
118
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Test
|
|
2
|
+
|
|
3
|
+
Teh committee recieved the the report , and its findings were definately clear.However the chair,who was late disagreed. We need to seperate the issues;the budget ,the timeline and the staff. "This is fine" she said . The programme was analysed by three seperate teams..
|
|
4
|
+
|
|
5
|
+
The committee, decided to postpone the vote. The report, which was published in May was ignored. It was late, we went home anyway. See `recieved` in code and [teh link](http://x.y/teh).
|
|
6
|
+
|
|
7
|
+
Third-party auditors and third-party monitors are needed. Every third party risk assessor must be third-party certified.
|
|
8
|
+
|
|
9
|
+
Monitor, detect and correct **unsanctioned actions** — see <config>.
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
.TH PROOFIX 1 "September 2026" "proofix 0.5.0" "User Commands"
|
|
2
|
+
.SH NAME
|
|
3
|
+
proofix \- fix typos and punctuation in Markdown, under audit
|
|
4
|
+
.SH SYNOPSIS
|
|
5
|
+
.B proofix
|
|
6
|
+
.I input.md
|
|
7
|
+
.RI [ options ]
|
|
8
|
+
.br
|
|
9
|
+
.B proofix
|
|
10
|
+
.RB [ \-\-setup " | " \-\-check\-endpoint ]
|
|
11
|
+
.SH DESCRIPTION
|
|
12
|
+
.B proofix
|
|
13
|
+
corrects typos and punctuation in a Markdown file. Every change is one
|
|
14
|
+
bounded, logged, reasoned edit; the model never rewrites prose. Run it
|
|
15
|
+
after
|
|
16
|
+
.BR stylefix (1).
|
|
17
|
+
.PP
|
|
18
|
+
Five tiers, numbered as in \-\-help and the README:
|
|
19
|
+
.TP
|
|
20
|
+
.B 0 hygiene
|
|
21
|
+
Text that renders fine but is not what it looks like. HTML entities that
|
|
22
|
+
Markdown can carry as plain characters (  is a space, " a quote,
|
|
23
|
+
— a dash) are decoded; entities that would change Markdown's parsing
|
|
24
|
+
(<, >, &) or carry meaning ( ) are left alone and reported.
|
|
25
|
+
Zero-width spaces, byte-order marks, soft hyphens and control characters
|
|
26
|
+
are removed. Windows line endings and decomposed accents are normalised
|
|
27
|
+
first. Every change is logged.
|
|
28
|
+
.TP
|
|
29
|
+
.B 1 mechanical
|
|
30
|
+
A space before a comma or period, a missing space after one, doubled
|
|
31
|
+
punctuation, doubled words, known misspellings. Found by LanguageTool's
|
|
32
|
+
single-answer rules and the typos tool; applied outright.
|
|
33
|
+
.TP
|
|
34
|
+
.B 2 adjudicated
|
|
35
|
+
Unknown words and grammar rules with candidate fixes. LanguageTool
|
|
36
|
+
proposes; a language model picks one or KEEP from the sentence and the rule's
|
|
37
|
+
message.
|
|
38
|
+
.TP
|
|
39
|
+
.B 3 compounds and consistency
|
|
40
|
+
How a compound is written: closed, hyphenated or open ("cyberattack",
|
|
41
|
+
"non-profit", "long term"), and terms the document capitalises two ways.
|
|
42
|
+
Candidates come from the dictionaries: an open or hyphenated pair whose
|
|
43
|
+
closed form is a word, a non-word that splits into two words, or anything
|
|
44
|
+
the document writes two ways. The model chooses closed, hyphenated, open
|
|
45
|
+
or KEEP, told which dictionary rules (Merriam-Webster for US, Oxford for
|
|
46
|
+
UK) and that a compound modifier before a noun is hyphenated while a noun
|
|
47
|
+
phrase is open, so "a third party" survives and "third party assessors"
|
|
48
|
+
does not.
|
|
49
|
+
.TP
|
|
50
|
+
.B 4 commas
|
|
51
|
+
Comma placement, which no rule engine detects. The model returns the
|
|
52
|
+
sentence with commas corrected; a diff guard admits only insertions and
|
|
53
|
+
deletions of commas and rejects anything else. Comma splices and other
|
|
54
|
+
faults the model notices are reported as notes, not changed. Serial
|
|
55
|
+
commas are left to stylefix's style guide.
|
|
56
|
+
.PP
|
|
57
|
+
Code, link targets, URLs, HTML and front matter are never touched.
|
|
58
|
+
LanguageTool runs twice: mechanical fixes first, then judgement calls on
|
|
59
|
+
the cleaned text.
|
|
60
|
+
.SH OPTIONS
|
|
61
|
+
.TP
|
|
62
|
+
.BI \-o ", " \-\-output " FILE"
|
|
63
|
+
Default: the input name with .proofed before the extension.
|
|
64
|
+
.TP
|
|
65
|
+
.BR \-i ", " \-\-in\-place
|
|
66
|
+
Overwrite the input.
|
|
67
|
+
.TP
|
|
68
|
+
.BR \-\-target " {us|uk}"
|
|
69
|
+
Variety the document is written in. Default us.
|
|
70
|
+
.TP
|
|
71
|
+
.BI \-\-accept " FILE"
|
|
72
|
+
Extra words never flagged as misspelled. ~/.config/proofix/accept.txt,
|
|
73
|
+
\&./.proofix/accept.txt and stylefix's accept lists are also honoured.
|
|
74
|
+
.TP
|
|
75
|
+
.B \-\-no\-lt
|
|
76
|
+
Skip LanguageTool: its tier 1 fixes (typos still runs) and all of tier 2.
|
|
77
|
+
.TP
|
|
78
|
+
.BR \-\-lt\-level " {default|picky}"
|
|
79
|
+
LanguageTool rule level.
|
|
80
|
+
.TP
|
|
81
|
+
.B \-\-no\-typos
|
|
82
|
+
Skip the typos pre-pass.
|
|
83
|
+
.TP
|
|
84
|
+
.B \-\-no\-hygiene
|
|
85
|
+
Skip the hygiene tier.
|
|
86
|
+
.TP
|
|
87
|
+
.B \-\-no\-consistency
|
|
88
|
+
Skip the compounds and consistency tier.
|
|
89
|
+
.TP
|
|
90
|
+
.BI \-\-style " GUIDE"
|
|
91
|
+
Style guide, used only for its hyphenation habit: ap hyphenates less.
|
|
92
|
+
.TP
|
|
93
|
+
.BR \-\-commas " {gated|all|none}"
|
|
94
|
+
Which sentences the comma tier sends to the model. gated (default): those
|
|
95
|
+
with a comma, an introductory opener, a clause trigger, or clauses joined
|
|
96
|
+
by a conjunction. all: every sentence. none: skip the tier.
|
|
97
|
+
.TP
|
|
98
|
+
.B \-\-no\-commas
|
|
99
|
+
Same as
|
|
100
|
+
.BR "\-\-commas none" .
|
|
101
|
+
.TP
|
|
102
|
+
.BI \-\-max\-sentences " N"
|
|
103
|
+
Cap on sentences sent to the comma tier.
|
|
104
|
+
.TP
|
|
105
|
+
.BR \-\-optional\-commas " {leave|add}"
|
|
106
|
+
Commas that are optional by convention: leave as written (default) or
|
|
107
|
+
add.
|
|
108
|
+
.TP
|
|
109
|
+
.BR \-\-llm " {auto|ollama|none}"
|
|
110
|
+
.B auto
|
|
111
|
+
(default) uses the endpoint from, highest first, the flags below,
|
|
112
|
+
.BR PROOFIX_LLM_* ,
|
|
113
|
+
.IR ~/.config/proofix/config.toml ,
|
|
114
|
+
.B ADJUDICATE_LLM_*
|
|
115
|
+
and
|
|
116
|
+
.IR ~/.config/adjudicate/config.toml ,
|
|
117
|
+
or else a local Ollama with a model pulled, or else no model.
|
|
118
|
+
.B ollama
|
|
119
|
+
uses the local Ollama server only, ignoring configured endpoints.
|
|
120
|
+
.B none
|
|
121
|
+
uses no model: tier 2's fixes are listed for review, not applied, tier 3
|
|
122
|
+
is skipped and sentences are not checked for commas; tiers 0 and 1 still
|
|
123
|
+
apply.
|
|
124
|
+
.TP
|
|
125
|
+
.BI \-\-url " URL"
|
|
126
|
+
Any OpenAI-compatible base URL ending in /v1. Overrides every configured url.
|
|
127
|
+
A \-\-url or PROOFIX_LLM_URL drops keys set in lower layers; set
|
|
128
|
+
PROOFIX_LLM_KEY (or \fBapi_key_env\fR in the same config file) alongside it.
|
|
129
|
+
.TP
|
|
130
|
+
.BI \-\-model " NAME"
|
|
131
|
+
Model name at the endpoint. If no layer sets one, the server's first listed model.
|
|
132
|
+
.TP
|
|
133
|
+
.BI \-\-timeout " SEC"
|
|
134
|
+
Seconds per model request, a positive number. Default 120, or
|
|
135
|
+
\fBtimeout\fR in config.toml.
|
|
136
|
+
.TP
|
|
137
|
+
.BI \-\-min\-confidence " X"
|
|
138
|
+
Decisions below this are not applied. Default 0.8.
|
|
139
|
+
.TP
|
|
140
|
+
.BI \-\-parallel " N"
|
|
141
|
+
Concurrent model requests. Default 4.
|
|
142
|
+
.TP
|
|
143
|
+
.BI \-\-cache " FILE" ", " \-\-no\-cache
|
|
144
|
+
Decision cache, default .proofix/cache.json (commas in commas.json next to it).
|
|
145
|
+
.TP
|
|
146
|
+
.BI \-\-report " FILE" ", " \-\-no\-report
|
|
147
|
+
Markdown report, default <output>.report.md.
|
|
148
|
+
.TP
|
|
149
|
+
.B \-\-dry\-run
|
|
150
|
+
Print a diff, write nothing.
|
|
151
|
+
.TP
|
|
152
|
+
.B \-\-changes
|
|
153
|
+
Print every change to standard error as it is made.
|
|
154
|
+
.TP
|
|
155
|
+
.B \-\-setup
|
|
156
|
+
Ask where the model is (local Ollama, a hosted OpenAI-compatible API, or a
|
|
157
|
+
self-hosted server), test it, and save the answer as the
|
|
158
|
+
.B [llm]
|
|
159
|
+
table of
|
|
160
|
+
.I ~/.config/adjudicate/config.toml
|
|
161
|
+
(shared with stylefix) or
|
|
162
|
+
.IR ~/.config/proofix/config.toml .
|
|
163
|
+
An existing table is shown and replaced only on confirmation, after a
|
|
164
|
+
backup to
|
|
165
|
+
.IR config.toml.bak .
|
|
166
|
+
Needs a terminal. Ends by running the check below.
|
|
167
|
+
.TP
|
|
168
|
+
.B \-\-check\-endpoint
|
|
169
|
+
Print the endpoint proofix would use, one line per setting with the layer
|
|
170
|
+
it came from (a key is never shown), then list the server's models and
|
|
171
|
+
send one small request. Honours
|
|
172
|
+
.BR \-\-llm ", " \-\-url ", " \-\-model " and " \-\-timeout .
|
|
173
|
+
.TP
|
|
174
|
+
.BR \-v ", " \-\-verbose
|
|
175
|
+
Report model batches on standard error.
|
|
176
|
+
.TP
|
|
177
|
+
.B \-\-version
|
|
178
|
+
Print the version and exit.
|
|
179
|
+
.TP
|
|
180
|
+
.BR \-h ", " \-\-help
|
|
181
|
+
Print the usage summary and exit.
|
|
182
|
+
.SH PERFORMANCE
|
|
183
|
+
On a 20-page document (8,000 words) with a local 27B model and 8 parallel
|
|
184
|
+
requests: LanguageTool 4.5 s per pass; the comma tier 19 s for the 260
|
|
185
|
+
sentences that pass the gate; about a minute in all. Linear in length.
|
|
186
|
+
Decisions are cached by sentence.
|
|
187
|
+
.SH ENVIRONMENT
|
|
188
|
+
.TP
|
|
189
|
+
.BR PROOFIX_LLM_URL ", " PROOFIX_LLM_MODEL ", " PROOFIX_LLM_KEY
|
|
190
|
+
Endpoint, model and API key for proofix; below the flags, above the config
|
|
191
|
+
files.
|
|
192
|
+
.TP
|
|
193
|
+
.BR ADJUDICATE_LLM_URL ", " ADJUDICATE_LLM_MODEL ", " ADJUDICATE_LLM_KEY
|
|
194
|
+
The same, shared with stylefix; below
|
|
195
|
+
.I ~/.config/proofix/config.toml
|
|
196
|
+
and above
|
|
197
|
+
.IR ~/.config/adjudicate/config.toml .
|
|
198
|
+
.TP
|
|
199
|
+
.B OLLAMA_HOST
|
|
200
|
+
Ollama base URL. Default http://localhost:11434.
|
|
201
|
+
.SH FILES
|
|
202
|
+
.TP
|
|
203
|
+
.I ~/.config/proofix/config.toml
|
|
204
|
+
.TQ
|
|
205
|
+
.I ~/.config/adjudicate/config.toml
|
|
206
|
+
Table
|
|
207
|
+
.B [llm]
|
|
208
|
+
with keys
|
|
209
|
+
.BR url ", " model ", " api_key " or " api_key_env ", " timeout ", " thinking_switch .
|
|
210
|
+
The first applies to proofix only; the second is shared with stylefix.
|
|
211
|
+
.TP
|
|
212
|
+
.IR ~/.config/proofix/accept.txt ", " ~/.config/stylefix/accept.txt ", " .stylefix/accept.txt ", " .proofix/accept.txt
|
|
213
|
+
Words never flagged as misspelled, one per line.
|
|
214
|
+
.SH EXIT STATUS
|
|
215
|
+
.TP
|
|
216
|
+
.B 0
|
|
217
|
+
Finished. For
|
|
218
|
+
.BR \-\-check\-endpoint " and " \-\-setup :
|
|
219
|
+
the endpoint answers.
|
|
220
|
+
.TP
|
|
221
|
+
.B 1
|
|
222
|
+
.BR \-\-check\-endpoint " or " \-\-setup :
|
|
223
|
+
no endpoint, or it does not answer; or setup was cancelled or declined.
|
|
224
|
+
.TP
|
|
225
|
+
.B 2
|
|
226
|
+
Input file missing, LanguageTool failed, or an invalid endpoint
|
|
227
|
+
configuration (the message names the file and key). For
|
|
228
|
+
.BR \-\-setup :
|
|
229
|
+
standard input is not a terminal.
|
|
230
|
+
.SH SEE ALSO
|
|
231
|
+
.BR stylefix (1),
|
|
232
|
+
.BR languagetool (1),
|
|
233
|
+
.BR typos (1).
|
|
234
|
+
.PP
|
|
235
|
+
Full documentation: https://github.com/AndrewBroz/proofix
|