asciidoc-pubkit 0.9.0 → 1.0.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.
@@ -0,0 +1,314 @@
1
+ # English review support research and proposal
2
+
3
+ Research date: 2026-10-02. Repository inspected at `26cbb1e`, following release
4
+ 0.8.1. This document proposes future behavior; English review is not implemented.
5
+
6
+ English review is a practical extension of the existing source-mapped review
7
+ workflow. The recommended first release combines conservative English phrase
8
+ and terminology candidates, contextual review prompts, and existing mechanical
9
+ verification. Grammar engines should remain optional until their accuracy,
10
+ source offsets, installation costs, and reproducibility have been evaluated.
11
+
12
+ ## Scope and research method
13
+
14
+ The survey covers prose linters, grammar checkers, writing assistants, technical
15
+ style guides, grammatical error correction, simplification, editing benchmarks,
16
+ and model-based evaluation. Sources are official documentation, project
17
+ repositories, research publications, and author-hosted papers. Product claims
18
+ are descriptions of intended capabilities, not independently measured results.
19
+ Paper abstracts and available documentation establish the findings below;
20
+ this is not a reproduction of their experiments or a systematic review of every
21
+ publication. No external grammar tool was installed, no manuscript was sent to
22
+ one, and no model CLI was invoked. Commercial integrations and dataset licenses
23
+ have not been audited. The official ASD-STE100 site could not be retrieved, so
24
+ its current edition and requirements are not used as verified design inputs.
25
+
26
+ The requested English version is interpreted as reviewing English manuscripts,
27
+ including prose, headings, prompts, verification, and the scoring consequences.
28
+ The CLI and generated instructions already use English.
29
+
30
+ ## Product landscape
31
+
32
+ The final column contains this project's engineering assessment, rather than a
33
+ claim made by the source.
34
+
35
+ | Product or framework | Verified capability and source | Application to pubkit |
36
+ | --- | --- | --- |
37
+ | Vale | Configurable YAML style linting with document scopes; primarily style rather than general grammar. [Overview](https://docs.vale.sh/) | Closest model for terminology, configurable rules, and separating prose from headings. |
38
+ | Vale AsciiDoc support | Uses external Asciidoctor; excludes code and URLs and addresses generated text. [AsciiDoc documentation](https://docs.vale.sh/formats/asciidoc) | Useful comparison for coverage and source mapping; retain pubkit's conservative mapping and preservation baseline. |
39
+ | textlint | Pluggable rules; Markdown and plain text built in, other formats through plugins; no bundled rules. [Repository](https://github.com/textlint/textlint) | Study rule isolation and diagnostics; Node and processor dependencies make it unsuitable as the mandatory Ruby backend. |
40
+ | write-good | Explicitly naive English linting for passive voice, repeated words, weak qualifiers, wordiness, and clichés. [Checks](https://github.com/btford/write-good#checks) | Candidate taxonomy and negative examples; avoid adopting its checks as universal defects. |
41
+ | proselint | Configurable editorial checks including clichés, hedging, terminology, and typography. [Repository](https://github.com/amperser/proselint) | Reference for phrase candidates and exceptions; necessary scientific uncertainty must survive. |
42
+ | RedPen | Technical-document proofreading with support including AsciiDoc. [Repository](https://github.com/redpen-cc/redpen) | Compare document validators and coverage; do not equate length thresholds with comprehension. |
43
+ | retext | Natural-language processing through plugins. [Repository](https://github.com/retextjs/retext) | Reference for modular language processing; not a reason to require JavaScript. |
44
+ | alex | Finds potentially insensitive or unequal wording and documents contextual limits. [Repository](https://github.com/get-alex/alex) | Optional terminology policy, with exceptions for official API names and historical quotations. |
45
+ | LanguageTool | Rule-based grammar/style infrastructure and a local HTTP server; its local basic server excludes cloud AI rules. [Developer docs](https://dev.languagetool.org/), [local server](https://dev.languagetool.org/http-server) | Strong optional grammar comparison. Evaluate local rules separately from commercial cloud behavior. |
46
+ | Harper | English grammar checker implemented in Rust with offline operation. [Repository](https://github.com/Automattic/harper) | Candidate optional local grammar backend; benchmark supported rules and interfaces before selecting it. |
47
+ | Grammarly | General grammar and writing suggestions. [Official product](https://www.grammarly.com/grammar-check) | User-experience comparison; no assumption of a suitable local, reproducible integration. |
48
+ | Hemingway | Highlights writing issues and offers grammar/tone assistance in its Plus product. [Official product](https://hemingwayapp.com/) | Compare presentation of review candidates; readability labels alone cannot validate technical meaning. |
49
+ | Acrolinx / Markup AI | Enterprise voice, style, and terminology governance; the retrieved site announces the Markup AI name. [Official site](https://www.acrolinx.com/) | Reference for audience-specific policies and glossary consistency, not an initial dependency. |
50
+
51
+ Vale should guide the static-rule design. LanguageTool and Harper should be
52
+ evaluated as optional grammar services. None of the reviewed descriptions is
53
+ evidence that a tool reproduces pubkit's particular baseline, protected-source,
54
+ and section-ID verification contract.
55
+
56
+ ## Editorial foundations
57
+
58
+ | Source | Relevant guidance | Proposed treatment |
59
+ | --- | --- | --- |
60
+ | [Google guide highlights](https://developers.google.com/style/highlights) | Clear actors, global audience, conditions before instructions, descriptive organization. | Main starting point for English technical prose criteria. |
61
+ | [Google active voice](https://developers.google.com/style/voice) | Prefers active voice but explicitly permits passive exceptions. | Inspect missing actors in context; do not ban passive voice. |
62
+ | [Google present tense](https://developers.google.com/style/tense) | Present tense for general behavior; future tense has legitimate uses. | Distinguish automatic behavior, capability, and scheduled events. |
63
+ | [Google headings](https://developers.google.com/style/headings) | Task headings and conceptual headings can coexist; sentence case is its convention. | Keep mixed heading forms as default; make capitalization a book preference. |
64
+ | [Google word list](https://developers.google.com/style/word-list) | Usage depends on product, audience, and terminology conventions. | Preserve defined terms, API names, and glossary exceptions. |
65
+ | [Microsoft verbs](https://learn.microsoft.com/en-us/style-guide/grammar/verbs) | Precise verbs and contextual exceptions to active voice. | Cross-check criteria so one publisher's preferences do not become universal rules. |
66
+ | [Federal plain language guidance](https://digital.gov/guides/plain-language) | Audience-oriented plain language guidance. | Supplement the technical guides; retain the engineering audience and required technical precision. |
67
+ | [RFC 8174](https://www.rfc-editor.org/info/rfc8174/) | Distinguishes uppercase normative keywords from ordinary lowercase usage. | Protect normative force; do not normalize MUST, SHOULD, and MAY as stylistic synonyms. |
68
+
69
+ Proposed English criteria should retain the current common principles: identify
70
+ the paragraph's purpose, actors, conditions, referents, and consequences; connect
71
+ sentences; preserve terminology and evidence; avoid invented implementation
72
+ details. English-specific additions should cover ambiguous pronouns, noun
73
+ stacks, nominalizations, wordy framing, instruction versus capability, and
74
+ appropriate voice. These are review questions, not mandatory rewrites.
75
+
76
+ ## Research foundations and limitations
77
+
78
+ The applications below are proposed adaptations. Learner essays, Wikipedia,
79
+ pedagogical texts, and chatbot answers do not establish performance on software
80
+ engineering manuscripts.
81
+
82
+ | Research | Finding relevant to this decision | Proposed application and limit |
83
+ | --- | --- | --- |
84
+ | Naber, 2003, [A Rule-Based Style and Grammar Checker](https://danielnaber.de/languagetool/download/style_and_grammar_checker.pdf) | Describes an English rule-based checker. | Historical basis for explicit grammar rules; not evidence about current LanguageTool accuracy. |
85
+ | Bryant et al., ACL 2017, [ERRANT](https://aclanthology.org/P17-1074/) | Extracts and categorizes edits between original and corrected sentences. | Use grammar error types in optional grammar evaluation, separate from contextual prose candidates. |
86
+ | [BEA 2019 shared task](https://www.cl.cam.ac.uk/research/nl/bea2019st/) | Provides grammatical error correction evaluation and error-type analysis. | Secondary grammar benchmark; record scorer version, because the official site documents a later version change. |
87
+ | Bryant et al., 2023, [Grammatical Error Correction survey](https://direct.mit.edu/coli/article/49/3/643/115846/Grammatical-Error-Correction-A-Survey-of-the-State) | Surveys GEC methods and evaluation; different scorers' F-scores are not interchangeable. | Keep grammar benchmark protocol explicit; do not label its score as manuscript readability. |
88
+ | Rao and Tetreault, NAACL 2018, [GYAFC](https://aclanthology.org/N18-1012/) | Evaluates formality, fluency, and meaning preservation separately. | Separate style preference from clarity; increased formality is not automatically an improvement. |
89
+ | Xu et al., TACL 2016, [SARI](https://aclanthology.org/Q16-1029/) | Evaluates simplification operations against source and references. | Possible development metric only; unavailable as a meaningful default score for a manuscript with no simplification references. |
90
+ | Alva-Manchego et al., ACL 2020, [ASSET](https://aclanthology.org/2020.acl-main.424/) | Covers multiple simplification transformations. | Secondary examples of splitting, paraphrasing, reordering, and deletion; technical preservation needs an additional corpus. |
91
+ | Sun et al., COLING 2020, [Document context](https://aclanthology.org/2020.coling-main.121/) | Investigates preceding and following context for simplification. | Preserve neighboring paragraphs and headings in the single review prompt. |
92
+ | Devaraj et al., ACL 2022, [Factuality in simplification](https://aclanthology.org/2022.acl-long.506/) | Finds factual errors not captured by existing evaluation metrics. | Annotate unsupported additions, omissions, and changed claims independently of readability. |
93
+ | Cardon et al., EMNLP 2022, [Linguistic annotation of ASSET](https://aclanthology.org/2022.emnlp-main.121/) | Uses linguistic annotations to analyze simplification evaluation. | Report performance by edit and candidate category, not only aggregate scores. |
94
+ | Raheja et al., Findings EMNLP 2023, [CoEdIT](https://aclanthology.org/2023.findings-emnlp.350/) | Uses task-specific editing instructions and studies composite instructions. | Make the requested review objective explicit; a rewrite model is not needed inside scan or verify. |
95
+ | Maddela et al., ACL 2023, [LENS](https://aclanthology.org/2023.acl-long.905/) | Learns a simplification evaluator from human ratings. | Candidate research comparator, requiring domain validation before use on technical prose. |
96
+ | Heineman et al., EMNLP 2023, [SALSA](https://aclanthology.org/2023.emnlp-main.211/) | Introduces fine-grained human evaluation at edit level. | Annotate whether each edit improves clarity and whether it introduces an error. |
97
+ | Cripwell et al., READI 2024, [Document simplification evaluation](https://aclanthology.org/2024.readi-1.1/) | Separates simplicity and meaning preservation at document level. | Keep sentence clarity, paragraph coherence, and preservation as distinct outcomes. |
98
+ | Alva-Manchego et al., TSAR 2025, [Readability-controlled shared task](https://aclanthology.org/2025.tsar-1.8/) | Targets CEFR levels and evaluates semantic similarity and level accuracy. | Reader-level control is a possible later feature; its educational target differs from engineering clarity. |
99
+ | Liu et al., 2023, [G-Eval](https://arxiv.org/abs/2303.16634) | Studies rubric-based LLM evaluation. | Use structured judgments and human calibration; reported NLG results do not validate pubkit's rubric. |
100
+ | Zheng et al., 2023, [MT-Bench and Chatbot Arena](https://arxiv.org/abs/2306.05685) | Examines position, verbosity, and self-enhancement biases in model judges. | Blind labels, swap comparison order, repeat trials, and compare with human judgments. |
101
+ | Bagaria et al., 2026, [Rubric artifacts](https://arxiv.org/abs/2609.02942) | Reports predictive signals in rubric wording and failures under counterfactual reversals. | Add meaning-changing counterexamples and rubric sensitivity checks. Consulted as an arXiv manuscript; it reports EMNLP 2026 acceptance. |
102
+
103
+ ## Current implementation constraints
104
+
105
+ Source inspection identifies these concrete changes before English can be enabled:
106
+
107
+ | Component | Current behavior | Required design work |
108
+ | --- | --- | --- |
109
+ | `language.rb` | Writing and review accept only `ja`. | Add English only when each public workflow has a supported implementation. |
110
+ | `settings.rb` | Defaults to MeCab; accepts Japanese prose styles and loads rules by language. | Resolve a default backend after language selection; validate language/backend/style combinations. |
111
+ | `rule_set.rb` | Strict schema includes sahen predicates and Japanese compound nouns. | Introduce an explicit English schema while keeping Japanese schema 1 valid. |
112
+ | `rules.rb` | Japanese POS values, inflection/negation handling, endings, and substring matching. | Route language-specific detectors; share masking, finding locations, allow lists, and glossary infrastructure. |
113
+ | `heading_rules.rb` | Japanese predicate morphology helps judge configured heading form. | Separate English heading analysis; retain mapped plain ATX editing and mixed forms. |
114
+ | `writing.rb` | Reads criteria by language. | Add English prose and heading criteria; review currently also calls writing-language validation. |
115
+ | `session.rb` | Constructs MeCab directly; prompt wording names Japanese; saves both prose and heading criteria. | Resolve analysis through a shared factory, parameterize language wording, and preserve saved evidence. |
116
+ | `score.rb` | Japanese evaluator rubric; density per 1,000 non-space characters. | Language-specific rubric and explicit density units/calibration. |
117
+ | `document.rb` | Validates the document's explicit language against the selected language. | Preserve mismatch errors; decide regional-tag handling explicitly. |
118
+ | CLI and package | Japanese-only help, descriptions, and tests; data glob already includes language files. | Update help, README, gem metadata, packaging checks, and language tests when implementing. |
119
+ | Development benchmark | Fixed Japanese corpus and analyzer-specific trials. | Add an English corpus and analysis identities without changing the Japanese baseline. |
120
+
121
+ Merely adding `en` to the supported list and translating the rule YAML would
122
+ leave Japanese morphology, substring false positives, scoring assumptions, and
123
+ prompt language errors in place. `replace` also uses shared settings; it needs
124
+ regression coverage even if replacement is outside the English review scope.
125
+
126
+ ## Proposed initial behavior
127
+
128
+ These commands illustrate the target interface and do not work in the current
129
+ release:
130
+
131
+ ```sh
132
+ asciidoc-pubkit review scan book.adoc --lang en
133
+ asciidoc-pubkit review prompt .pubkit/review --lang en
134
+ asciidoc-pubkit review verify .pubkit/review --lang en
135
+ asciidoc-pubkit review scan book.adoc --lang en --scope headings
136
+ asciidoc-pubkit review score book.adoc --lang en
137
+ ```
138
+
139
+ Proposed defaults: `ja` keeps MeCab/IPADIC; `en` uses a deterministic built-in
140
+ English lexical backend, with an engine name to be settled during implementation.
141
+ This is an explicit language default, not a fallback from a missing analyzer.
142
+ Reject `en` with `mecab` and Japanese style options with a specific diagnostic.
143
+ Keep `literal` as an explicitly selected limited backend, with its limitations
144
+ documented separately. Do not claim full grammar analysis for either built-in
145
+ phrase matching or literal mode.
146
+
147
+ Start with `en`; preserve spelling and regional variants by default. Do not
148
+ silently identify `en-US` or `en-GB` as `en` while discarding regional policy.
149
+ Either support these tags deliberately or report them as unsupported. Language
150
+ selection continues to follow CLI, configuration, and existing document
151
+ validation; automatic language detection is outside the first release.
152
+
153
+ ### Candidate rules
154
+
155
+ | Candidate | Initial detection proposal | Contextual exception or limit |
156
+ | --- | --- | --- |
157
+ | Glossary variant | Whole-token/phrase matching with explicit case policy. | Preserve official product names, identifiers, and legitimate distinct concepts. |
158
+ | Redundant framing | Limited phrases such as `it is important to note that`. | The phrase may introduce a real qualification; no automatic deletion. |
159
+ | Wordy expression | Limited phrases such as `due to the fact that`. | Review complete sentences; do not infer an equivalent rewrite in every context. |
160
+ | Vague degree | Phrases such as `very easy` or `significantly faster` invite evidence checks. | A stated measurement may justify the wording; do not warn on all `significantly` occurrences. |
161
+ | Repeated word | Adjacent duplicate lexical tokens. | Intentional quotations and grammatical sequences such as `had had` need exceptions. |
162
+ | Abstract referent or metaphor | Prompt criterion initially; limited high-value phrases only after annotation. | Words such as `contract`, `boundary`, and `robust` have valid technical meanings. |
163
+ | Missing actor, ambiguous pronoun, noun stack, nominalization | Contextual prompt initially; optional NLP later. | Regexes cannot reliably resolve reference or technical relationships. |
164
+ | Passive voice, hedging, modal verbs | Contextual prompt; grammar analysis may locate constructions. | Preserve justified passive voice, uncertainty, permission, obligations, and possibility. |
165
+
166
+ Use `hint` for contextual style candidates. No lexical candidate establishes an
167
+ error or authorizes replacement. Do not detect AI authorship from words such as
168
+ `delve` or `leverage`.
169
+
170
+ ### Matching and source positions
171
+
172
+ Define English lexical boundaries using an explicit contract, not the existing
173
+ Japanese substring matching or replacement's JavaScript-compatible `\b` rules.
174
+ Test apostrophes, contractions, hyphens, Unicode letters, underscores, digits,
175
+ mixed Japanese/English text, and API identifiers. Keep original text intact;
176
+ matching normalization must retain a reversible span map. Case-insensitive
177
+ search must return original surfaces and original offsets.
178
+
179
+ Continue to report one-based Unicode character columns. Every external adapter
180
+ must specify and test its offset unit, including non-BMP characters and
181
+ combining marks; byte, code-point, and UTF-16 offsets cannot be assumed equivalent.
182
+ Do not adopt an external tool's AsciiDoc parse as the authority for editable
183
+ source spans. Analyze pubkit's selected text and validate every returned span.
184
+ Masking should preserve newlines and offsets; English quotes require a deliberate
185
+ policy rather than blindly treating every quoted phrase as protected content.
186
+
187
+ If sentence segmentation is introduced, test abbreviations (`e.g.`, `Dr.`),
188
+ versions (`1.2.3`), decimals, URLs, and code spans. Count lexical tokens rather
189
+ than assuming spaces are adequate word segmentation. Phrase matching across
190
+ physical line wraps must not cross paragraph or protected-span boundaries.
191
+
192
+ ### Rules and analysis contracts
193
+
194
+ An English schema should expose language, match kind, case policy, boundary
195
+ policy, severity, question, and exceptions explicitly. Reject unknown keys and
196
+ unsupported schema versions. Preserve complete custom-rule replacement and
197
+ CLI/configuration/default precedence. Freeze resolved rules into sessions.
198
+
199
+ Factor analysis construction out of scan, headings, score, and verify. Separate
200
+ lexical tokenization from optional grammatical analysis. A future adapter should
201
+ return source spans and stable rule IDs, plus an identity containing engine,
202
+ version, dictionary/model identifiers, and effective configuration hashes.
203
+ Save relevant identity in the session and report drift during verification.
204
+ Changing the saved analysis representation needs an explicit session-schema
205
+ compatibility decision; changing the rule schema alone need not automatically
206
+ change the session schema. Existing sessions already require matching tool
207
+ version, so do not promise cross-release session compatibility without tests.
208
+
209
+ Keep one Markdown prompt, each selected paragraph once, neighboring context,
210
+ saved criteria, protected data fences, and paragraph decision tracking. Scans,
211
+ prompts, and verification remain local and never invoke a model CLI. Only the
212
+ existing explicit `review score --agent` path may invoke the configured CLI.
213
+ Keep `meaning_verified: false`, protected-content checks, exit codes, stale-source
214
+ checks, and safe session replacement. English heading edits must preserve
215
+ generated IDs as well as explicit IDs.
216
+
217
+ ### Scoring
218
+
219
+ The current character-density score is a detector-dependent indicator. Adding
220
+ English rules changes candidate density even without changing writing quality.
221
+ Initially retain an explicitly labeled within-language indicator and prohibit
222
+ cross-language score comparisons. A later per-1,000-word English metric should
223
+ have a new scoring version and an explicit token-count definition; do not
224
+ silently change `candidate-density-v1` or reuse the Japanese penalty without
225
+ calibration.
226
+
227
+ Keep optional readability ratings separate from density and detection accuracy.
228
+ Parameterize the existing sentence-clarity and paragraph-coherence rubric for
229
+ English, preserving the familiar technical audience and ordinal scale. Neither
230
+ rating proves factuality or preservation. Flesch-style or CEFR indicators may be
231
+ supplementary research outputs, but should not become release gates for software
232
+ engineering manuscripts. A technical term's length is not evidence that it is
233
+ unnecessary. [Vale's readability check](https://docs.vale.sh/checks/readability)
234
+ is a relevant implementation comparison, not a calibration for pubkit.
235
+
236
+ ## Alternatives and decision
237
+
238
+ | Approach | Advantages | Costs and limits | Recommendation |
239
+ | --- | --- | --- | --- |
240
+ | Built-in English rules and contextual prompt | Ruby installation stays simple; reproducible candidates and controlled source spans. | Limited grammar coverage; requires its own boundary rules and evaluation corpus. | First release. |
241
+ | Mandatory Vale | Mature style infrastructure and AsciiDoc support. | Additional executable/configuration, separate parsing, overlapping responsibilities. | Study and benchmark; do not make mandatory. |
242
+ | Optional LanguageTool or Harper | Reuses existing grammar checks. | Adapter work, rule selection, version drift, installation, and technical false positives. | Prototype after the initial corpus exists. |
243
+ | Mandatory spaCy or Stanza | POS, lemmas, dependencies, and sentence analysis. | Python runtime/model downloads; grammar structure is not an editorial judgment. | Later only if measured gains justify it. |
244
+ | Model-only scanning | Can judge broad context. | Nondeterminism, provider access, unstable locations, and conflicts with current invocation contracts. | Retain contextual review outside deterministic scanning. |
245
+
246
+ The NLP capabilities above are documented in
247
+ [spaCy linguistic features](https://spacy.io/usage/linguistic-features) and
248
+ [Stanza's overview](https://stanfordnlp.github.io/stanza/). Their practical cost
249
+ and benefit for this gem remain to be measured.
250
+
251
+ ## Evaluation and delivery plan
252
+
253
+ 1. Define English criteria, backend combinations, boundaries, dialect policy,
254
+ and score semantics. Implement language dispatch while keeping Japanese
255
+ behavior unchanged.
256
+ 2. Add English prose and heading criteria and an independently authored rule
257
+ set. Enable scan, prompt, and verify together, with complete saved evidence.
258
+ 3. Add English scoring and its rubric, either preserving labeled character
259
+ density or deliberately introducing a calibrated new score version. Enable
260
+ writing-language support consistently because review currently loads writing
261
+ criteria through that gate.
262
+ 4. Evaluate optional grammar adapters on the same corpus before selecting one.
263
+ Any new integration must be explicit; no cloud service becomes a default.
264
+
265
+ Proposed corpus size: 100–200 independently authored technical paragraphs,
266
+ expanded as error categories stabilize. Cover API reference, procedures,
267
+ architecture explanations, tradeoffs, failure analysis, and headings. Include
268
+ positive examples, legitimate exceptions, and difficult negatives for every
269
+ rule. Separate development and held-out documents; do not let neighboring
270
+ paragraphs from one document leak across that split. Public research datasets
271
+ are secondary comparators, not substitutes for technical prose annotations.
272
+
273
+ Annotate candidate category, exact source span, whether inspection is useful,
274
+ context, protected material, and source facts. Use two human reviewers for a
275
+ calibration subset and adjudicate disagreements. Report precision, recall, and
276
+ F-score per rule, together with false positives per 1,000 words and location
277
+ accuracy. Decide thresholds before tuning; a provisional target of at least
278
+ 90% precision for lexical hints is a project proposal, not a literature result.
279
+ Rules missing the agreed target should remain opt-in or prompt-only.
280
+
281
+ Evaluate edited text separately: sentence clarity, paragraph coherence,
282
+ information omissions, unsupported additions, substitutions, changed negation,
283
+ conditions, units, comparisons, and modal force. Include readable but wrong
284
+ edits as calibration examples. If model judges are used in explicit development
285
+ trials, blind authorship, swap pair order, repeat runs, preserve model/rubric
286
+ identity, and compare against human labels. Similarity metrics cannot replace
287
+ these preservation checks.
288
+
289
+ Regression coverage must include language/backend mismatch, regional tags,
290
+ custom rules, saved-rule immutability, analyzer drift, Unicode columns, wrapped
291
+ phrases, inline exclusions, include mappings, all-paragraph prompts, fence
292
+ lengths, stale sources, safe replacement, heading-generated IDs, and unchanged
293
+ exit codes. Add explicit checks that default workflows never invoke model CLIs
294
+ or remote services. Run the full Ruby suite with real MeCab/IPADIC to preserve
295
+ Japanese coverage, then build the gem and inspect packaged English criteria
296
+ and rules. Update README and CHANGELOG only when behavior is implemented.
297
+
298
+ ## Remaining decisions
299
+
300
+ Before implementation, settle the lexical backend's public name and supported
301
+ combinations, whether regional English tags belong in the first release, the
302
+ English custom-rule schema, score compatibility, and any session-schema changes.
303
+ Before optional integrations, measure installation/runtime costs, technical
304
+ false positives, offset units, and licensing. Keep foreign rule/data reuse
305
+ separate from conceptual inspiration: verify license and attribution requirements
306
+ before copying rule lists, style-guide prose, models, or evaluation datasets.
307
+
308
+ ## Validation of this proposal
309
+
310
+ This proposal is based on repository source inspection and linked primary-source
311
+ research. It does not change executable behavior or claim implementation
312
+ readiness from tests. Product benchmarking, external integration checks,
313
+ full-paper experimental reproduction, and dataset redistribution review remain
314
+ future work.
@@ -0,0 +1,134 @@
1
+ # Install from RubyGems
2
+
3
+ Install the CLI from [RubyGems](https://rubygems.org/gems/asciidoc-pubkit):
4
+
5
+ ```sh
6
+ gem install asciidoc-pubkit
7
+ asciidoc-pubkit --version
8
+ asciidoc-pubkit --help
9
+ ```
10
+
11
+ Ruby 3.2 or later is required. RubyGems installs the required Ruby dependencies;
12
+ no repository clone or Node.js installation is needed. MeCab and IPADIC must be
13
+ installed separately when using Japanese review or scoring in the default mode.
14
+
15
+ Inspect the document, apply explicit replacement rules, and start the review
16
+ workflow from your manuscript directory:
17
+
18
+ ```sh
19
+ asciidoc-pubkit document toc book.adoc --depth 2 --numbered
20
+ asciidoc-pubkit document info book.adoc --json
21
+ asciidoc-pubkit document check-xrefs book.adoc
22
+ asciidoc-pubkit replace check book.adoc --rules replacements.yml
23
+ asciidoc-pubkit replace diff book.adoc --rules replacements.yml
24
+ asciidoc-pubkit replace apply book.adoc --rules replacements.yml
25
+ # Start a new review baseline after completing mechanical replacements.
26
+ asciidoc-pubkit review scan book.adoc --output .pubkit/review
27
+ asciidoc-pubkit review prompt .pubkit/review --output review-prompt.md
28
+ # Ask your agent to review the prompt and edit the referenced manuscript.
29
+ asciidoc-pubkit review verify .pubkit/review --output verification.json
30
+ ```
31
+
32
+ To update an existing installation:
33
+
34
+ ```sh
35
+ gem update asciidoc-pubkit
36
+ ```
37
+
38
+ ### Use Bundler in a manuscript project
39
+
40
+ Add the gem to your project's `Gemfile` to manage its version with Bundler:
41
+
42
+ ```ruby
43
+ source 'https://rubygems.org'
44
+ gem 'asciidoc-pubkit', '~> 1.0.0'
45
+ ```
46
+
47
+ Then install dependencies and run the CLI through Bundler:
48
+
49
+ ```sh
50
+ bundle install
51
+ bundle exec asciidoc-pubkit document toc book.adoc
52
+ bundle exec asciidoc-pubkit replace diff book.adoc --rules replacements.yml
53
+ bundle exec asciidoc-pubkit replace apply book.adoc --rules replacements.yml
54
+ bundle exec asciidoc-pubkit review scan book.adoc --output .pubkit/review
55
+ bundle exec asciidoc-pubkit review prompt .pubkit/review --output review-prompt.md
56
+ bundle exec asciidoc-pubkit review verify .pubkit/review --output verification.json
57
+ ```
58
+
59
+ Commit `Gemfile` and `Gemfile.lock` in the manuscript project to keep the selected
60
+ version reproducible. Use `bundle update asciidoc-pubkit` to update it deliberately.
61
+
62
+ ## Install from source
63
+
64
+ ```sh
65
+ git clone https://github.com/cybergarage/asciidoc-pubkit.git
66
+ cd asciidoc-pubkit
67
+ bundle install
68
+ gem build asciidoc-pubkit.gemspec
69
+ gem install ./asciidoc-pubkit-1.0.0.gem
70
+ asciidoc-pubkit --version
71
+ ```
72
+
73
+ The gem name and CLI name are `asciidoc-pubkit`; the Ruby require path is
74
+ `asciidoc_pubkit`, and the namespace is `AsciidocPubkit`.
75
+
76
+ ## Run from a local checkout
77
+
78
+ Use the `run` Make target to execute the checkout without installing the
79
+ asciidoc-pubkit gem. Ruby dependencies and, for the default tokenizer, MeCab and
80
+ UTF-8 IPADIC must already be installed.
81
+
82
+ ```sh
83
+ make run ARGS="--version"
84
+ make run ARGS="review scan examples/book.adoc"
85
+ make run ARGS='review scan "manuscripts/my book.adoc"'
86
+ ```
87
+
88
+ With no `ARGS`, `make run` displays CLI help. Set `RUBY` to choose another Ruby
89
+ executable. `ARGS` is shell command-line text; quote paths containing spaces and
90
+ use only trusted arguments.
91
+
92
+ To run from a manuscript directory, select the checkout's Makefile with `-f`.
93
+ Relative manuscript paths and output paths remain relative to your current
94
+ working directory:
95
+
96
+ ```sh
97
+ make -f "$HOME/Src/asciidoc-pubkit/Makefile" run ARGS="review scan book.adoc"
98
+ ```
99
+
100
+ Use `ARGS` instead of `make review scan book.adoc`: Make interprets positional
101
+ words as build targets, not CLI arguments. Avoid `make -C` when manuscript paths
102
+ should remain relative to the current directory, because it changes directories.
103
+
104
+ ## Install the morphological analyzer
105
+
106
+ On macOS with Homebrew:
107
+
108
+ ```sh
109
+ brew install mecab mecab-ipadic
110
+ mecab -D
111
+ ```
112
+
113
+ On Ubuntu or Debian:
114
+
115
+ ```sh
116
+ sudo apt-get update
117
+ sudo apt-get install mecab mecab-ipadic-utf8
118
+ mecab -D
119
+ ```
120
+
121
+ Use a UTF-8 IPADIC dictionary. If the default dictionary is different, configure
122
+ `review.mecab_dictionary` with the IPADIC directory reported by your package
123
+ manager. UniDic and other feature layouts are rejected explicitly. MeCab and
124
+ IPADIC are separately installed dependencies, not bundled inside this gem.
125
+
126
+ The tool checks MeCab availability, dictionary encoding, and feature layout.
127
+ It never silently falls back to literal matching. To deliberately run without
128
+ morphological analysis:
129
+
130
+ ```sh
131
+ asciidoc-pubkit review scan book.adoc --tokenizer literal --output .pubkit/literal-review
132
+ ```
133
+
134
+ [Back to README](../README.md)
@@ -0,0 +1,50 @@
1
+ # List review
2
+
3
+ List review checks wording in unordered and ordered list items, including
4
+ reference-list descriptions. For example, the description following this link
5
+ is list text and is excluded from the default running-prose review:
6
+
7
+ ```adoc
8
+ * link:https://example.com/cli[CLI documentation]: printとJSON/RPCの入口を説明しています。
9
+ ```
10
+
11
+ AsciiDoc parses list items separately from ordinary paragraphs. The tool keeps
12
+ these review scopes separate to map editable text and verify preservation of
13
+ list markers, nesting, links, and inline syntax. This is a scope and preservation
14
+ choice, not a claim that list descriptions are outside the book's body or an
15
+ exclusion made to improve processing speed.
16
+
17
+ Use this optional phase when list descriptions are part of the requested review,
18
+ including a whole-book editorial pass. Omit it for an explicitly prose-only or
19
+ heading-only assignment, or when there is no eligible list text. Report omitted
20
+ and unsupported list content as unreviewed; successful prose verification does
21
+ not establish that lists were reviewed. A zero-item list scan still requires
22
+ inspection of coverage notices.
23
+
24
+ Use a separate session:
25
+
26
+ ```sh
27
+ asciidoc-pubkit review scan book.adoc --scope lists --output .pubkit/lists
28
+ asciidoc-pubkit review prompt .pubkit/lists --output lists-review.md
29
+ # Ask the reviewer to read the prompt and edit only selected list text.
30
+ asciidoc-pubkit review verify .pubkit/lists
31
+ ```
32
+
33
+ The default output directory is `.pubkit/lists`. This scope reuses prose rules,
34
+ glossary, style, analyzer, and shared writing criteria. It does not include running
35
+ prose or edit headings. Each selected item appears once with heading context;
36
+ read additional evidence separately when its technical role cannot be established.
37
+
38
+ Only exact source-mapped, single-line simple unordered or ordered item text is
39
+ editable, including supported nested outline lists. Multiline, description,
40
+ checklist, compound, ambiguous, and reused-source items remain protected with
41
+ coverage notices. List markers, nesting, structure, links, and other inline tokens
42
+ remain protected. Candidate columns include the source marker and indentation.
43
+ Session JSON retains the `paragraphs` and `paragraph_id` keys, with
44
+ `kind: list-item` and source `column`, `prefix`, and `suffix` metadata.
45
+
46
+ Default prose scanning, scoring, and mechanical replacement keep their existing
47
+ prose scope. Heading body evidence continues to omit lists. A successful verify
48
+ checks preservation and does not establish editorial completion.
49
+
50
+ [Back to README](../README.md)
@@ -0,0 +1,48 @@
1
+ # References
2
+
3
+ The shared criteria and default questions draw on the following editorial
4
+ sources. Their stylistic choices differ, including whether headings should state
5
+ conclusions. Candidate detection therefore leaves contextual judgment, document
6
+ structure, and final edits to the reviewer.
7
+
8
+ - [natural-japanese](https://github.com/coji/natural-japanese): separates mechanical
9
+ detection from contextual judgment and identifies repetitive framing. Applied
10
+ here: candidate findings feed a contextual review prompt, while phrases such as
11
+ `重要なのは` and `このように` invite inspection rather than automatic deletion.
12
+ - [yomiyasu](https://github.com/nanaism/yomiyasu):
13
+ informs evidence-based review of
14
+ metaphorical operations, distinctions between instructions and capabilities,
15
+ and separate assessment of meaning preservation and readability. Applied here:
16
+ four limited metaphor patterns and third-sentence repetition locations inform
17
+ candidate detection; the shared criteria require evidence for concrete rewrites.
18
+ - [日本語技術文書の文章規範](https://gist.github.com/k16shikano/fd287c3133457c4fd8f5601d34aa817d):
19
+ informs paragraph logic, evidence scope, and meaningful uncertainty. Applied
20
+ here: the shared criteria start from each paragraph's technical purpose and
21
+ preserve necessary conditions, uncertainty, and exact terminology.
22
+ - [AI臭い文章とは何なのか](https://speakerdeck.com/nasuvitz/ai-kusai-bunshou-toha-nanina-no-ka):
23
+ provides examples of unnecessary contrast, abstract referents, and paired short
24
+ sentences. Applied here: the shared criteria ask reviewers to inspect these
25
+ patterns in context and recover concrete referents and connected explanations.
26
+
27
+ The development evaluation adapts ideas from the following primary research;
28
+ its engineering audience, corpus, and rubric do not reproduce those benchmarks.
29
+ Research texts and datasets are not redistributed here.
30
+
31
+ - [Evaluation of Document-Level Text Simplification in Japanese](https://aclanthology.org/2026.lrec-1.85/)
32
+ (Yamashita et al., LREC 2026): separates information preservation from sentence
33
+ and document simplicity and evaluates LLM judgments against human annotations.
34
+ Its elementary-school audience and Wikipedia corpus differ from this project.
35
+ Applied here: the scoring rubric separates sentence clarity from paragraph
36
+ coherence, and the development judge evaluates fact retention independently.
37
+ - [Evaluating Factuality in Text Simplification](https://aclanthology.org/2022.acl-long.506/)
38
+ (Devaraj et al., ACL 2022): distinguishes insertion, deletion, and substitution
39
+ errors. Applied here: development trials check each source fact and report
40
+ unsupported additions and substitutions separately; a readable rewrite can
41
+ still fail preservation review.
42
+ - [Evaluating Document Simplification: On the Importance of Separately Assessing Simplicity and Meaning Preservation](https://aclanthology.org/2024.readi-1.1/)
43
+ (Cripwell et al., READI 2024): motivates separate readability and preservation
44
+ scores. Applied here: readability dimensions and preservation outcomes remain
45
+ separate in benchmark reports; the direct manuscript score makes no
46
+ preservation claim. SARI-style overlap metrics are not adopted.
47
+
48
+ [Back to README](../README.md)