dsh-cait 1.0.5 → 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,308 @@ 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
+
146
+ ## [1.1.3] - 2026-11-07
147
+
148
+ Alignment, repetition and terminology: CAIT can now build a translation memory
149
+ out of two finished files, fill repeated sentences by itself, and propose
150
+ terminology with evidence instead of guessing.
151
+
152
+ ### Added
153
+
154
+ - **Aligner.** Give it the source file and the translated file — two independent
155
+ documents, different languages allowed — and it pairs them segment by segment.
156
+ Scoring is cross-language: anchors (numbers, `{0}` placeholders, URLs,
157
+ capitalised names), length normalised per language, and paragraph structure.
158
+ Word-level similarity is deliberately not used, because it cannot compare two
159
+ languages. Blocked dynamic programming admits 1:1, 1:0, 0:1, 2:1 and 1:2 pairs;
160
+ rows are graded high / to-review / doubtful, and each row can be merged,
161
+ split or removed before writing to a library.
162
+ - **`readUploadText`** reads text out of any supported upload (docx, epub, xlsx,
163
+ pptx, html, csv, srt, vtt, po, json, rtf, xliff, markdown, plain text) without
164
+ creating a document.
165
+ - **Automatic propagation.** Confirming a segment copies its translation into
166
+ every other unconfirmed segment with the same source (`origin: auto`); editing
167
+ a draft keeps those copies in sync. "Fill repeated segments" does the same for
168
+ the whole document, and the rail only offers it when something would change.
169
+ - **Terminology mining.** `lib/term-extract.js` counts candidates — Latin word
170
+ n-grams and repeated CJK substrings filtered by boundary entropy — and ranks
171
+ them C-value style. The library workspace lists them with occurrence counts,
172
+ existing glossary hits and any wording translation memory already contains.
173
+ - **Agent tools** `cat_propose_translation`, `cat_align`,
174
+ `cat_consistency_report`, `cat_term_candidates` and `cat_add_terms`.
175
+
176
+ ### Changed
177
+
178
+ - QA gained two checks: `UNTRANSLATED_RESIDUE` (the target is still the source)
179
+ and `INCONSISTENT_TARGET` (one source, several translations). Both are advisory
180
+ and never block confirming or exporting.
181
+ - `proposeTranslation` writes only a `suggestion` plus its reason, never the
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.
187
+
188
+ ### Fixed
189
+
190
+ - Editing one copy of a repeated sentence no longer leaves its siblings stale.
191
+
192
+ ## [1.1.2] - 2026-11-07
193
+
194
+ Context-aware translation memory: the same sentence can now keep one
195
+ translation per surrounding text, and an exact context match scores 101%.
196
+
197
+ ### Added
198
+
199
+ - **Context matches (ICE).** Every confirmation stores the two neighbouring
200
+ source segments with the entry, hashed into `contextHash`. When a segment is
201
+ looked up with the same neighbours, it scores **101%** and is graded
202
+ `context`; a text match with different neighbours stays at 100%. Covered in
203
+ the review panel by a 101% badge and a `previous · next` line under the source.
204
+ - **Pre-translation uses context.** The block loop resolves ICE first, falls back
205
+ to the generic entry, then to machine translation, and each filled segment
206
+ reports `ice: true`, which `cat_pre_translate` summarises.
207
+ - **Library context column.** The library workspace shows each TM entry's
208
+ neighbouring text, so variants of one source can be told apart.
209
+
210
+ ### Changed
211
+
212
+ - Translation memory is keyed by `(library, language pair, normalised source,
213
+ contextHash)` instead of the source alone. `addTM` / `importTM` without a
214
+ context write the generic variant; confirming a segment writes its variant.
215
+ - Each key keeps at most 8 context variants; the oldest is evicted (the
216
+ generic entry never is).
217
+ - TMX export writes `<prop type="x-context">` and import reads it back, so
218
+ context survives a round-trip; TMX import now dedupes by key **and** context.
219
+ - Store version 4. Version 1–3 stores load unchanged: entries get a null
220
+ context, which behaves exactly like before.
221
+
222
+ ## [1.1.1] - 2026-11-07
223
+
224
+ A library workspace that works without a document open.
225
+
226
+ ### Added
227
+
228
+ - **Library workspace.** A new top-level view (topbar `Documents` / `Libraries`)
229
+ browses every translation-memory entry and glossary term, whether or not a
230
+ document is open and whether or not the library is mounted. It pages through
231
+ entries, filters by language, scopes the search to any combination of
232
+ libraries, and edits entries in a side panel without leaving the table.
233
+ - **Library exports.** A translation-memory library exports to TMX and a
234
+ glossary exports to TBX, CSV, or JSON, straight from the workspace.
235
+ - **Segment pagination.** The segment rail pages through filtered segments with a
236
+ 20/50/100/200 page size (remembered in `localStorage`) and accepts a typed
237
+ segment number to jump to, clearing the filter when the target is hidden.
238
+ - **Panel-to-library jump.** The right panel's library button opens the workspace
239
+ with the panel's current search text (and the glossary tab) applied, so looking
240
+ something up in the panel continues in the full list.
241
+
242
+ ### Changed
243
+
244
+ - The glossary tab no longer dumps the mounted glossary into the side panel with
245
+ a hard 200-term cut-off. It lists only the terms that match the current
246
+ segment and links to the workspace for everything else.
247
+ - Glossary entries can be edited or deleted in libraries that are not mounted;
248
+ mounting a library is still the explicit toggle it was.
249
+
250
+ ## [1.1.0] - 2026-11-07
251
+
252
+ Agent-assisted pre-translation and a stacked review workbench.
253
+
254
+ ### Added
255
+
256
+ - **Pre-translation.** `cat_pre_translate` (and the `preTranslate` RPC) fills a
257
+ block of segments from exact translation-memory matches first, then machine
258
+ translation, in small concurrent batches. Confirmed segments and segments that
259
+ already carry a target are skipped, so repeated or interrupted runs never
260
+ overwrite human work. The workbench adds a topbar button that walks the
261
+ document block by block, shows `done/total`, and can be stopped between blocks.
262
+ - **Stacked review.** The editor lays source, the machine/agent baseline, and the
263
+ editable target out top to bottom, so each block gets the full pane width. The
264
+ baseline is stored on `suggestion`, so editing the target always has the
265
+ original to compare against.
266
+ - **Suggestion adoption.** `adoptSuggestion` copies a suggestion into the target
267
+ while keeping its origin and the suggestion itself for later comparison.
268
+ - **Batch reading and confirmation for agents.** `cat_get_segments` lists a
269
+ bounded window with status, origin, and suggestions; `cat_confirm_segments`
270
+ confirms a list of indices or every segment awaiting review, reporting what it
271
+ skipped instead of guessing.
272
+ - **Advisory QA.** A derived report flags missing placeholders/tags, mismatched
273
+ numbers, unused glossary terms, and segments marked as translated but empty.
274
+ Issues appear as a marker in the segment rail and as a banner in the export
275
+ dialog; they never block an export and nothing is written to disk.
276
+ - **Translation memory and library maintenance.** Single TM entries can be
277
+ edited or deleted from the match cards, and TM/glossary libraries can be
278
+ renamed or deleted (the last library of a kind stays protected).
279
+ - **Theme adaptation.** The workbench follows the host light/dark theme: the
280
+ root sets `color-scheme` (so native selects, checkboxes, and scrollbars match),
281
+ primary button labels use the inverted label token, and the segment rail search
282
+ now also matches suggestions.
283
+
284
+ ### Changed
285
+
286
+ - Segments move through three states — `pending`, `translated`, `confirmed` —
287
+ with `origin` (`tm`/`mt`/`agent`/`manual`) recording who produced the text.
288
+ Progress now separates "awaiting review" from "pending" instead of counting
289
+ both as unfinished.
290
+ - The store format is version 3. Versions 1 and 2 still load and migrate in
291
+ place; a version-2 draft with text but no confirmation becomes `translated`
292
+ with `origin: manual`.
293
+ - UI scaling is damped above the design size (`1 + (fit - 1) × 0.6`, capped at
294
+ 1.45×) so a maximized window no longer grows the interface far beyond the host
295
+ UI.
296
+ - MT route discovery no longer filters providers by what the loader configuration
297
+ happens to mention: every registered provider is listed, configured ones first,
298
+ and providers without models stay visible but disabled.
299
+
300
+ ### Fixed
301
+
302
+ - Adding a custom model provider no longer hides the built-in DeepSeek route from
303
+ the model-route list.
304
+ - The selected segment and an unsaved draft are now persisted (debounced, plus a
305
+ flush on unload) instead of only travelling along with unrelated writes.
306
+ - The primary button label no longer uses a surface token, which produced
307
+ unreadable text in the dark theme.
308
+
7
309
  ## [1.0.5] - 2026-11-06
