asciidoc-pubkit 1.2.3 → 1.3.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.
@@ -1,7 +1,11 @@
1
1
  # English review support research and proposal
2
2
 
3
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.
4
+ 0.8.1. The original survey and proposal below describe that historical checkout.
5
+ English review is available in version 1.3.0; version 1.2.3 remains Japanese-only.
6
+
7
+ See the [implementation and book-skill assessment](#implementation-and-book-skill-assessment-2026-10-16)
8
+ for the current checkout assessment and proposed delivery sequence.
5
9
 
6
10
  English review is a practical extension of the existing source-mapped review
7
11
  workflow. The recommended first release combines conservative English phrase
@@ -9,6 +13,34 @@ and terminology candidates, contextual review prompts, and existing mechanical
9
13
  verification. Grammar engines should remain optional until their accuracy,
10
14
  source offsets, installation costs, and reproducibility have been evaluated.
11
15
 
16
+ ## Implementation status (2026-10-16)
17
+
18
+ The initial implementation is documented in [English review](english-review.md)
19
+ and [English evaluation](english-evaluation.md). The historical proposal and
20
+ pre-implementation assessments below are retained as design context, not current
21
+ command references.
22
+
23
+ - Japanese defaults and schema 1 remain unchanged; English uses exact `en`,
24
+ `english-lexical` (or explicitly selected literal matching) and strict schema 2.
25
+ - English prose, heading, list, outline and writing workflows save English
26
+ criteria and retain mechanical preservation. Session schema 3 and exact tool
27
+ version checks remain in force. Replacement still rejects English.
28
+ - Both languages retain the same candidate-density formula, with explicit units
29
+ and no cross-language quality claim. The optional English readability rubric
30
+ is separate from detection and preservation.
31
+ - The initial 120-paragraph corpus has 59 expected lexical candidates across
32
+ disjoint development/evaluation document groups. Baseline precision, recall,
33
+ F1 and location accuracy are 1.0 on these authored fixtures; they are not blind
34
+ or independently human-reviewed evidence of production quality.
35
+ - Twenty-four revision cases and an imported-judgment evaluator test readability
36
+ separately from source-fact retention. Normal tests use synthetic judgments
37
+ to validate the harness. No actual model evaluation or measured editing
38
+ improvement is claimed.
39
+ - Grammar adapters and a cybergarage-pub English review skill remain subsequent
40
+ work. The existing translation skill's source-comparison guidance was updated
41
+ separately before implementation. This gem implementation does not change
42
+ manuscript files, translation states or publishing workflows.
43
+
12
44
  ## Scope and research method
13
45
 
14
46
  The survey covers prose linters, grammar checkers, writing assistants, technical
@@ -125,8 +157,8 @@ regression coverage even if replacement is outside the English review scope.
125
157
 
126
158
  ## Proposed initial behavior
127
159
 
128
- These commands illustrate the target interface and do not work in the current
129
- release:
160
+ These commands illustrate the original target interface. They now work in the
161
+ English-capable version 1.3.0, but not in version 1.2.3:
130
162
 
131
163
  ```sh
132
164
  asciidoc-pubkit review scan book.adoc --lang en
@@ -312,3 +344,279 @@ research. It does not change executable behavior or claim implementation
312
344
  readiness from tests. Product benchmarking, external integration checks,
313
345
  full-paper experimental reproduction, and dataset redistribution review remain
314
346
  future work.
347
+
348
+ ## Implementation and book-skill assessment (2026-10-16)
349
+
350
+ Status: implementation proposal, not delivered functionality. This assessment
351
+ inspected pubkit at `628eab8` (source version 1.2.2) and the existing
352
+ cybergarage-pub skill files at working-tree base `5bf99342c2`. The latter has
353
+ unrelated local changes; no book or skill was modified. Published gem contents
354
+ and the manuscript project's installed CLI were not verified. The original
355
+ external-tool survey was not repeated.
356
+
357
+ ### Feasibility and changes since the original proposal
358
+
359
+ Implement the built-in lexical approach first. The existing mapped-source,
360
+ baseline, protected-content and verification workflow is reusable. English
361
+ requires language-specific analysis and criteria rather than a second document
362
+ parser. Adding a grammar service is not a prerequisite.
363
+
364
+ The present implementation adds requirements absent from the original plan:
365
+
366
+ - `Settings` supports `prose`, `headings` and `lists`. Full English book review
367
+ must include supported list items, using the same phase boundaries and
368
+ protection rules as Japanese review.
369
+ - Heading sessions save `outline_criteria`; `Writing.outline_criteria` reads
370
+ `data/writing/<language>/outline.md`. English needs this third criteria file,
371
+ including outline diagnosis, depth limits and read-only body evidence.
372
+ - Session schema is now 3 and loading checks both schema and exact tool version.
373
+ New work must preserve this contract rather than assume old sessions migrate.
374
+ - The bundled skill is Japanese-specific, including its description, `--lang ja`
375
+ commands and contextual terminology guidance. CLI support alone would not
376
+ make the current skill an English workflow.
377
+ - `Rules.mask` turns protected spans into spaces. An English phrase matcher
378
+ that treats every whitespace run as a separator could falsely join words
379
+ across masked code or links. Preserve exclusion intervals as matching barriers,
380
+ while allowing ordinary physical line wraps within an eligible paragraph.
381
+ - `Score.run` changes top-level `score` and `score_type` when `--agent` is used.
382
+ English tests must distinguish that readability result from the retained
383
+ candidate-density fields, including empty-input behavior.
384
+
385
+ Current rejection was checked with
386
+ `bundle exec ruby -Ilib exe/asciidoc-pubkit writing criteria --lang en`:
387
+ exit 2, `Unsupported writing language "en"; supported: ja.` This is a language
388
+ gate check, not an English implementation test.
389
+
390
+ ### Recommended initial decisions
391
+
392
+ These are proposed decisions for implementation, not existing CLI contracts.
393
+
394
+ | Area | Proposed initial contract |
395
+ | --- | --- |
396
+ | Language | Support exact `en`; keep `ja` as the default. Reject `en-US` and `en-GB` explicitly until regional tags are deliberately supported. Do not infer language from prose. |
397
+ | Backend | Name the deterministic backend `english-lexical`; choose it by default for `en`. Preserve `ja` with MeCab and explicitly selected literal mode. Reject mismatched backend/language combinations before loading resources. |
398
+ | Literal mode | Keep explicit `en --tokenizer literal` as limited matching with documented case and boundary behavior, no grammatical analysis, and a distinct saved identity. It must not route into Japanese detectors. |
399
+ | Style | English initially accepts `preserve`; reject `desu-masu` and `dearu`, including inherited configuration. Regional spelling and capitalization preferences remain book-owned. |
400
+ | Headings | Default to mixed forms. Support lexical/glossary and exact sibling-duplicate candidates. Keep action/nominal classification as prompt guidance; reject unsupported English rule options rather than pretending Japanese morphology can implement them. |
401
+ | Rules | Preserve Japanese schema 1. Introduce an English schema 2 with explicit `language: en`, stable IDs, match kind, case/boundary policy, severity, question and exceptions. Dispatch by schema and validate against the selected language. Specify a separate compatible English heading schema as well. |
402
+ | Sessions | Aim to retain schema 3 only if saved settings and analysis identity fit its existing semantics and all validators can handle them. Otherwise bump the schema explicitly. Retain exact-version rejection and do not migrate baselines automatically. |
403
+ | Scoring | Preserve `candidate-density-v1` arithmetic and character denominator, explicitly label units and lack of English calibration. Compare only the same language, rule set and analysis identity. Do not introduce word-based penalties or claim Japanese/English comparability. |
404
+ | External engines | Defer grammar adapters and model-based scanning. Only explicit `review score --agent` may invoke a model CLI. |
405
+
406
+ The English schema should initially admit literal token/phrase rules and a
407
+ dedicated repeated-word rule, not unrestricted executable rules or a broad NLP
408
+ DSL. Define matching semantics before publishing the schema. Required examples
409
+ include `can` versus `can't`, ASCII versus curly apostrophes, `foo_bar`,
410
+ hyphenated terms, versions, mixed scripts, combining marks and emoji before a
411
+ match. Preserve source surfaces and Unicode character offsets. Avoid whole-text
412
+ normalization unless it provides an exact source-span map. Repeated words must
413
+ not match across punctuation, protected spans or paragraph boundaries; legitimate
414
+ sequences such as `had had` need explicit exceptions and context review.
415
+
416
+ Use `hint` for English lexical candidates, including glossary variants whose
417
+ concept identity requires judgment. Start with a small independently authored
418
+ phrase set. Treat vague degree, passive voice, pronouns and noun stacks as
419
+ prompt criteria until annotated evidence supports a useful detector.
420
+
421
+ ### Implementation units and acceptance evidence
422
+
423
+ | Unit | Owning code and resources | Acceptance evidence |
424
+ | --- | --- | --- |
425
+ | 1. Language-neutral dispatch | `language.rb`, `settings.rb`, `morphology.rb`; new shared analysis factory; call sites in `session.rb`, `rules.rb`, `heading_rules.rb`, `score.rb` | Existing Japanese behavior and explicit literal mode pass real MeCab/IPADIC tests. Incomplete English workflows stay unavailable. |
426
+ | 2. English matching | New lexical backend and English rule validator/detectors; `rule_set.rb`; `data/review-rules.en.yml`, `data/heading-rules.en.yml` | Boundary, case, exceptions, inline barriers, line wraps, Unicode locations, custom-rule replacement and identity drift tests pass. |
427
+ | 3. Complete review workflows | `writing.rb`, `session.rb`, language-aware heading rules; `data/writing/en/{criteria,headings,outline}.md` | Prose, headings, lists, outline/full views, diagnose/revise modes, saved criteria, all-entry prompts and generated heading IDs work together. No Japanese-only instructions leak into English prompts. |
428
+ | 4. Scoring and public interface | `score.rb`, CLI help, configuration validation, gem metadata, README and command guides | English rubric, explicit units, zero eligible prose, custom rules, mock evaluator responses, and no implicit external invocation tests pass. Update language gates only with complete public paths. |
429
+ | 5. Regression and packaging | Existing review/morphology/replacement/skill tests plus English fixtures | Full suite with MeCab/IPADIC, gem build and archive inspection confirm all three English criteria files, rules and skill resources are included. Exercise `replace` shared settings without silently broadening its supported languages. |
430
+ | 6. Editorial evaluation | Independently authored technical corpus and manually reviewed pilot copies | Report per-rule useful-candidate precision, difficult negatives and exact location accuracy separately from preservation, fluency and translation fidelity. Do not claim measured quality from regression success. |
431
+
432
+ Keep these as focused implementation commits, with the public language gate
433
+ enabled only when the complete supported interface is ready. Session verification
434
+ must use the shared factory and engine-neutral drift diagnostics; the present
435
+ message assumes every drift is a MeCab version/dictionary change. Prompt creation
436
+ must remain independent of analyzer availability.
437
+
438
+ The initial technical corpus should include API descriptions, procedures,
439
+ architecture, limitations, headings and simple lists. Use document-level splits
440
+ and predeclare the useful-candidate threshold before tuning. The earlier 90%
441
+ precision target remains provisional; a small pilot cannot establish general
442
+ English review quality. Public gem fixtures should be independently authored;
443
+ book excerpts and private review artifacts stay in the manuscript project.
444
+
445
+ ### Proposed cybergarage-pub English review skill
446
+
447
+ Add a project-owned
448
+ `.agents/skills/review-english-technical-book/SKILL.md` after an English-capable
449
+ CLI is available through the project's chosen invocation. Suggested description:
450
+
451
+ > Review and revise an existing English AsciiDoc technical book with
452
+ > asciidoc-pubkit in separate verified heading, prose, and list sessions. Use for
453
+ > English proofreading and outline diagnosis; translation fidelity and release
454
+ > readiness remain with the English-edition workflow.
455
+
456
+ Keep the entrypoint concise. Add `references/review-workflow.md` only for the
457
+ substantial phase/resumption and translation handoff details. Do not copy the
458
+ Japanese skill's term-specific examples or create another English criteria
459
+ library: canonical English prose, heading and outline criteria belong in pubkit
460
+ and are frozen in each generated session prompt. Book-specific US spelling,
461
+ glossary, technical evidence and records remain in the book.
462
+
463
+ The existing skills have distinct responsibilities:
464
+
465
+ | Owner | Responsibility after the addition |
466
+ | --- | --- |
467
+ | pubkit bundled `review-asciidoc-manuscript` | General mapped-source review workflow. Generalize its language selection and condition Japanese-specific guidance when English ships; preserve managed registration protections. |
468
+ | cybergarage-pub `review-japanese-technical-book` | Existing Japanese project workflow; do not redirect it to English or remove Japanese criteria routing. |
469
+ | New `review-english-technical-book` | English editorial review of existing manuscripts, with project state, scope and checks. Works for English originals as well as translations. |
470
+ | Existing `publish-english-edition` | Japanese source baseline, translation fidelity, reference localization, translated assets, edition state and release checks. Invoke the English review workflow only for the assigned editorial pass. |
471
+
472
+ The new workflow should:
473
+
474
+ 1. Inspect the target's instructions, working tree, entrypoint, existing review
475
+ records and, for translated editions, manifest/glossary/style guide. Check the
476
+ exact installed CLI version and English capabilities. Do not silently use
477
+ `--lang ja`, substitute literal mode, install another tool or reset a session
478
+ when English support is missing; report the dependency limitation.
479
+ 2. Default a full review to headings, prose, then supported lists. Honor focused
480
+ and diagnosis-only requests. For each phase, scan with `--lang en` into an
481
+ unused session, generate its prompt before editing, review every selected
482
+ entry with neighboring context, record decisions and verify before scanning
483
+ the next phase. Use explicit `--only` only for a limited assignment.
484
+ 3. Preserve mapped spans, protected content and exact permitted heading anchors.
485
+ Record out-of-scope table, image, caption and complex-list concerns separately.
486
+ A full review of the supported scopes is not review of every visible artifact.
487
+ 4. Preserve obligations, permission, uncertainty, negation, quantities and actors.
488
+ Record the actual alternative and reason for each assigned decision. Do not
489
+ ban passive voice or technical words and do not use lexical clues to infer
490
+ AI authorship. Keep unsupported factual corrections pending.
491
+ 5. For translations, compare edited passages against the immutable Japanese
492
+ source through the existing translation workflow. A passing English baseline
493
+ does not establish fidelity to Japanese. Do not advance an artifact to
494
+ `reviewed` without the existing source-comparison and technical checks, or to
495
+ `complete`/`ready` without its applicable build and release checks. Reassess
496
+ affected prior evidence after edits without resetting unrelated records.
497
+ 6. Report phase results, reviewed/pending IDs, applied and unapplied proposals,
498
+ scope exclusions, translation-check status and project checks separately.
499
+ Keep `meaning_verified: false`; do not claim publication readiness from it.
500
+
501
+ Two inspected English editions (`ai-codex-en` and `ai-agent-en`) declare
502
+ `:lang: en`, while their translation manifests declare `target_language: en-US`
503
+ and `epub_language: en`. The shared manifest template uses the same distinction.
504
+ Thus the proposed exact `en` CLI can serve these examples without rewriting
505
+ their US-English policy. This is not a repository-wide language audit. A target
506
+ actually declaring `:lang: en-US` needs explicit regional support or a separately
507
+ agreed metadata decision; do not override parser attributes to hide the mismatch.
508
+
509
+ When implementing the skill, update cybergarage-pub's root routing instructions,
510
+ human-facing README and the existing translation-review reference to distinguish
511
+ standalone English proofreading from translation/edition work. Do not make a
512
+ translation manifest mandatory for an English-original manuscript. The custom
513
+ project skill is not an editable copy of the gem-managed skill; do not overwrite
514
+ it with `skill install` or alter registration hashes.
515
+
516
+ Validate the new skill's frontmatter and reference links, then exercise diagnosis,
517
+ scoped revision, full three-phase review, unsupported CLI, existing-session
518
+ resumption and translated-edition handoff on isolated fixtures. Verify that
519
+ review success cannot promote translation or publication state by itself. Run a
520
+ small authorized book pilot only after the CLI/package checks pass; keep pilot
521
+ quality findings distinct from mechanical checks.
522
+
523
+ ### Delivery recommendation and validation of this assessment
524
+
525
+ First consider the existing translation-skill improvements below; they do not
526
+ depend on English CLI support. Then settle the contracts above, implement and validate pubkit,
527
+ make the validated version available to the manuscript project, add the project
528
+ skill and routing, then evaluate a scoped English-book pilot. Avoid installing a
529
+ discoverable skill that advertises unsupported `--lang en` review. An interim
530
+ manual editorial pass, if requested, must be labeled as manual review without
531
+ pubkit's English baseline verification.
532
+
533
+ This assessment changes documentation only. Source inspection, the current
534
+ English-language rejection check and documentation checks do not validate future
535
+ English behavior. No implementation, skill installation, manuscript review,
536
+ grammar-engine evaluation, model evaluation, package release or publication was
537
+ performed.
538
+
539
+ ## Earlier adoption in the existing translation skill (2026-10-16)
540
+
541
+ Recommendation: incorporate a small source-comparison procedure into
542
+ cybergarage-pub's existing `publish-english-edition` before implementing English
543
+ pubkit support or adding a standalone English review skill. This section assesses
544
+ that change; it does not apply it. The existing skill, translation/review and
545
+ setup references, style template, and translation/review prompt templates were
546
+ inspected. No changes to those skill files were present in the inspected diff.
547
+
548
+ The skill already requires source fidelity, retained confidence, natural US
549
+ English, terminology consistency, immutable Japanese baselines, and separate
550
+ review/build gates. Its principal gap is operational detail for comparing
551
+ English wording against those requirements. Supplement the existing review
552
+ procedure rather than introduce a second translation workflow or state model.
553
+
554
+ ### What can be adopted now
555
+
556
+ | Research finding | Existing coverage and proposed addition |
557
+ | --- | --- |
558
+ | Clear actors and referents | Natural English is required, but actor selection is not explained. Compare the source actor, action, object and pronoun referents with the target. Supply an English subject only when the source or established context supports it; record ambiguity instead of inventing responsibility. |
559
+ | Conditions and modal force | Confidence and qualifications are already protected. Make comparison concrete: negation, condition scope, capability versus permission, obligation versus recommendation, quantified comparisons, units and uncertainty. Do not treat `can`, `may`, `must` and `should` as interchangeable stylistic choices or automatically introduce uppercase normative keywords. |
560
+ | Contextual voice and tense | Preserve justified passive voice when the actor is unknown, irrelevant or deliberately unstated. Prefer an explicit actor when supported and useful. Distinguish general behavior from a future plan without converting the latter into an existing capability. |
561
+ | Wordiness and nominalization | Compare a more direct alternative against the full source proposition. Remove framing only when it carries no qualification or discourse function. Keep established technical noun phrases; do not replace terminology merely because a shorter ordinary word exists. |
562
+ | Paragraph coherence | Read adjacent source and target paragraphs and headings. Check that connectors express the same causal, conditional or contrastive relationship. Do not insert a plausible causal explanation absent from the source. |
563
+ | Heading purpose | Compare a heading with its source and section body. Retain appropriate task and conceptual forms; use the book's capitalization policy. Do not impose imperative headings, a universal length limit, or sentence case across existing projects. |
564
+ | Evidence-based evaluation | Separate fluency, fidelity and structural findings. For a material proposed revision, record the source/target locations, supported alternative, reason and disposition in existing review evidence. A readable target can still omit a condition or strengthen a claim. |
565
+
566
+ Apply these checks to assigned prose, headings, list text, table text and
567
+ reader-visible labels where the translation assignment includes them. The
568
+ current translation workflow is not limited to pubkit's mapped prose scopes;
569
+ do not import those exclusions and accidentally leave translated tables or
570
+ diagrams unreviewed. Retain artifact-specific structure and diagram checks.
571
+
572
+ ### Boundaries and conflicts to resolve
573
+
574
+ - Preserve the current paragraph-boundary and AsciiDoc-structure requirements.
575
+ Sentence-level wording can improve within those boundaries. Splitting or
576
+ merging paragraphs, moving sections and adding explanations require separately
577
+ assigned work; simplification research does not authorize such changes.
578
+ - Source comparison remains mandatory. Technical discrepancies continue through
579
+ the existing source-defect procedure; English polishing must not silently
580
+ repair the Japanese source or replace its claims with new implementation facts.
581
+ - Keep these as contextual review questions, not banned-word lists, mandatory
582
+ active-voice rules, automatic replacements or claims of AI authorship.
583
+ - Do not add `--lang en` commands, an English analyzer prerequisite, numeric
584
+ quality gates, or claims of pubkit verification before the implementation exists.
585
+ Grammar engines, readability scoring and research benchmark thresholds remain
586
+ outside this early skill update.
587
+ - Preserve existing `translated`, `reviewed`, `complete` and `ready` requirements.
588
+ No new status columns or automatic promotion follows from checking the added
589
+ editorial questions. Prompt instructions cannot establish publication readiness.
590
+
591
+ ### Minimal change set for a subsequent implementation
592
+
593
+ | Existing skill file | Proposed change |
594
+ | --- | --- |
595
+ | `references/translation-and-review.md` | Own the concise source-to-target comparison procedure and contextual exceptions, next to the existing Review section. This is the main change. |
596
+ | `SKILL.md` | Add a short route to that procedure for translation and review; retain the current purpose, source ownership and completion model. |
597
+ | `assets/translate-adoc-prompt.md` | Route to the procedure for source-supported subjects, modality and connections. Replace the unqualified final demand for “publication-ready AsciiDoc” with valid translated AsciiDoc subject to the existing review/build gates. |
598
+ | `assets/review-adoc-prompt.md` | Route to the same procedure; request source/target evidence for material findings and distinguish fluency from fidelity and structural checks. |
599
+ | `assets/style-guide-template.md` | At most add a short reference to the common procedure. Keep locale, punctuation and book-owned style here; avoid copying the complete criteria. |
600
+
601
+ No change to release checks, the manifest schema, status template or discovery
602
+ metadata is needed for this limited addition. Template edits affect future
603
+ copies; do not overwrite customized prompts or style guides in existing books.
604
+ An existing book can use the revised shared procedure on its next assigned pass,
605
+ subject to that book's instructions. Earlier review results are not retroactively
606
+ validated by the new guidance.
607
+
608
+ Until pubkit supplies English criteria, keep this small translation-specific
609
+ procedure usable without installing pubkit or reading another repository by
610
+ absolute path. When English support ships, move general English wording criteria
611
+ to pubkit and retain translation fidelity, source-defect handling and edition
612
+ state in this skill. Audit the overlap then; do not copy the full research paper
613
+ survey or build a parallel general-purpose writing guide now.
614
+
615
+ Validate a subsequent update with skill frontmatter/reference checks and a small
616
+ set of independently authored bilingual cases: an omitted but recoverable actor,
617
+ an unknown actor requiring passive voice, permission versus capability, negated
618
+ conditions, future plans, legitimate technical noun phrases, and an apparently
619
+ fluent translation that omits a qualification. Include a request limited to one
620
+ file and a structural-change proposal to check scope handling. Judge actual
621
+ source/target decisions, not just whether prompt text contains these terms.
622
+ Do not claim a general translation-quality gain from this small calibration set.
@@ -0,0 +1,104 @@
1
+ # English review
2
+
3
+ Version 1.3.0 supports English; version 1.2.3 and earlier do not. Run the
4
+ selected invocation's `--version` and help before using these commands.
5
+
6
+ ```sh
7
+ asciidoc-pubkit writing criteria --lang en
8
+ asciidoc-pubkit review scan book.adoc --lang en --output .pubkit/en-prose --no-input
9
+ asciidoc-pubkit review prompt .pubkit/en-prose --lang en
10
+ asciidoc-pubkit review verify .pubkit/en-prose --lang en
11
+ asciidoc-pubkit review score book.adoc --lang en --json
12
+ ```
13
+
14
+ Use separate `--scope headings`, `prose` and `lists` sessions. Complete and
15
+ verify each phase before scanning the next phase's current sources. Heading
16
+ prompts support `--view outline`, `--mode diagnose` and selection by `--depth`.
17
+ Existing mapping, protected-source, generated-ID and baseline rules still apply.
18
+ Only exact saved heading anchor additions are permitted. Verification is
19
+ mechanical and always reports `meaning_verified: false`. English support does
20
+ not add translation fidelity checks or publication approval.
21
+
22
+ ## Language and analysis
23
+
24
+ Exact `en` selects `english-lexical`; exact `ja` retains MeCab/IPADIC. Explicit
25
+ `literal` also supports English using the same bounded lexical matching in this
26
+ release, with a distinct identity. Neither English backend provides POS tagging,
27
+ grammar correction, sentence segmentation or automatic rewriting. No model CLI
28
+ or network service runs by default. Only `review score --agent` invokes a model.
29
+ Regional tags such as `en-US` and `en-GB` are rejected rather than normalized.
30
+ Keep spelling policy in book instructions. Explicit document language must match
31
+ the selected language. English accepts `preserve` style and mixed heading forms
32
+ only; Japanese prose styles and the MeCab backend are rejected for English.
33
+ Replacement remains Japanese-only, even when review supports English.
34
+
35
+ Tokens contain Unicode letters, combining marks, numbers and underscores.
36
+ Internal straight/curly apostrophes, hyphens (ASCII, U+2010, U+2011) and dots bind
37
+ parts into a token, protecting contractions, compounds, identifiers and versions
38
+ from substring matches. Matching never normalizes the source. Case-insensitive
39
+ rules compare downcased token surfaces while retaining original spans and text.
40
+ No Unicode composition normalization or apostrophe equivalence is performed.
41
+ Columns count Unicode characters, not bytes, UTF-16 units or grapheme clusters.
42
+
43
+ Phrases may cross whitespace and physical line wraps within one selected entry.
44
+ They cannot cross punctuation, paragraphs or protected inline spans, even where
45
+ masking would leave whitespace. Ordinary English quotation marks remain reviewable;
46
+ existing AsciiDoc protected spans and Japanese quoted spans retain their exclusions.
47
+
48
+ ## English rule schema
49
+
50
+ Custom rules replace the complete default set. CLI `--rules` takes precedence
51
+ over `review.rules`, then packaged defaults; resolved rules are saved in sessions.
52
+ Japanese schema 1 remains valid for Japanese. English requires schema 2:
53
+
54
+ ```yaml
55
+ schema_version: 2
56
+ language: en
57
+ rules:
58
+ - id: wordy-expression
59
+ match: phrase
60
+ terms: [due to the fact that]
61
+ case: insensitive
62
+ boundary: lexical
63
+ severity: hint
64
+ question: Compare a direct alternative without changing the causal claim.
65
+ exceptions: []
66
+ ```
67
+
68
+ Every shown key is required; unknown keys/versions are rejected. IDs must be
69
+ unique lowercase identifiers. `match` is `phrase` or `repeated-word`; the latter
70
+ requires empty `terms`. `case` is `sensitive` or `insensitive`; `boundary` is
71
+ `lexical`, and severity is `hint`. Terms and exceptions are nonempty lexical
72
+ phrases separated by whitespace. Exceptions suppress the exact token sequence
73
+ under the rule's case policy, not a surrounding context or regex. For repeated
74
+ words they can exempt sequences such as `had had` or `that that`. Default
75
+ repeated-word exceptions also include `is is` for metalinguistic use.
76
+
77
+ English heading rule sets use the same keys plus `fixed_titles` (exact strings),
78
+ `duplicate_siblings` (boolean), and `style: mixed`. Packaged heading rules flag
79
+ only exact sibling duplicates; contextual title/body judgment lives in criteria.
80
+ Glossary variants match case-sensitive lexical phrases; unsupported punctuation
81
+ in glossary phrases is rejected. Official literals can instead remain protected
82
+ inline code. An allow entry suppresses an exact surface or a phrase-rule term
83
+ under that rule's case policy. It does not grant edit permissions.
84
+
85
+ ## Scores and preservation
86
+
87
+ Both languages use the existing character-based candidate-density formula. See
88
+ [scoring](scoring.md). Results are not calibrated measures of writing quality,
89
+ and cannot be compared across languages, rule sets or backends. English rubric
90
+ ratings keep sentence clarity and paragraph coherence separate. They do not
91
+ establish technical correctness or source-language fidelity.
92
+
93
+ Sessions retain schema 3 because settings, criteria and analysis identity fit
94
+ its existing representation. Exact tool versions still must match. The English
95
+ identity records engine, language, implementation version and boundary policy;
96
+ verification reports drift. Prompt generation uses saved criteria and findings
97
+ without constructing an analyzer. Retain old sessions with their original tool;
98
+ never rescan to hide a failed preservation check.
99
+
100
+ ## Development quality checks
101
+
102
+ See [English evaluation](english-evaluation.md) for the 120-paragraph detection
103
+ corpus, score baseline, regression gates and 24 revision calibration cases.
104
+ Detection tests and evaluator-harness tests do not prove AI editing improvement.
@@ -291,9 +291,10 @@ support is for local prose correction, not chapter reorganization.
291
291
 
292
292
  Source hashes are checked before generating a prompt. Modified sources, modified
293
293
  session artifacts, and incompatible session versions require a fresh scan.
294
- `review scan`, `review prompt`, and `review verify` accept `--lang ja`; prompt and
295
- verify check the value against the session language. A non-Japanese language in
296
- `--lang`, `review.language`, or an explicit AsciiDoc `:lang:` attribute is rejected.
294
+ `review scan`, `review prompt`, and `review verify` accept `--lang ja` or `--lang en` in version 1.3.0; prompt and
295
+ verify check the value against the session language. Unsupported languages,
296
+ regional tags and mismatched explicit AsciiDoc `:lang:` attributes are rejected.
297
+ See [English review](english-review.md) for English-specific analysis limits.
297
298
  An omitted `:lang:` attribute uses the selected review language.
298
299
 
299
300
  ### Faithful terminology comparisons
data/docs/scoring.md CHANGED
@@ -21,9 +21,15 @@ technical accuracy or meaning preservation; `meaning_verified` remains `false`.
21
21
  Scoring uses the same configuration discovery, custom rules, glossary, allows,
22
22
  style, language, base directory, include handling, and prose coverage as scanning.
23
23
  It accepts `--only`, `--config`, `--rules`, `--base-dir`, `--tokenizer`, `--style`,
24
- `--lang ja`, and repeated `--attribute` options. Excluded, unmapped, and protected
24
+ `--lang ja` or `--lang en`, and repeated `--attribute` options. Excluded, unmapped, and protected
25
25
  blocks are not prose-scored. Coverage notices remain important when interpreting
26
- a score. MeCab/IPADIC is the default; literal mode must be selected explicitly.
26
+ a score. MeCab/IPADIC is the Japanese default; English uses built-in lexical
27
+ matching. Literal mode must be selected explicitly. Both languages retain
28
+ `candidate-density-v1`: max(0, 100 - 5 * candidates * 1000 / characters),
29
+ rounded to three decimals. Characters are unmasked non-space Unicode characters.
30
+ An empty denominator produces no score. Reports explicitly label the density
31
+ unit and uncalibrated status. Compare only the same language, rules and analysis
32
+ identity; a higher score alone does not establish better prose or detection.
27
33
 
28
34
  AI evaluation requires an installed, authenticated Codex or Claude CLI, and may
29
35
  send the selected paragraph text and headings to its configured provider and
@@ -176,8 +176,8 @@ already has one. Pubkit does not prescribe or validate report filenames.
176
176
  Select the project's installed invocation, such as `asciidoc-pubkit` or
177
177
  `bundle exec asciidoc-pubkit`. Record its version. Use the author's publishing
178
178
  attributes and base directory; do not rewrite include conventions merely to
179
- make a scan succeed. The example requires Japanese review support and MeCab
180
- with UTF-8 IPADIC by default. It does not enable review in other languages.
179
+ make a scan succeed. The commands above demonstrate Japanese review with MeCab/IPADIC. Version 1.3.0 and later can instead use `--lang en` and built-in lexical
180
+ analysis; check the selected invocation before using it. See [English review](english-review.md).
181
181
 
182
182
  Adapt checks to the actual project: inspect diffs, validate local references,
183
183
  and run existing lint or build commands when requested. No particular Make
data/docs/writing.md CHANGED
@@ -33,7 +33,7 @@ automatic replacements; existing sessions retain their saved criteria.
33
33
 
34
34
  `writing criteria` prints the packaged common criteria. `writing prompt` adds
35
35
  task instructions around those same criteria. Neither command needs an AsciiDoc
36
- file, a review session, MeCab, or network access. Both accept `--lang ja` and
36
+ file, a review session, MeCab, or network access. Both accept `--lang ja` or `--lang en` in version 1.3.0 and
37
37
  `--output FILE`; output defaults to stdout, and an existing output file is never
38
38
  overwritten. The prompt asks the agent to read project instructions and evidence;
39
39
  it does not supply source facts or authorize edits. Book-specific voice and
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: review-asciidoc-manuscript
3
- description: Review and revise an existing Japanese AsciiDoc manuscript with asciidoc-pubkit in separate verified heading, prose, and list sessions; use for proofreading or outline diagnosis, not new-book authoring.
3
+ description: Review and revise an existing Japanese or English AsciiDoc manuscript with asciidoc-pubkit in separate verified heading, prose, and list sessions; use for proofreading or outline diagnosis, not new-book authoring.
4
4
  ---
5
5
 
6
6
  # Review an AsciiDoc manuscript
@@ -26,11 +26,16 @@ Use the project's installed asciidoc-pubkit invocation, with bundle exec when
26
26
  configured. Check its version and command help. Existing sessions require their
27
27
  exact saved tool version; retain earlier sessions when starting a new pass.
28
28
  Choose unused session and output paths. Never rescan to hide a failed check.
29
+ Select the manuscript language explicitly. English requires a version supporting
30
+ --lang en; do not substitute Japanese or reset old sessions when unavailable.
31
+ Use the saved English criteria; Japanese term-specific guidance below applies
32
+ only to Japanese assignments. Translation fidelity requires source evidence
33
+ and remains separate from mechanical preservation.
29
34
 
30
35
  For each assigned scope:
31
36
 
32
37
  1. Scan from the manuscript directory with --scope headings, prose or lists,
33
- --lang ja, --no-input and a unique --output session path. For an assigned
38
+ the selected --lang ja or --lang en, --no-input and a unique --output session path. For an assigned
34
39
  chapter, use --only FILE with the book entrypoint. Do not narrow a whole-book
35
40
  assignment to one file. Match the publishing parser settings.
36
41
  2. Generate review prompt before editing. Use --mode diagnose for proposals
@@ -52,7 +57,7 @@ For each assigned scope:
52
57
  the baseline. For integrity failures, preserve evidence and report the blocker.
53
58
  Finish verification before scanning the next scope's current manuscript.
54
59
 
55
- For headings containing `区別`, consult the saved heading criteria's
60
+ For Japanese headings containing `区別`, consult the saved heading criteria's
56
61
  "Distinguish comparison subjects from distinguishing actions" section when
57
62
  available. Compare the section's actual subjects and role using its body as
58
63
  read-only evidence; record the alternative even without a detector candidate.
@@ -83,11 +88,11 @@ part introductions, lists and table descriptions within the authorized assignmen
83
88
  track their dispositions or proposals in their own scopes, including protected
84
89
  content. Do not extend a focused assignment to unrelated manuscript sections.
85
90
 
86
- For `行う`, consult the saved "Distinguish operations from responsibility"
91
+ For Japanese `行う`, consult the saved "Distinguish operations from responsibility"
87
92
  comparisons before choosing an action verb or responsibility wording. Record
88
93
  the actual alternative; a detector hint is not a replacement instruction.
89
94
 
90
- For `渡す`, `受け渡す`, `受け渡し` and related inflections, use the saved
95
+ For Japanese `渡す`, `受け渡す`, `受け渡し` and related inflections, use the saved
91
96
  "Distinguish input, transmission, delegation, inheritance, and handoff"
92
97
  comparisons when the selected CLI provides them. Record each actual alternative
93
98
  and reason, including retained wording. Inspect authorized tables, figures and
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AsciidocPubkit
4
+ module Analysis
5
+ def self.build(settings)
6
+ case settings.fetch('tokenizer', 'mecab')
7
+ when 'mecab' then Morphology.new(settings)
8
+ when 'english-lexical' then EnglishLexical.new(settings)
9
+ when 'literal' then settings['language'] == 'en' ? EnglishLexical.new(settings) : nil
10
+ else raise Error, "Unsupported analysis backend: #{settings['tokenizer'].inspect}."
11
+ end
12
+ end
13
+
14
+ def self.identity(tokenizer)
15
+ tokenizer ? tokenizer.identity : { 'engine' => 'literal' }
16
+ end
17
+ end
18
+ end
@@ -14,11 +14,11 @@ module AsciidocPubkit
14
14
  document info FILE Extract book metadata
15
15
  document check-xrefs FILE Report unresolved local cross-references
16
16
  document index DIRECTORY Generate an English-title AsciiDoc index
17
- writing criteria Print the shared Japanese prose criteria
18
- writing prompt Generate a Japanese technical writing prompt
19
- review scan FILE Collect Japanese prose, headings, or list text and review candidates
20
- review score FILE Score Japanese prose; optionally use a local AI CLI
21
- review prompt SESSION Generate an English review prompt with Japanese source excerpts
17
+ writing criteria Print the shared Japanese or English prose criteria
18
+ writing prompt Generate a technical writing prompt
19
+ review scan FILE Collect Japanese or English prose, headings, or list text and review candidates
20
+ review score FILE Score Japanese or English prose; optionally use a local AI CLI
21
+ review prompt SESSION Generate an English review prompt with source-language excerpts
22
22
  review verify SESSION Compare edited sources with the saved baseline
23
23
  replace check FILE Report prose-only replacement candidates
24
24
  replace diff FILE Preview prose replacements as a unified diff
@@ -28,8 +28,8 @@ module AsciidocPubkit
28
28
  --help Show help (also supported for each command)
29
29
  --version Show the version
30
30
 
31
- Use --lang ja with writing commands and review commands. Other review and
32
- writing languages are not supported yet and return an error.
31
+ Use --lang ja (default) or en with writing commands and review commands. Other
32
+ languages and regional tags are unsupported and return an error.
33
33
  skill install and upgrade write only the selected skill directory.
34
34
  Only replace apply edits manuscripts. review score --agent explicitly invokes a
35
35
  local Codex or Claude CLI, which may connect to its configured AI service.
@@ -64,7 +64,7 @@ module AsciidocPubkit
64
64
  input_name = group == 'writing' ? '' : ((group == 'replace' || %w[scan score].include?(command)) ? ' FILE' : ' SESSION')
65
65
  opts.banner = "Usage: asciidoc-pubkit #{group} #{command} [options]#{input_name}"
66
66
  opts.on('-o', '--output PATH', group == 'review' && command == 'scan' ? 'New session directory (default: .pubkit/review, .pubkit/headings, or .pubkit/lists)' : 'New output file (default: standard output)') { |v| options[:output] = v }
67
- opts.on('--lang LANG', 'Language (ja only in this release)') { |v| options[:language] = v }
67
+ opts.on('--lang LANG', 'Language: ja (default) or en; replacement supports ja only') { |v| options[:language] = v }
68
68
  if group == 'replace'
69
69
  opts.on('--rules FILE', 'Required prh-format replacement rules (limited compatibility)') { |v| options[:rules] = v }
70
70
  opts.on('--base-dir DIR', 'Set the Asciidoctor base directory') { |v| options[:base_dir] = v }
@@ -87,7 +87,7 @@ module AsciidocPubkit
87
87
  opts.on('--config FILE', 'Use an explicit YAML configuration') { |v| options[:config] = v }
88
88
  opts.on('--rules FILE', 'Replace default review rules with a YAML rule set') { |v| options[:rules] = v }
89
89
  opts.on('--base-dir DIR', 'Set the Asciidoctor base directory') { |v| options[:base_dir] = v }
90
- opts.on('--tokenizer NAME', 'mecab (default) or literal (limited phrase matching)') { |v| options[:tokenizer] = v }
90
+ opts.on('--tokenizer NAME', 'mecab (ja default), english-lexical (en default), or explicit literal') { |v| options[:tokenizer] = v }
91
91
  opts.on('--style STYLE', 'preserve (default), desu-masu, or dearu') { |v| options[:style] = v }
92
92
  opts.on('-a', '--attribute NAME=VALUE', 'Set an Asciidoctor attribute; repeat as needed') do |v|
93
93
  key, value = v.split('=', 2)
@@ -154,7 +154,7 @@ module AsciidocPubkit
154
154
  out.puts "Scanned #{result['paragraphs']} paragraphs; found #{result['findings']} review candidates."
155
155
  out.puts "List text is excluded. Review it in a separate session with --scope lists."
156
156
  end
157
- out.puts "Tokenizer: #{result['tokenizer']}#{result['tokenizer'] == 'literal' ? ' (limited phrase matching; no morphological analysis)' : ' (UTF-8 IPADIC)'}"
157
+ out.puts "Tokenizer: #{result['tokenizer']}#{result['tokenizer'] == 'literal' ? ' (limited phrase matching; no morphological analysis)' : (result['tokenizer'] == 'mecab' ? ' (UTF-8 IPADIC)' : ' (English lexical matching; no grammar analysis)')}"
158
158
  out.puts "Coverage notices: #{result['coverage_notices']}. See document.json for limitations."
159
159
  out.puts "Review session: #{result['session']}"
160
160
  return 0