dsh-cait 1.1.3 → 1.1.6

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,145 @@ All notable changes to CAIT are documented here. The project follows
4
4
  [Semantic Versioning](https://semver.org/) and the format is based on
5
5
  [Keep a Changelog](https://keepachangelog.com/).
6
6
 
7
+ ## [1.1.6] - 2026-11-09
8
+
9
+ Review-workbench release: find and replace, a command palette, segment notes,
10
+ draft undo/redo, segment merge/split/lock, proper-name term discovery, and an
11
+ optional AI review pass that suggests fixes without writing to the document.
12
+
13
+ ### Added
14
+
15
+ - **Find and replace.** Preview every match in source/target, apply in one step,
16
+ and undo the last replacement. Confirmed segments are downgraded to review when
17
+ their target changes; TM entries are left untouched.
18
+ - **Command palette and shortcuts.** `Ctrl/Cmd+K` opens a command palette;
19
+ `Ctrl/Cmd+F` opens find and replace.
20
+ - **Segment notes.** Per-segment review comments with add, edit, and delete,
21
+ persisted in the document JSON.
22
+ - **Draft undo/redo.** Per-segment editing history with `Ctrl/Cmd+Z`,
23
+ `Ctrl/Cmd+Shift+Z`, and `Ctrl/Cmd+Y`.
24
+ - **Merge, split, and lock.** Merge adjacent text segments, split a segment at a
25
+ source offset, and lock segments against edits, confirmation, replacement,
26
+ pre-translation, propagation, and clearing.
27
+ - **Term discovery for one-off names.** Candidates now include quoted terms,
28
+ capitalized names, and Chinese proper names that occur once, in addition to
29
+ repeated n-grams. Candidates carry a type, confidence, and evidence; they are
30
+ never added to the glossary automatically.
31
+ - **AI review.** `reviewDocument` asks the configured DSH route for structured
32
+ issues (`severity`, `code`, `message`, `suggestion`) and the QA tab can jump to
33
+ a segment or fill a suggestion into the draft. `cat_review` exposes the same
34
+ pass to agents; it never writes the document.
35
+ - **Separate review route.** Settings can give AI review its own provider and
36
+ model instead of following the pre-translation route. The default still
37
+ inherits the MT route, so existing configurations keep working.
38
+
39
+ ### Changed
40
+
41
+ - Store schema v7 adds `segment.notes` and `segment.locked`; v6 data migrates in
42
+ place.
43
+ - The QA tab now separates mechanical checks (placeholders, numbers, terms,
44
+ length, residue) from model review suggestions.
45
+
46
+ ### Fixed
47
+
48
+ - Batch MT maps responses by stable segment id and rejects partial or renumbered
49
+ output instead of shifting later translations by one segment.
50
+
51
+ ## [1.1.5] - 2026-11-08
52
+
53
+ Project resources, delivery output, and TM upkeep: each document can bind its own
54
+ TM and glossary libraries, the workbench can price a job and hand off a bilingual
55
+ or XLIFF review package, and TM libraries can be merged, deduplicated, or pruned.
56
+
57
+ ### Added
58
+
59
+ - **Per-document resources.** A document can inherit the global mounts or bind its
60
+ own TM/glossary libraries and default write TM. Writes are checked against the
61
+ document scope (`NO_TM_BOUND`, `TM_NOT_MOUNTED`, `TM_NOT_BOUND`), and deleting a
62
+ library removes dangling document references.
63
+ - **Word count and leverage analysis.** `analyzeDocument` reports segments, words,
64
+ characters, translated/confirmed counts, duplicates, ICE/exact/fuzzy/new buckets,
65
+ match rate, and leverage. The workbench shows the breakdown and downloads it as
66
+ CSV or JSON.
67
+ - **Bilingual review DOCX.** Export a three-column Source/Target/Status table for
68
+ reviewers who do not use CAIT.
69
+ - **XLIFF 1.2 review packages.** Export carries the segment uid, target state, and
70
+ a note; re-import applies only segments matched by uid, XLIFF id, or a unique
71
+ source, refuses source mismatches, and reports unmatched entries.
72
+ - **TM maintenance.** Preview and confirm merge, deduplicate, and prune operations;
73
+ merges preserve the target library and optionally delete the source.
74
+
75
+ ### Changed
76
+
77
+ - Confirmations write to the document's default write TM when one is bound.
78
+ - TM lookup, glossary hits, QA term checks, and pre-translation all honor the
79
+ document's effective resource scope.
80
+
81
+ ## [1.1.4] - 2026-11-08
82
+
83
+ Brief and context: CAIT now carries a per-document translation brief and the
84
+ neighbouring source sentences into pre-translation and agent work, and lets a
85
+ reviewer undo a confirmation without losing the translation-memory record.
86
+
87
+ ### Added
88
+
89
+ - **Document brief.** Six optional fields — domain, audience, tone, notes,
90
+ do-not-translate terms, and a style sample — are stored with the document,
91
+ editable from the workbench, and injected into single and batch MT prompts.
92
+ Agents read and write it with `cat_get_brief` and `cat_set_brief`.
93
+ - **Context for agents.** `cat_get_context` returns the brief, the current
94
+ segment, its previous/next source segments, and paragraph information, so an
95
+ agent can resolve pronouns and omitted subjects before translating.
96
+ - **Context-aware batch pre-translation.** Pre-translation now sends up to eight
97
+ segments per request with the brief and neighbouring source sentences, then
98
+ falls back to one-segment calls for anything the model omits. A partial batch
99
+ no longer aborts the document.
100
+ - **Terminology status.** Glossary entries can be marked `forbidden` (never use
101
+ this rendering) or `preferred` (must use it when the source term appears).
102
+ The flags survive CSV/JSON/TBX export, CSV import, the glossary UI, and
103
+ `cat_add_terms`.
104
+ - **Risk-graded QA.** Findings are graded high / medium / low; forbidden terms
105
+ and length drift are new checks. The report returns `risks` and `riskCounts`,
106
+ and the rail can filter to segments that need attention.
107
+ - **QA panel and fixes.** A QA tab lists risk counts and findings with jump,
108
+ copy-source, clear-target, and insert-term actions. A concordance tab and
109
+ `cat_concordance` search every mounted TM for a word or phrase.
110
+ - **Undo confirmation.** `cat_unconfirm_segment` and the editor button revoke a
111
+ confirmation, keep the text as a draft, and leave TM untouched. Editing a
112
+ confirmed segment now revokes its confirmation automatically; confirming it
113
+ again updates the same TM entry.
114
+ - **Stable segment identity.** Every segment gets a `uid`; the store schema moves
115
+ to version 5 and migrates version 4 snapshots in place.
116
+ - **Bulk pre-translation cleanup.** The rail can clear every unconfirmed
117
+ pre-translated or auto-propagated target in the document after a confirmation
118
+ dialog that states the count and the MT/TM/auto breakdown. Confirmed segments,
119
+ manual drafts, and saved TM entries are left untouched.
120
+
121
+ ### Changed
122
+
123
+ - Pre-translation uses batched MT requests with per-segment fallback instead of
124
+ one request per segment.
125
+ - `getQaReport` also reports `risks` and `riskCounts`; `counts` includes
126
+ `TERM_FORBIDDEN` and `LENGTH_DRIFT`.
127
+ - `segmentView` includes `uid`; document summaries include `brief`; glossary CSV
128
+ exports use seven columns including `forbidden` and `preferred`.
129
+
130
+ ### Fixed
131
+
132
+ - Batch pre-translation now asks for stable segment ids and rejects ambiguous
133
+ positional output; a dropped, merged, or renumbered entry falls back to
134
+ one-segment calls instead of shifting later translations onto the wrong
135
+ segment.
136
+ - `cat_concordance` renders the previous/next context of a match instead of
137
+ assuming an array.
138
+ - TM and glossary toolbars now use the import/export icon in the direction the
139
+ button actually moves data; the document toolbar follows the same convention.
140
+ - The library toolbar has an explicit **default write** selector again, and the
141
+ scope checkboxes no longer silently choose which library receives new entries,
142
+ imports, exports, or clears.
143
+ - Unconfirming a segment that was just auto-unconfirmed by saving an edit is
144
+ treated as idempotent instead of showing a `NOT_CONFIRMED` error.
145
+
7
146
  ## [1.1.3] - 2026-11-07
8
147
 
9
148
  Alignment, repetition and terminology: CAIT can now build a translation memory
@@ -41,6 +180,10 @@ terminology with evidence instead of guessing.
41
180
  and never block confirming or exporting.
42
181
  - `proposeTranslation` writes only a `suggestion` plus its reason, never the
43
182
  target: an agent can propose, the user keeps the last word.
183
+ - The fuzzy-match threshold now defaults to **70%** instead of 55%: below that a
184
+ match usually shares only function words, so showing it costs review time and
185
+ saves none. Settings explains this and offers a **Reset** button that appears
186
+ only while the slider sits away from the default.
44
187
 
45
188
  ### Fixed
46
189
 
package/README.ja.md CHANGED
@@ -17,12 +17,12 @@
17
17
  <p align="center">
18
18
  <a href="https://www.npmjs.com/package/dsh-cait"><img alt="npm バージョン" src="https://img.shields.io/npm/v/dsh-cait.svg" /></a>
19
19
  <img alt="DSH 0.2.x" src="https://img.shields.io/badge/DSH-0.2.x-4d6bfe.svg" />
20
- <img alt="テスト 29 スイート" src="https://img.shields.io/badge/tests-29%20suites-brightgreen.svg" />
20
+ <img alt="テスト 41 スイート" src="https://img.shields.io/badge/tests-41%20suites-brightgreen.svg" />
21
21
  <img alt="API キー不要" src="https://img.shields.io/badge/API%20key-not%20required-6b7280.svg" />
22
22
  </p>
23
23
 
24
24
  CAIT は DSH Web UI と DSH デスクトップに CAT ワークベンチを追加します。左サイドバーの
25
- エントリから開き、ワークベンチと 15 のエージェントツールが 1 つのストアを共有するため、
25
+ エントリから開き、ワークベンチと 21 のエージェントツールが 1 つのストアを共有するため、
26
26
  ソースファイルのインポートから訳文のエクスポートまでを一通りこなせます。
27
27
 
28
28
  > **DSH `0.2.2-rc.1` で動作確認済み。** CAIT は DSH 自身のモデルルートと認証情報を
@@ -38,7 +38,7 @@ CAIT は DSH Web UI と DSH デスクトップに CAT ワークベンチを追
38
38
  | **用語を意識した編集** | 複数の用語集、ソース言語による絞り込み、インライン強調、用語のクリック挿入、用語ごとの大文字小文字の区別。 |
39
39
  | **文書ワークフロー** | タブ、閉じる / 開き直し、最近の文書の整理、同一内容の再インポート再利用、文書ごとの進捗。 |
40
40
  | **実用的な形式対応** | TXT、Markdown、DOCX、EPUB、TMX、CSV、SRT/VTT、PO、XLIFF 1.2/2.0/SDLXLIFF、HTML、JSON、XLSX、PPTX、RTF。 |
41
- | **エージェント対応** | 10 のツールが開いている文書とストアを共有するので、エージェントと並行して翻訳できます。 |
41
+ | **エージェント対応** | 21 のツールが開いている文書とストアを共有するので、エージェントと並行して翻訳できます。 |
42
42
 
43
43
  ## クイックスタート
44
44
 
@@ -56,6 +56,32 @@ Host のリビジョンをポーリングするため、エージェントによ
56
56
 
57
57
  ## 機能
58
58
 
59
+ ### 1.1.6 の新機能
60
+
61
+ - **検索と置換**:原文/訳文のプレビュー、一括適用、直前の置換の取り消し。確定済みセグメントの訳文を変更すると校閲待ちに戻ります。
62
+ - **コマンドパレット**(`Ctrl/Cmd+K`)と `Ctrl/Cmd+F` の検索置換。
63
+ - **セグメントメモ**と、セグメント内の**ドラフト undo/redo**(`Ctrl/Cmd+Z`、`Ctrl/Cmd+Shift+Z`、`Ctrl/Cmd+Y`)。
64
+ - テキストセグメントの**マージ・分割・ロック**。マージ/分割は当面 TXT と Markdown のみで、Office の段落マッピングは安全に書き戻せません。
65
+ - **一度しか出ない固有名詞の用語発見**:引用符内の用語、文中の大文字名、中国語の人名/地名/造物名を候補に含め、種類・信頼度・原文の根拠を付けます。用語集への自動追加はしません。
66
+ - **AI 校閲**:QA タブから現在の DSH モデルに構造化された提案を求め、該当セグメントへ移動したり訳文へ反映したりできます。Agent は `cat_review` を呼べますが、どちらも文書を直接書き換えません。校閲は既定で翻訳モデルに従い、設定で専用のプロバイダーとモデルを指定できます。
67
+
68
+ ### 1.1.5 の新機能
69
+
70
+ - 文書ごとに**グローバルな TM/用語集のマウントを継承するか、独自のライブラリをバインド**でき、既定の書き込み TM も指定できます。検索、用語ヒット、QA、事前翻訳、確定はすべてそのスコープに従います。
71
+ - **語数とレバレッジ分析**:セグメント、語数、文字数、重複、ICE/完全/ファジー/新規の内訳、マッチ率、レバレッジを表示し、CSV/JSON でダウンロードできます。
72
+ - CAIT を使わない校閲者向けに**バイリンガル校閲 DOCX**(原文/訳文/状態)を出力します。
73
+ - **XLIFF 1.2 校閲パッケージ**を出力・再取り込みできます。uid、XLIFF id、一意な原文で照合し、原文不一致は拒否、未一致件数を報告します。
74
+ - **TM メンテナンス**:マージ、重複排除、整理をプレビューしてから確定します。
75
+
76
+ ### 1.1.4 の新機能
77
+
78
+ - 文書ごとに**翻訳ブリーフ**(領域、読者、トーン、メモ、訳禁用語、スタイル例)を持て、MT プロンプトに注入されます。Agent は `cat_get_brief` で読み取れます。
79
+ - 事前翻訳は**1 リクエスト最大 8 セグメント**のバッチになり、ブリーフと隣接原文を送ります。モデルが返さなかったセグメントは 1 件ずつフォールバックします。
80
+ - 用語集エントリに **forbidden**(使用禁止の訳)と **preferred**(必ず使う訳)を設定でき、CSV/JSON/TBX 出力と CSV 入力で保持されます。
81
+ - QA は **high / medium / low** に分類され、禁止用語と長さドリフトの検査が加わりました。QA タブからジャンプ、原文コピー、訳文クリア、必須用語の挿入ができます。Concordance はマウント中の全 TM を検索します。
82
+ - 確定済みセグメントを**確定解除**でき、訳文と TM エントリは残ります。確定済みセグメントを編集すると自動的に `translated` に戻り、再確定で同じ TM エントリを更新します。
83
+ - セグメントレールから**未確定の事前翻訳を一括クリア**できます。実行前に件数と MT/TM/自動伝播の内訳を示し、確定済み・手動下書き・保存済み TM は対象外であることを明示します。
84
+
59
85
  ### 翻訳メモリ
60
86
 
61
87
  - id、名前、マウント状態、既定の書き込みライブラリを持つ複数の TM ライブラリ。
@@ -67,7 +93,7 @@ Host のリビジョンをポーリングするため、エージェントによ
67
93
  - `near_exact` は数字・句読点・空白を無視したキーで比較し、スコアのしきい値には
68
94
  依存しません。
69
95
  - `high_fuzzy` は `>= 0.85`、`medium_fuzzy` は `0.75–0.85`、`low_fuzzy` は
70
- `0.75` 未満(設定可能な下限、既定値 `0.55` より上)です。
96
+ `0.75` 未満(設定可能な下限、既定値 `0.70` より上)です。
71
97
  - ファジースコアは字句ベースです。文字バイグラムの Dice 72% + トークンの Jaccard 28%。
72
98
  ラテン文字は単語単位、CJK は文字単位で扱います。ステミング、同義語、意味的マッチングは
73
99
  行いません。
@@ -247,7 +273,7 @@ DSH デスクトップ(または `plugin_manager` ツールがある任意の
247
273
  plugin_manager install_bundle target: dsh-cait
248
274
  ```
249
275
 
250
- バージョンを固定するときは `dsh-cait@1.1.3`、最新版は `dsh-cait@latest` を指定します。
276
+ バージョンを固定するときは `dsh-cait@1.1.6`、最新版は `dsh-cait@latest` を指定します。
251
277
  マネージャが registry のパッケージを解決し、bundle patch を適用してプラグインを有効化します。
252
278
 
253
279
  CLI 管理のプロファイル:
@@ -349,6 +375,7 @@ dsh web --patch C:\absolute\path\to\dsh-CAIT\_dev\cait.patch.yml
349
375
  | `cat_consistency_report` | 訳文が揺れている同一原文をグループ化して一覧 |
350
376
  | `cat_term_candidates` | 用語候補の短いリスト: 頻度、例文、メモリにある既存の訳語 |
351
377
  | `cat_add_terms` | 選んだ用語を用語集へまとめて登録 |
378
+ | `cat_review` | モデルに構造化された校閲提案を求める。文書は書き換えない |
352
379
 
353
380
  そのためエージェントは UI を操作せずに文書全体を下書きできます: `cat_pre_translate` を
354
381
  `from: next` で `next` が `null` になるまで繰り返し、`cat_get_segments` で確認し、
@@ -364,7 +391,7 @@ dsh web --patch C:\absolute\path\to\dsh-CAIT\_dev\cait.patch.yml
364
391
  flowchart LR
365
392
  UI["DSH Web UI<br/>(sidebar + workbench)"] --> Client["client.js<br/>generated Web bundle"]
366
393
  Client --> API["/cait/api/rpc<br/>same-origin JSON"]
367
- Tools["15 agent tools"] --> Store["CatStore"]
394
+ Tools["21 agent tools"] --> Store["CatStore"]
368
395
  API --> Store
369
396
  Store --> Snapshot[("store.json<br/>+ sources/")]
370
397
  ```
@@ -451,7 +478,7 @@ node _dev/test-mt.mjs
451
478
 
452
479
  インポート / エクスポートのフィクスチャは `_dev/sample.docx`、`_dev/sample-table.docx`、
453
480
  `_dev/sample-format.docx` です。対応する `python _dev/make-*.py` スクリプトで再生成
454
- できます。29 スイートすべてが通るはずです。
481
+ できます。41 スイートすべてが通るはずです。
455
482
 
456
483
  ### リリース
457
484
 
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  <p align="center">
8
8
  <strong>Computer-aided translation, inside DeepSeek Harness.</strong><br/>
9
- Translation memory · glossary · segment editor · MT assistance · document tabs · Office / subtitle / localization formats
9
+ Translation memory 路 glossary 路 segment editor 路 MT assistance 路 document tabs 路 Office / subtitle / localization formats
10
10
  </p>
11
11
  <p align="center">
12
12
  <a href="README.zh-CN.md">简体中文</a> · <a href="README.ja.md">日本語</a> · <a href="README.md">English</a>
@@ -16,12 +16,12 @@
16
16
  <p align="center">
17
17
  <a href="https://www.npmjs.com/package/dsh-cait"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-cait.svg" /></a>
18
18
  <img alt="DSH 0.2.x" src="https://img.shields.io/badge/DSH-0.2.x-4d6bfe.svg" />
19
- <img alt="Tests: 29 suites" src="https://img.shields.io/badge/tests-29%20suites-brightgreen.svg" />
19
+ <img alt="Tests: 41 suites" src="https://img.shields.io/badge/tests-41%20suites-brightgreen.svg" />
20
20
  <img alt="No API key required" src="https://img.shields.io/badge/API%20key-not%20required-6b7280.svg" />
21
21
  </p>
22
22
 
23
23
  CAIT adds a CAT workbench to the DSH Web UI and Desktop. It opens from a
24
- left-sidebar entry, keeps one shared store behind the workbench and seven agent
24
+ left-sidebar entry, keeps one shared store behind the workbench and twenty agent
25
25
  tools, and covers the practical path from importing a source file to exporting a
26
26
  translated document.
27
27
 
@@ -38,7 +38,7 @@ translated document.
38
38
  | **Glossary-aware editing** | Multiple term bases, source-language filtering, inline highlighting, click-to-insert terms, and per-term case sensitivity. |
39
39
  | **A document workflow** | Tabs, close/reopen, recent-document cleanup, duplicate-import reuse, and progress per document. |
40
40
  | **Real format coverage** | TXT, Markdown, DOCX, EPUB, TMX, CSV, SRT/VTT, PO, XLIFF 1.2/2.0/SDLXLIFF, HTML, JSON, XLSX, PPTX, and RTF. |
41
- | **Agent-ready** | Seven tools share the open document and store, so an agent can translate alongside you. |
41
+ | **Agent-ready** | Twenty-one tools share the open document and store, so an agent can translate alongside you. |
42
42
 
43
43
  ## Quick start
44
44
 
@@ -57,6 +57,59 @@ manual reload.
57
57
 
58
58
  ## Features
59
59
 
60
+ ### New in 1.1.6
61
+
62
+ - **Find and replace** across source/target with a preview, one-step apply, and
63
+ undo; confirmed segments return to review when their target changes.
64
+ - **Command palette** (`Ctrl/Cmd+K`) and `Ctrl/Cmd+F` for find and replace.
65
+ - **Segment notes** for review comments, plus per-segment **draft undo/redo**.
66
+ - **Merge, split, and lock** text segments. Merge/split are limited to TXT and
67
+ Markdown until Office paragraph mapping can be written back safely.
68
+ - **Term discovery for one-off names.** Quoted terms, capitalized names, and
69
+ Chinese proper names that occur once are offered as candidates with evidence,
70
+ type, and confidence; nothing is added to the glossary automatically.
71
+ - **AI review.** The QA tab can ask the configured DSH route for structured
72
+ suggestions, jump to a segment, and fill a suggestion into the draft. Agents can
73
+ call `cat_review`; neither path writes the document. Review follows the
74
+ translation model by default, and Settings can give it a separate provider and
75
+ model.
76
+
77
+ ### New in 1.1.5
78
+
79
+ - Each document can **inherit the global TM/glossary mounts or bind its own
80
+ libraries**, with a default write TM per document. Lookup, glossary hits, QA,
81
+ pre-translation, and confirmations all honor that scope.
82
+ - **Word count and leverage analysis** reports segments, words, characters,
83
+ duplicates, ICE/exact/fuzzy/new buckets, match rate, and leverage, with CSV and
84
+ JSON download.
85
+ - Export a **bilingual review DOCX** (Source/Target/Status) for reviewers who do
86
+ not use CAIT.
87
+ - Export and re-import an **XLIFF 1.2 review package**. Re-import matches by uid,
88
+ XLIFF id, or a unique source, refuses source mismatches, and reports unmatched
89
+ segments.
90
+ - **TM maintenance** previews and confirms merge, deduplicate, and prune actions.
91
+
92
+ ### New in 1.1.4
93
+
94
+ - Each document can carry a **translation brief** — domain, audience, tone,
95
+ notes, do-not-translate terms, and a style sample — which is injected into MT
96
+ prompts and readable by agents through `cat_get_brief`.
97
+ - Pre-translation now sends **up to eight segments per request** with the brief
98
+ and neighbouring source sentences, then falls back to one segment at a time
99
+ for anything the model leaves out.
100
+ - Glossary entries can be **forbidden** (never use this rendering) or
101
+ **preferred** (must use it when the source term appears), and the flags survive
102
+ CSV/JSON/TBX export and CSV import.
103
+ - QA findings are graded **high / medium / low**, and the QA tab can jump to a
104
+ finding, copy the source, clear the target, or insert the required term. A
105
+ concordance tab searches every mounted TM for a word or phrase.
106
+ - A confirmed segment can be **unconfirmed** without deleting its text or its TM
107
+ entry; editing a confirmed segment revokes the confirmation automatically.
108
+ - The segment rail can **clear all unconfirmed pre-translated targets** in one
109
+ action. A confirmation dialog states the count and the MT/TM/auto breakdown,
110
+ and confirms that confirmed segments, manual drafts, and saved TM entries are
111
+ left untouched.
112
+
60
113
  ### Translation memory
61
114
 
62
115
  - Multiple TM libraries with id, name, mount state, and a default write library.
@@ -68,7 +121,7 @@ manual reload.
68
121
  - `near_exact` compares a key that ignores digits, punctuation, and whitespace;
69
122
  it does not depend on a score cutoff.
70
123
  - `high_fuzzy` is `>= 0.85`, `medium_fuzzy` is `0.75–0.85`, `low_fuzzy` is
71
- below `0.75` (above the configurable floor, default `0.55`).
124
+ below `0.75` (above the configurable floor, default `0.70`).
72
125
  - Fuzzy scoring is lexical: 72% character-bigram Dice + 28% token Jaccard.
73
126
  Latin text uses words; CJK text uses individual characters. There is no
74
127
  stemming, synonym, or semantic matching.
@@ -92,9 +145,10 @@ manual reload.
92
145
  only decides what the workbench searches and writes.
93
146
  - **Terminology mining**: *Mine terms from the document* in the glossary toolbar
94
147
  lists candidates with occurrence counts, sample wording from memory, and a
95
- marker when the term is already known. Counting finds the candidates and ranks
96
- them (Latin n-grams, repeated CJK substrings filtered by boundary entropy);
97
- a model only judges a shortlist, which is the part models are good at.
148
+ marker when the term is already known. Counting finds and ranks the candidates
149
+ (Latin n-grams, repeated CJK substrings filtered by boundary entropy); you
150
+ confirm the wording and add them. A model-assisted shortlist that can include
151
+ single-occurrence proper nouns is planned for 1.1.6.
98
152
 
99
153
  ### Library workspace
100
154
 
@@ -136,8 +190,13 @@ separate files in any supported format and any pair of languages.
136
190
  size of 20/50/100/200 and a box to jump straight to a segment number. Jumping
137
191
  clears the filter when the target segment would otherwise be hidden.
138
192
  - **Pre-translate** fills the whole document from exact TM matches and machine
139
- translation in small blocks, shows `done/total`, and can be stopped between
140
- blocks. Confirmed and already-translated segments are never overwritten.
193
+ translation in batches of up to eight segments, carrying the document brief
194
+ and neighbouring source sentences, and falls back to one segment at a time
195
+ when a batch response is partial. It shows `done/total` and can be stopped
196
+ between blocks. Confirmed and already-translated segments are never overwritten.
197
+ - **Translation brief** lives beside the document: domain, audience, tone, notes,
198
+ do-not-translate terms, and a style sample. It is editable from the segment
199
+ header and used by both pre-translation and agent translation.
141
200
  - **Stacked review**: source, the machine/agent baseline, and the editable target
142
201
  are laid out top to bottom, so each block gets the full pane width.
143
202
  **Confirm all** accepts every segment awaiting review after one confirmation
@@ -149,10 +208,16 @@ separate files in any supported format and any pair of languages.
149
208
  unconfirmed copy with the same source (`origin: auto`), editing a draft keeps
150
209
  them in sync, and *Fill repeated segments* does the whole document at once.
151
210
  Confirmed segments are never touched.
152
- - Advisory QA markers in the rail and an export-time summary: missing
153
- placeholders/tags, mismatched numbers, unused glossary terms, empty targets,
154
- an untouched copy of the source, and one source with several translations.
211
+ - Advisory QA markers in the rail and an export-time summary, graded **high /
212
+ medium / low**: missing placeholders/tags, mismatched numbers, unused or
213
+ forbidden glossary terms, empty targets, an untouched copy of the source,
214
+ length drift, and one source with several translations. The QA tab lists
215
+ findings and offers jump, copy-source, clear-target, and insert-term actions.
155
216
  Nothing is blocked and nothing is stored.
217
+ - **Undo confirmation.** A confirmed segment can be unconfirmed back to
218
+ `translated`; its text and TM entry stay in place. Editing a confirmed segment
219
+ revokes the confirmation automatically, and confirming it again updates the
220
+ same TM entry.
156
221
  - Document tabs; closing a tab does not delete the document.
157
222
  - **Open existing document** reopens a closed document.
158
223
  - Interface language switch in **Settings → Interface**: *Follow DSH language*
@@ -194,7 +259,10 @@ CAIT does not own an endpoint or key. The selector is built from DSH:
194
259
  - `ctx.llm.listModels(provider)` supplies model ids; CAIT selects the first model
195
260
  by default.
196
261
  - `ctx.llm.stream({ provider, model, messages, temperature, purpose: 'cait-mt' })`
197
- performs the call; CAIT concatenates `text-delta` chunks.
262
+ performs the call; CAIT concatenates `text-delta` chunks. Batch pre-translation
263
+ uses `purpose: 'cait-mt-batch'` and asks for a JSON array keyed by position;
264
+ both paths include the document brief, the neighbouring source sentences, and
265
+ the usable/forbidden glossary rules in the prompt.
198
266
 
199
267
  If no usable route exists, the selected route disappears, or it has no models,
200
268
  CAIT falls back to offline glossary substitution and says so in the UI and in the
@@ -205,21 +273,21 @@ provider/model/code/status; the client receives only `MT_PROVIDER_FAILED`.
205
273
 
206
274
  | Format | Import | Export | Notes |
207
275
  | --- | :---: | :---: | --- |
208
- | TXT / Markdown | ✅ | ✅ | Paragraph and sentence segmentation |
209
- | CSV | ✅ | ✅ | Comma, semicolon, tab, or pipe delimiter auto-detected; source/target column by header name or 1-based number; existing bilingual export |
210
- | DOCX | ✅ | ✅ | Body paragraphs; table blocks are excluded from import. Export patches the original package, keeping styles, numbering, images, headers, tables, and layout. |
211
- | EPUB | ✅ | ✅ | EPUB 3 spine order; XHTML text blocks with inline markup kept as tokens and patched back into the retained package. DRM-protected, fixed-layout, and scripted EPUBs are not supported. |
212
- | TMX 1.4 | ✅ | ✅ | Common `<tu>/<tuv>/<seg>` subset; inline markup flattened with warning; context kept in `<prop type="x-context">` |
213
- | SRT / WebVTT | ✅ | ✅ | One cue per segment, timings/settings/identifier retained; semantic tags kept; invalid ranges rejected |
214
- | PO | ✅ | ✅ | Contexts, plural forms, translator comments, obsolete `#~` entries |
215
- | XLIFF 1.2 | ✅ | ✅ | Inline tags become `{n}` tokens; missing tokens block confirmation |
216
- | XLIFF 2.0 | ✅ | ✅ | Basic `<unit><segment><source>/<target>` subset |
217
- | SDLXLIFF | ✅ | ✅ | Basic XLIFF 1.2 path; SDL-specific extensions are not round-tripped |
218
- | HTML | ✅ | ✅ | Text blocks and inline tags preserved; document CSS/layout is not rebuilt |
219
- | JSON | ✅ | ✅ | String-path subset; object/array structure preserved via a template; keys and numbers are not translated |
220
- | XLSX | ✅ | ✅ | First worksheet; `Source`/`Target` headers or columns A/B; export is a new two-column workbook |
221
- | PPTX | ✅ | ✅* | Source-preserving export; requires the imported `.pptx` package. Body text only; notes/charts/SmartArt not imported. |
222
- | RTF | ✅ | ✅ | Basic paragraphs, `\uN`, `\'hh`, control words; original styling not round-tripped |
276
+ | TXT / Markdown | 鉁?| 鉁?| Paragraph and sentence segmentation |
277
+ | CSV | 鉁?| 鉁?| Comma, semicolon, tab, or pipe delimiter auto-detected; source/target column by header name or 1-based number; existing bilingual export |
278
+ | DOCX | 鉁?| 鉁?| Body paragraphs; table blocks are excluded from import. Export patches the original package, keeping styles, numbering, images, headers, tables, and layout. |
279
+ | EPUB | 鉁?| 鉁?| EPUB 3 spine order; XHTML text blocks with inline markup kept as tokens and patched back into the retained package. DRM-protected, fixed-layout, and scripted EPUBs are not supported. |
280
+ | TMX 1.4 | 鉁?| 鉁?| Common `<tu>/<tuv>/<seg>` subset; inline markup flattened with warning; context kept in `<prop type="x-context">` |
281
+ | SRT / WebVTT | 鉁?| 鉁?| One cue per segment, timings/settings/identifier retained; semantic tags kept; invalid ranges rejected |
282
+ | PO | 鉁?| 鉁?| Contexts, plural forms, translator comments, obsolete `#~` entries |
283
+ | XLIFF 1.2 | 鉁?| 鉁?| Inline tags become `{n}` tokens; missing tokens block confirmation |
284
+ | XLIFF 2.0 | 鉁?| 鉁?| Basic `<unit><segment><source>/<target>` subset |
285
+ | SDLXLIFF | 鉁?| 鉁?| Basic XLIFF 1.2 path; SDL-specific extensions are not round-tripped |
286
+ | HTML | 鉁?| 鉁?| Text blocks and inline tags preserved; document CSS/layout is not rebuilt |
287
+ | JSON | 鉁?| 鉁?| String-path subset; object/array structure preserved via a template; keys and numbers are not translated |
288
+ | XLSX | 鉁?| 鉁?| First worksheet; `Source`/`Target` headers or columns A/B; export is a new two-column workbook |
289
+ | PPTX | 鉁?| 鉁? | Source-preserving export; requires the imported `.pptx` package. Body text only; notes/charts/SmartArt not imported. |
290
+ | RTF | 鉁?| 鉁?| Basic paragraphs, `\uN`, `\'hh`, control words; original styling not round-tripped |
223
291
 
224
292
  \* PPTX export fails with `PPTX_SOURCE_REQUIRED` when the retained source package
225
293
  is missing rather than silently producing an unformatted deck.
@@ -263,7 +331,7 @@ In DSH Desktop (or any profile with the `plugin_manager` tool):
263
331
  plugin_manager install_bundle target: dsh-cait
264
332
  ```
265
333
 
266
- Pin a release with `dsh-cait@1.1.3`, or ask for the newest one with
334
+ Pin a release with `dsh-cait@1.1.6`, or ask for the newest one with
267
335
  `dsh-cait@latest`. The manager resolves the registry package, applies the bundle
268
336
  patch, and activates the plugin — no hand-written profile rows.
269
337
 
@@ -365,8 +433,14 @@ confirmed becomes `translated` with `origin: manual`.
365
433
  | `cat_propose_translation` | Leave a suggestion plus a reason without touching the confirmed target |
366
434
  | `cat_align` | Align two texts and report high / to-review / doubtful pairs |
367
435
  | `cat_consistency_report` | Group repeated sources that carry different translations |
368
- | `cat_term_candidates` | Mining shortlist: frequency, sample sentences, existing memory wording |
436
+ | `cat_term_candidates` | Mining shortlist, including one-off proper names, with type/confidence and evidence |
437
+ | `cat_get_brief` | Read the document brief before translating |
438
+ | `cat_set_brief` | Update brief fields, or clear the whole brief |
439
+ | `cat_get_context` | Brief, current segment, previous/next sources, and paragraph around a segment |
440
+ | `cat_unconfirm_segment` | Revoke a confirmation without deleting the text or TM entry |
441
+ | `cat_concordance` | Search every mounted TM for a word or phrase in source or target |
369
442
  | `cat_add_terms` | Add accepted terminology to a library in one batch |
443
+ | `cat_review` | Ask the model for structured review suggestions; never writes the document |
370
444
 
371
445
  An agent can therefore draft a whole document without clicking in the UI:
372
446
  `cat_pre_translate` with `from: next` until `next` is `null`, then
@@ -383,7 +457,7 @@ document the user has open.
383
457
  flowchart LR
384
458
  UI["DSH Web UI<br/>(sidebar + workbench)"] --> Client["client.js<br/>generated Web bundle"]
385
459
  Client --> API["/cait/api/rpc<br/>same-origin JSON"]
386
- Tools["15 agent tools"] --> Store["CatStore"]
460
+ Tools["21 agent tools"] --> Store["CatStore"]
387
461
  API --> Store
388
462
  Store --> Snapshot[("store.json<br/>+ sources/")]
389
463
  ```
@@ -400,48 +474,48 @@ flowchart LR
400
474
 
401
475
  ```text
402
476
  cait/
403
- ├─ package.json
404
- ├─ cordis.patch.yml
405
- ├─ index.js # Host half
406
- ├─ client.js # generated Web bundle
407
- ├─ client/ # helpers, styles, RPC, components, locales, entry
408
- ├─ scripts/build-client.mjs
409
- ├─ icon.svg
410
- ├─ locale/{en,zh,ja}.json
411
- ├─ NOTICE
412
- ├─ README.md
413
- ├─ README.zh-CN.md
414
- ├─ README.ja.md
415
- ├─ CHANGELOG.md
416
- ├─ lib/
417
- │ ├─ store.js # CatStore facade + document/segment core
418
- │ ├─ errors.js
419
- │ ├─ store-utils.js
420
- │ ├─ libraries.js # TM/glossary registries + mounts
421
- │ ├─ library-view.js # Library paging/search + export entry points
422
- │ ├─ library-export.js # Glossary TBX / CSV / JSON builders
423
- │ ├─ tm.js
424
- │ ├─ glossary.js
425
- │ ├─ persistence.js
426
- │ ├─ import-export.js
427
- │ ├─ formats.js # CSV/SRT/VTT/PO/XLIFF/HTML/JSON/RTF
428
- │ ├─ html.js # Shared HTML/XHTML run scanner + patcher
429
- │ ├─ epub.js # EPUB package read / spine import / patch export
430
- │ ├─ preprocess.js # Import-time source cleaning stage
431
- │ ├─ pre-translate.js # Block pre-translation methods
432
- │ ├─ qa.js # Derived QA report (never persisted)
433
- │ ├─ xlsx.js
434
- │ ├─ pptx.js
435
- │ ├─ segmenter.js
436
- │ ├─ similarity.js
437
- │ ├─ tmx.js
438
- │ ├─ docx.js
439
- │ ├─ markdown.js
440
- │ ├─ xml.js
441
- │ ├─ mt.js
442
- │ ├─ tools.js
443
- │ └─ api.js
444
- └─ _dev/ # tests, fixtures, local patch overlay
477
+ 鈹溾攢 package.json
478
+ 鈹溾攢 cordis.patch.yml
479
+ 鈹溾攢 index.js # Host half
480
+ 鈹溾攢 client.js # generated Web bundle
481
+ 鈹溾攢 client/ # helpers, styles, RPC, components, locales, entry
482
+ 鈹溾攢 scripts/build-client.mjs
483
+ 鈹溾攢 icon.svg
484
+ 鈹溾攢 locale/{en,zh,ja}.json
485
+ 鈹溾攢 NOTICE
486
+ 鈹溾攢 README.md
487
+ 鈹溾攢 README.zh-CN.md
488
+ 鈹溾攢 README.ja.md
489
+ 鈹溾攢 CHANGELOG.md
490
+ 鈹溾攢 lib/
491
+ 鈹? 鈹溾攢 store.js # CatStore facade + document/segment core
492
+ 鈹? 鈹溾攢 errors.js
493
+ 鈹? 鈹溾攢 store-utils.js
494
+ 鈹? 鈹溾攢 libraries.js # TM/glossary registries + mounts
495
+ 鈹? 鈹溾攢 library-view.js # Library paging/search + export entry points
496
+ 鈹? 鈹溾攢 library-export.js # Glossary TBX / CSV / JSON builders
497
+ 鈹? 鈹溾攢 tm.js
498
+ 鈹? 鈹溾攢 glossary.js
499
+ 鈹? 鈹溾攢 persistence.js
500
+ 鈹? 鈹溾攢 import-export.js
501
+ 鈹? 鈹溾攢 formats.js # CSV/SRT/VTT/PO/XLIFF/HTML/JSON/RTF
502
+ 鈹? 鈹溾攢 html.js # Shared HTML/XHTML run scanner + patcher
503
+ 鈹? 鈹溾攢 epub.js # EPUB package read / spine import / patch export
504
+ 鈹? 鈹溾攢 preprocess.js # Import-time source cleaning stage
505
+ 鈹? 鈹溾攢 pre-translate.js # Block pre-translation methods
506
+ 鈹? 鈹溾攢 qa.js # Derived QA report (never persisted)
507
+ 鈹? 鈹溾攢 xlsx.js
508
+ 鈹? 鈹溾攢 pptx.js
509
+ 鈹? 鈹溾攢 segmenter.js
510
+ 鈹? 鈹溾攢 similarity.js
511
+ 鈹? 鈹溾攢 tmx.js
512
+ 鈹? 鈹溾攢 docx.js
513
+ 鈹? 鈹溾攢 markdown.js
514
+ 鈹? 鈹溾攢 xml.js
515
+ 鈹? 鈹溾攢 mt.js
516
+ 鈹? 鈹溾攢 tools.js
517
+ 鈹? 鈹斺攢 api.js
518
+ 鈹斺攢 _dev/ # tests, fixtures, local patch overlay
445
519
  ```
446
520
 
447
521
  </details>
@@ -477,13 +551,18 @@ node _dev/test-qa.mjs
477
551
  node _dev/test-library-crud.mjs
478
552
  node _dev/test-library-view.mjs
479
553
  node _dev/test-pagination.mjs
554
+ node _dev/test-replace.mjs
555
+ node _dev/test-notes.mjs
556
+ node _dev/test-lock.mjs
557
+ node _dev/test-segment-edit.mjs
558
+ node _dev/test-review.mjs
480
559
  node _dev/test-theme-tokens.mjs
481
560
  node _dev/test-e2e-1.1.mjs
482
561
  ```
483
562
 
484
563
  The import/export fixtures are `_dev/sample.docx`, `_dev/sample-table.docx`, and
485
564
  `_dev/sample-format.docx`; regenerate them with the matching
486
- `python _dev/make-*.py` scripts. All 29 suites should pass.
565
+ `python _dev/make-*.py` scripts. All 36 suites should pass.
487
566
 
488
567
  ### Releasing
489
568
 
@@ -543,15 +622,19 @@ GitHub with a release.
543
622
  - One translation per source text per context: a repeated sentence keeps a
544
623
  separate variant for each surrounding pair, capped at 8 variants per key, and
545
624
  reuses the generic entry when the neighbours differ.
546
- - Context is the two neighbouring source sentences only; document, customer, or
547
- project metadata is not part of the match.
625
+ - TM context is the two neighbouring source sentences only; the document brief
626
+ and project metadata are used by MT prompts but are not part of TM scoring.
548
627
  - TBX and JSON glossary exports are one-way; only TMX and CSV import back.
549
628
  - The workbench UI ships in Chinese, English, and Japanese, switchable in
550
629
  Settings; this README ships in English, Simplified Chinese, and Japanese, and
551
630
  the English version is the source of truth.
552
631
 
553
- Planned next: image/vision input through a multimodal DSH route,
554
- style-preserving XLSX output, and XLIFF `<alt-trans>` / notes support.
632
+ Planned next: per-document TM/glossary binding, word-count and leverage analysis,
633
+ bilingual DOCX review output, and an XLIFF review package (1.1.5); then
634
+ find/replace, segment merge/split/lock, comments, local undo (1.1.6), plus a
635
+ term-extraction overhaul that stops ranking by frequency and can surface
636
+ single-occurrence proper nouns and fiction terms, and an optional LLM review
637
+ pass (1.1.6).
555
638
 
556
639
  ## Changelog and versioning
557
640
 
@@ -564,8 +647,13 @@ and the PDF policy, `v1.1.0` adds agent-driven pre-translation, the
564
647
  three-state segment model, stacked review, and advisory QA, `v1.1.1` adds
565
648
  the library workspace with TMX/TBX/CSV/JSON export, segment paging, and the
566
649
  panel-to-library jump, `v1.1.2` adds context-aware memory with 101% (ICE)
567
- matches, and `v1.1.3` adds two-file alignment, automatic propagation of
568
- repeated segments, terminology mining, and the proposal primitive agents use.
650
+ matches, `v1.1.3` adds two-file alignment, automatic propagation of repeated
651
+ segments, terminology mining, and the proposal primitive agents use, and
652
+ `v1.1.4` adds the document brief, context-aware batch pre-translation,
653
+ forbidden/preferred terminology, risk-graded QA with one-click fixes,
654
+ concordance, and undo confirmation, and `v1.1.5` adds per-document TM/glossary
655
+ scopes, word-count and leverage analysis, bilingual DOCX and XLIFF review
656
+ packages, and TM maintenance.
569
657
  The project
570
658
  was developed as `0.1.0` and renumbered for the GitHub release.
571
659