8
310
 
9
311
  EPUB support, an import preprocessing stage, and format hardening.
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="テスト 15 スイート" src="https://img.shields.io/badge/tests-15%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
- エントリから開き、ワークベンチと 7 つのエージェントツールが 1 つのストアを共有するため、
25
+ エントリから開き、ワークベンチと 21 のエージェントツールが 1 つのストアを共有するため、
26
26
  ソースファイルのインポートから訳文のエクスポートまでを一通りこなせます。
27
27
 
28
28
  > **DSH `0.2.2-rc.1` で動作確認済み。** CAIT は DSH 自身のモデルルートと認証情報を
@@ -34,11 +34,11 @@ CAIT は DSH Web UI と DSH デスクトップに CAT ワークベンチを追
34
34
  | | |
35
35
  |---|---|
36
36
  | **DSH ネイティブ** | 本物のサイドバーパネル、メインワークベンチ、DSH のテーマトークン、そして人とエージェントが同じストアを共有。iframe でも別アプリでもありません。 |
37
- | **説明できる翻訳メモリ** | 複数の TM ライブラリ、マウント済みライブラリのみの検索、完全一致 / ほぼ完全一致 / 高・中・低ファジーの段階、確定時の自動書き戻し。 |
37
+ | **説明できる翻訳メモリ** | 複数の TM ライブラリ、マウント済みライブラリのみの検索、101% のコンテキスト(ICE)一致、完全一致 / ほぼ完全一致 / 高・中・低ファジーの段階、確定時の自動書き戻し。 |
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
- | **エージェント対応** | 7 つのツールが開いている文書とストアを共有するので、エージェントと並行して翻訳できます。 |
41
+ | **エージェント対応** | 21 のツールが開いている文書とストアを共有するので、エージェントと並行して翻訳できます。 |
42
42
 
43
43
  ## クイックスタート
44
44
 
@@ -56,14 +56,44 @@ 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 ライブラリ。
88
+ - **コンテキスト一致(ICE)は 101%。** 確定のたびに前後の原文 2 文を記録し、同じ
89
+ 隣接文を持つセグメントは 101%・`context` 段階になります(テキストが同じでも
90
+ 隣接文が違えば 100% のまま)。1 つのキーにつき最大 8 件のコンテキスト変種を保持し、
91
+ コンテキストなしの汎用エントリは常に残します。
62
92
  - 完全一致、ほぼ完全一致、そして 3 つのファジー帯:
63
93
  - `near_exact` は数字・句読点・空白を無視したキーで比較し、スコアのしきい値には
64
94
  依存しません。
65
95
  - `high_fuzzy` は `>= 0.85`、`medium_fuzzy` は `0.75–0.85`、`low_fuzzy` は
66
- `0.75` 未満(設定可能な下限、既定値 `0.55` より上)です。
96
+ `0.75` 未満(設定可能な下限、既定値 `0.70` より上)です。
67
97
  - ファジースコアは字句ベースです。文字バイグラムの Dice 72% + トークンの Jaccard 28%。
68
98
  ラテン文字は単語単位、CJK は文字単位で扱います。ステミング、同義語、意味的マッチングは
69
99
  行いません。
@@ -74,6 +104,8 @@ Host のリビジョンをポーリングするため、エージェントによ
74
104
  件数です。全データが必要な場合は `cat_lookup_tm` かライブラリモーダルを使ってください。
75
105
  - TMX 1.4 の `<tu>/<tuv>/<seg>` インポート / エクスポート。TMX のインライン
76
106
  プレースホルダは、明示的な警告とともにプレーンテキストへ平坦化されます。
107
+ コンテキストは `<prop type="x-context">` として往復するため、CAIT が出力した
108
+ ファイルを再インポートしても 101% 一致が保たれます。
77
109
 
78
110
  ### 用語集
79
111
 
@@ -82,11 +114,63 @@ Host のリビジョンをポーリングするため、エージェントによ
82
114
  - CSV/TSV インポート、用語ごとのメモ、ソース言語による絞り込み、そしてワークベンチと
83
115
  `cat_lookup_glossary` の両方が尊重する `caseSensitive` フラグ。
84
116
  - 言語コードは正規化されます(`EN` → `en`、`ZH_cn` → `zh-CN`)。
117
+ - 用語はマウントされていないライブラリでも編集・削除できます。マウント状態は
118
+ ワークベンチが検索・書き込みする対象を決めるだけです。
119
+ - **用語の抽出**: 用語集ツールバーの「文書から用語を抽出」は、出現回数、
120
+ メモリにある既存の訳語、「登録済み」の印が付いた候補を一覧します。統計が候補を
121
+ 見つけて並べ(ラテン語の n-gram、CJK の繰り返し部分文字列は左右の隣接エントロピーで
122
+ 絞り込み)、モデルは短い候補リストを判定するだけです。
123
+
124
+ ### ライブラリワークスペース
125
+
126
+ トップバーの「文書 / ライブラリ / 整列」で翻訳者向けビューとライブラリ管理を切り替えます。
127
+ ライブラリ側は文書を開いている必要がありません。
128
+
129
+ - TM と用語集がそれぞれ 1 つの表になり、ページ送り(20/50/100/200、記憶されます)、
130
+ 言語フィルタ、任意のライブラリ組み合わせに絞った検索ができます。
131
+ - 右側のパネルで選択中の項目をその場で編集し、項目を追加し、未保存の変更を表示します。
132
+ - TM は **TMX**、用語集は **TBX**・**CSV**・**JSON** に書き出せます。インポートと
133
+ クリアも同じツールバーにあります。
134
+ - 右サイドパネルのライブラリボタンは、その検索語を引き継いでワークスペースを開きます。
135
+ パネルでの調べものが一覧でそのまま続けられます。
136
+
137
+ ### 整列
138
+
139
+ トップバーの「文書 / ライブラリ / 整列」の 3 つ目のビューは、完成した 2 つの
140
+ ファイルから翻訳メモリを作ります。原文とその訳文を別々のファイルとして、
141
+ 対応形式なら何でも、言語の組み合わせも自由に使えます。
142
+
143
+ - 言語をまたぐ採点: 共通のアンカー(数字、`{0}` プレースホルダー、URL、大文字で
144
+ 始まる固有名)、言語ごとに正規化した長さの比、段落構造。2 言語を比べられない
145
+ 字面の類似度は意図的に使いません。
146
+ - ブロック化した動的計画法が 1:1、1:0、0:1、2:1、1:2 を対応づけます。各行は
147
+ 高信頼 / 要確認 / 疑わしいの 3 段階で、既定で選ばれるのは高信頼だけです。
148
+ - 書き込み前に、各行を次の行と結合、改行で分割、削除できます。書き込み先の
149
+ ライブラリはツールバーで選び、まったく同じ項目は重複させずに飛ばします。
85
150
 
86
151
  ### ワークベンチ
87
152
 
88
153
  - 段落 / 文単位のセグメンテーションと、セグメントごとのターゲットエディタ。
89
- - ドラフト保存、確定して次へ、前後移動、進捗表示。
154
+ - セグメントは **未翻訳** → **翻訳済み** → **確定済み** の 3 状態を持ち、訳文の由来
155
+ (`tm`、`mt`、`agent`、`manual`)も記録します。レールは状態で絞り込め、検索は
156
+ 原文・訳文・サジェストを対象にします。
157
+ - **セグメントのページ送り**: レールは絞り込み後のセグメントを 20/50/100/200 の
158
+ ページ単位で表示し、番号を直接入力して移動できます。移動先が絞り込みで隠れて
159
+ いるときは、先に絞り込みを解除します。
160
+ - **事前翻訳**: TM の完全一致と機械翻訳で文書全体を小さなブロック単位で埋め、
161
+ `完了/総数` を表示し、ブロックの間で停止できます。確定済み・訳文のあるセグメントは
162
+ 上書きしません。
163
+ - **縦積みレビュー**: 原文・機械/agent のベースライン・編集可能な訳文を上から下へ
164
+ 並べ、各ブロックがパネルの幅いっぱいを使います。**すべて確定** は確認ダイアログ
165
+ 1 回でレビュー待ちをまとめて受け入れます。
166
+ - ドラフト保存、確定して次へ、前後移動、進捗表示。選択中のセグメントとドラフトは
167
+ デバウンスして保存されるため、再起動後も続きから再開できます。
168
+ - **繰り返しセグメントの自動同期**: 1 文を確定すると、同じ原文を持つ未確定の
169
+ セグメントに同じ訳文が入り(由来は `auto`)、ドラフトの編集も同期します。
170
+ 「繰り返しを埋める」で文書全体を一度に処理できます。確定済みには触れません。
171
+ - レールの QA マーカーと書き出し前の集計: プレースホルダー / タグの欠落、数字の
172
+ 不一致、用語の未使用、空の訳文、原文のままの訳文、同じ原文に複数の訳文。
173
+ 注意のみで、書き出しは妨げず、保存もしません。
90
174
  - 文書タブ。タブを閉じても文書は削除されません。
91
175
  - **既存の文書を開く** で、閉じた文書を開き直せます。
92
176
  - **設定 → インターフェース** の UI 言語切り替え: *DSH の言語に従う*(既定)、
@@ -96,9 +180,11 @@ Host のリビジョンをポーリングするため、エージェントによ
96
180
  元に戻せず、TM・用語集・その他の文書には触れません。
97
181
  - 同じ形式で同一内容を再インポートすると、重複を作らず既存の文書を再利用します。
98
182
  フィンガープリントは言語、ソース、形式、交換メタデータを対象にします。
99
- - レスポンシブな密度: ワークベンチは自身の DSH パネルを測り、`--cait-u` の倍率を
100
- 1×–1.8× で適用します。1600×900 のパネルは約 1.32×、2560×1440 は 1.8×。
101
- 高さの低いウィンドウでは縮小せず 1× のままです。
183
+ - レスポンシブな密度: ワークベンチは自身の DSH パネルを測り、減衰させた `--cait-u`
184
+ 倍率を 1×–1.45× で適用します。1600×900 のパネルは約 1.17×、最大化した 4K でも
185
+ 1.45× で止まり、ホスト UI に近い大きさを保ちます。
186
+ - ワークベンチは DSH のライト / ダークテーマに追従し、ネイティブコントロール
187
+ (`color-scheme`)も含めてセレクト、チェックボックス、スクロールバーが揃います。
102
188
 
103
189
  ### 前処理
104
190
 
@@ -134,7 +220,7 @@ CAIT はエンドポイントもキーも持ちません。セレクタは DSH
134
220
  | CSV | ✅ | ✅ | カンマ、セミコロン、タブ、パイプの区切りを自動判定。ヘッダー名または 1 始まりの番号でソース / ターゲット列を指定可能。既存の対訳エクスポートにも対応 |
135
221
  | DOCX | ✅ | ✅ | 本文段落。表ブロックはインポート対象外。エクスポートは元のパッケージにパッチを当て、スタイル、番号付け、画像、ヘッダー、表、レイアウトを保つ |
136
222
  | EPUB | ✅ | ✅ | EPUB 3 の spine 順に XHTML テキストブロックを読み、インライン要素をトークンとして保持し、保持したソースパッケージに書き戻す。DRM、固定レイアウト、スクリプト化された EPUB は非対応 |
137
- | TMX 1.4 | ✅ | ✅ | 一般的な `<tu>/<tuv>/<seg>` サブセット。インライン要素は警告付きで平坦化 |
223
+ | TMX 1.4 | ✅ | ✅ | 一般的な `<tu>/<tuv>/<seg>` サブセット。インライン要素は警告付きで平坦化し、コンテキストは `<prop type="x-context">` で往復 |
138
224
  | SRT / WebVTT | ✅ | ✅ | 1 キュー = 1 セグメント。タイミング / 設定 / 識別子を保持し、セマンティックタグも維持。不正な範囲は拒否 |
139
225
  | PO | ✅ | ✅ | コンテキスト、複数形、翻訳者コメント、廃止された `#~` エントリ |
140
226
  | XLIFF 1.2 | ✅ | ✅ | インラインタグは `{n}` トークンになり、欠落していると確定できない |
@@ -187,7 +273,7 @@ DSH デスクトップ(または `plugin_manager` ツールがある任意の
187
273
  plugin_manager install_bundle target: dsh-cait
188
274
  ```
189
275
 
190
- バージョンを固定するときは `dsh-cait@1.0.5`、最新版は `dsh-cait@latest` を指定します。
276
+ バージョンを固定するときは `dsh-cait@1.1.6`、最新版は `dsh-cait@latest` を指定します。
191
277
  マネージャが registry のパッケージを解決し、bundle patch を適用してプラグインを有効化します。
192
278
 
193
279
  CLI 管理のプロファイル:
@@ -266,8 +352,9 @@ dsh web --patch C:\absolute\path\to\dsh-CAIT\_dev\cait.patch.yml
266
352
 
267
353
  スナップショットが破損している、または未知のバージョンの場合、CAIT は警告をログに残し、
268
354
  `store.json.corrupt-<timestamp>` に退避してから空の状態で起動します(有効化は失敗しません)。
269
- バージョン 1 のスナップショットは、既定の TM と用語集ライブラリを付けてバージョン 2 へ
270
- 移行されます。
355
+ バージョン 1・2 のスナップショットは、既定の TM と用語集ライブラリを付けてバージョン 3 へ
356
+ 移行されます。バージョン 2 で「訳文はあるが未確定」のドラフトは `translated` になり、
357
+ 由来は `manual` として記録されます。
271
358
 
272
359
  ## エージェントツール
273
360
 
@@ -280,6 +367,20 @@ dsh web --patch C:\absolute\path\to\dsh-CAIT\_dev\cait.patch.yml
280
367
  | `cat_list_documents` | 文書と進捗の一覧 |
281
368
  | `cat_switch_document` | アクティブな文書を切り替え |
282
369
  | `cat_suggest_mt` | 選択した DSH ルート経由の MT、または明示的なオフラインフォールバック |
370
+ | `cat_pre_translate` | TM + MT で 1 ブロックを埋め、確定済み・訳文ありは飛ばし `next` を返す |
371
+ | `cat_get_segments` | 状態・由来・サジェスト付きで、範囲を限ったセグメント一覧 |
372
+ | `cat_confirm_segments` | インデックス一覧、範囲、またはレビュー待ち全体を確定 |
373
+ | `cat_propose_translation` | 確定済みの訳文に触れず、サジェストと理由だけを残す |
374
+ | `cat_align` | 2 つのテキストを整列し、高信頼 / 要確認 / 疑わしい組を報告 |
375
+ | `cat_consistency_report` | 訳文が揺れている同一原文をグループ化して一覧 |
376
+ | `cat_term_candidates` | 用語候補の短いリスト: 頻度、例文、メモリにある既存の訳語 |
377
+ | `cat_add_terms` | 選んだ用語を用語集へまとめて登録 |
378
+ | `cat_review` | モデルに構造化された校閲提案を求める。文書は書き換えない |
379
+
380
+ そのためエージェントは UI を操作せずに文書全体を下書きできます: `cat_pre_translate` を
381
+ `from: next` で `next` が `null` になるまで繰り返し、`cat_get_segments` で確認し、
382
+ `cat_confirm_segments` でまとめて受け入れます。用語は `cat_term_candidates` で候補を読み、
383
+ リストを判断して `cat_add_terms` で書き込みます。
283
384
 
284
385
  ワークベンチとツールは 1 つの `CatStore` を共有するため、エージェントはユーザーが開いて
285
386
  いるのと同じ文書を翻訳できます。
@@ -290,7 +391,7 @@ dsh web --patch C:\absolute\path\to\dsh-CAIT\_dev\cait.patch.yml
290
391
  flowchart LR
291
392
  UI["DSH Web UI<br/>(sidebar + workbench)"] --> Client["client.js<br/>generated Web bundle"]
292
393
  Client --> API["/cait/api/rpc<br/>same-origin JSON"]
293
- Tools["7 agent tools"] --> Store["CatStore"]
394
+ Tools["21 agent tools"] --> Store["CatStore"]
294
395
  API --> Store
295
396
  Store --> Snapshot[("store.json<br/>+ sources/")]
296
397
  ```
@@ -377,7 +478,7 @@ node _dev/test-mt.mjs
377
478
 
378
479
  インポート / エクスポートのフィクスチャは `_dev/sample.docx`、`_dev/sample-table.docx`、
379
480
  `_dev/sample-format.docx` です。対応する `python _dev/make-*.py` スクリプトで再生成
380
- できます。15 スイートすべてが通るはずです。
481
+ できます。41 スイートすべてが通るはずです。
381
482
 
382
483
  ### リリース
383
484
 
@@ -432,13 +533,16 @@ npm publish
432
533
  - HTML/RTF のエクスポートは元のスタイルをラウンドトリップしません。JSON は文字列値だけを
433
534
  翻訳します。
434
535
  - TM のマッチングは意味ではなく字句に基づきます。ステミング、同義語、埋め込みはありません。
435
- - ライブラリの名前変更 / 削除と、タブごとのマウント状態は未実装です。
536
+ - コンテキストごとに 1 つの原文へ 1 つの訳文を保存します。同じ文でも隣接文の組み合わせが
537
+ 違えば別の変種として保持し(キーごとに最大 8 件)、隣接文が一致しない場合は
538
+ コンテキストなしの汎用エントリに戻ります。
539
+ - コンテキストは前後の原文 2 文だけで、文書・顧客・プロジェクトのメタデータは含みません。
540
+ - TBX と JSON の用語集書き出しは一方向です。読み戻せるのは TMX と CSV だけです。
436
541
  - ワークベンチ UI は中国語・英語・日本語の 3 言語で、設定から切り替えられます。
437
542
  README も英語・簡体字中国語・日本語の 3 版があり、英語版が正本です。
438
543
 
439
544
  次に予定しているのは、マルチモーダルな DSH ルート経由の画像 / ビジョン入力、
440
- より充実したライブラリ管理、スタイルを保つ XLSX 出力、XLIFF の
441
- `<alt-trans>` / ノート対応です。
545
+ スタイルを保つ XLSX 出力、XLIFF の `<alt-trans>` / ノート対応です。
442
546
 
443
547
  ## 変更履歴とバージョン
444
548
 
@@ -446,7 +550,12 @@ npm publish
446
550
  `v1.0.1` が日本語 UI とアプリ内の UI 言語切り替えを追加し、`v1.0.2` で
447
551
  *DSH の言語に従う* が DSH のロケールに従うようになり、`v1.0.3` で npm に公開、
448
552
  `v1.0.4` から以降のリリースは provenance 付きの公開ワークフローで行われ、
449
- `v1.0.5` で EPUB、インポート前処理、PDF ポリシーを追加しました。
553
+ `v1.0.5` で EPUB、インポート前処理、PDF ポリシーを、`v1.1.0` でエージェントによる
554
+ 事前翻訳、セグメントの 3 状態、縦積みレビュー、軽量 QA を、`v1.1.1` で
555
+ TMX/TBX/CSV/JSON 書き出し付きのライブラリ画面、セグメントのページ送り、
556
+ サイドパネルからライブラリ画面への移動を、`v1.1.2` で 101%(ICE)一致を含む
557
+ コンテキスト対応メモリを、`v1.1.3` で 2 ファイルの整列、繰り返しセグメントの
558
+ 自動同期、用語の抽出、エージェントがサジェストを書くためのプリミティブを追加しました。
450
559
  プロジェクトは `0.1.0` として開発され、GitHub リリースに向けて採番し直されました。
451
560
 
452
561
  > **ライセンス:** Apache License 2.0 — [LICENSE](LICENSE) を参照してください。