メインコンテンツへスキップ

メソッドプラグイン仕様

バージョン: 1.1 対象読者: プラグイン開発者 正規スキーマ: shared/schemas/champollion-plugin.schema.json

概要

champollion はプラグイン可能なメソッドシステムを採用しています。言語ペアごとに異なる翻訳メソッド(LLM、コーチング付き、スクリプトコンバーターなど)を使用できます。メソッドは lib/translate.js に登録され、lib/pairs.js を通じてペアごとに解決されます。

eval ハーネスの役割は、翻訳メソッドの開発・テスト・エクスポートです。champollion の役割は、それらを消費・実行することです。プラグインはデータのみで構成されます — 設定、コーチングコンテンツ、ベンチマーク結果のみです。Python コードやハーネスへの依存関係は含みません。

データフロー

ハーネスは Python でメソッドを開発・テストします。メソッドがデプロイ可能な状態になると、ハーネスは method.json マニフェストとオプションのコーチングデータファイルをエクスポートします。Champollion は自身に組み込まれたメソッド実装を使用して、そのメソッドをインストール・実行します。


メソッドプラグインの形式

メソッドプラグインは、単一の JSON ファイル(method.json)とオプションのコーチングデータファイルで構成されます。

method.json — 必須

{
"name": "french-formal-v1",
"type": "llm-coached",
"version": "1.0.0",
"description": "Formally-tuned French with terminology enforcement and grammar coaching",
"author": "Plugin Author",

"config": {
"model": "google/gemini-3.5-flash",
"temperature": 0.2,
"batchSize": 80,
"register": "formal",
"coachingFile": null,
"coachingPrompt": null,
"promptContext": null,
"qualityTier": null
},

"locales": ["fr"],

"benchmarks": {
"fr": {
"date": "2026-05-11T00:00:00Z",
"corpus_size": 500,
"exact_match_rate": 0.42,
"corpus_chrf": 72.3,
"corpus_bleu": 45.1,
"model": "google/gemini-3.5-flash",
"harness_version": "1.0.0"
}
},

"provenance": {
"resources": [],
"commercialReady": false,
"flags": ["license-unclear"]
},

"coaching": {
"dir": "coaching"
}
}

フィールドリファレンス

フィールド必須説明
namestring一意のメソッド識別子(kebab-case)
typestringChampollion のメソッドタイプ: llmllm-coachedapigoogle-translatedeeplmicrosoft-translatorlibretranslateopenaianthropicgemini
versionstringセマンティックバージョン(例: 1.0.0
localesstring[]このメソッドが対象とするロケールコード(最低1つ)
descriptionstring人間が読める説明文
authorstringこのメソッドを開発・テストした担当者
config.modelstringOpenRouter モデル識別子
config.temperaturenumberLLM の temperature(0.0〜2.0、デフォルト: 0.3)
config.batchSizenumberAPI バッチあたりのキー数(1〜200、デフォルト: 80)
config.registerstring | nullターゲット言語のレジスター/トーン(プリセットキーまたは自由記述テキスト)
config.coachingFilestring | null自由記述コーチングプロンプトファイルへのパス(プロジェクトルートからの相対パス)
config.coachingPromptstring | null解決済みコーチングプロンプトテキスト(実行時に coachingFile から読み込まれる)
config.promptContextstring | nullシステムプロンプトに注入されるアプリケーションコンテキスト(例: "E-commerce product descriptions")
config.qualityTierstring | nullベンチマーク評価による品質ティア(standardhighresearchverified
benchmarksobjecteval ハーネスによるロケールごとのベンチマーク結果
provenanceobjectライセンスおよびリソースの依存関係
coaching.dirstringコーチングデータディレクトリへの相対パス

:::info 正規の MethodConfig の形式 config ブロックは正規の MethodConfig スキーマを使用しています — champollion.config.json、ハーネスのランカード、mt-eval export-config、リーダーボードのパブリッシュ/インストール全体で共通して使用される同じ 8 つのフィールドです。すべてのフィールドは常に存在し、未使用の値は null になります。これにより、評価と本番環境の間でのラウンドトリップがスムーズに行えます。 :::

ベンチマークオブジェクト(ロケールごと)

フィールド必須説明
datestringベンチマーク実行の ISO 8601 タイムスタンプ
corpus_sizenumber評価したエントリ数
exact_match_ratenumber0.0〜1.0、完全一致の割合
corpus_chrfnumberchrF++ スコア(0〜100)
corpus_bleunumberBLEU スコア(0〜100)
modelstring評価時に使用したモデル
harness_versionstring使用した評価ハーネスのバージョン

:::info 表示されるメトリクスについて champollion status コマンドは、ベンチマークブロックから chrF++完全一致率を表示します。corpus_bleu はマニフェストで受け付けられますが、現在 champollion のどのコマンドでも表示・使用されていません。メソッドリーダーボードでは chrF++、完全一致、FST 受理率を追跡しています。 :::


プロベナンスオブジェクト

プロベナンスブロックは、プラグインにバンドルされたリソースのライセンス状況を伝えます。

フィールドデフォルト説明
resourcesobject[][]namelicensetype を持つバンドルリソースのリスト
commercialReadybooleanfalseプラグインが商用配布の許可を受けているかどうか
flagsstring[]["license-unclear"]機械可読なステータスフラグ

デフォルト状態 — エクスポートされたプラグインは commercialReady: false および flags: ["license-unclear"] の状態で出荷されます。

クリア状態 — ライセンスが確認された場合: commercialReady: true を設定し、フラグをクリアします。


コーチングデータの形式

typellm-coached の場合、プラグインは coaching/ サブディレクトリにコーチングデータファイルを含める必要があります。

coaching/<locale>.json

{
"grammar_rules": [
"French adjectives agree in gender and number with the noun they modify",
"Use 'vous' for formal contexts, 'tu' for informal"
],
"dictionary": {
"dashboard": "tableau de bord",
"deployment": "déploiement",
"settings": "paramètres"
},
"style_notes": "Prefer active voice. Avoid anglicisms where a native French term exists."
}
フィールド必須説明
grammar_rulesstring[]このロケールのすべての LLM プロンプトに注入されるルール
dictionaryobject用語 → 翻訳のマップ。マッチした用語は必須用語として注入されます。
style_notesstringプロンプトに追記される自由記述のスタイル指示

ディレクトリ構造

french-formal-v1/
method.json # Method manifest with benchmarks
coaching/
fr.json # Coaching data for French

複数ロケールのメソッドの場合:

european-formal-v2/
method.json # locales: ["fr", "de", "es", "it"]
coaching/
fr.json
de.json
es.json
it.json

Champollion によるプラグインの利用方法

インストール

champollion plugin install ./french-formal-v1/

.champollion/methods/french-formal-v1/ に保存されます。

設定

champollion.config.json
{
"pairs": {
"en:fr": {
"methodPlugin": "french-formal-v1"
}
}
}

:::info マージのセマンティクス プラグインは使用するメソッドを定義します(type)。ペア設定は実行方法を調整します(modelregisterbatchSize)。ペアで model を設定した場合、プラグインのデフォルトを上書きします。 :::

実行時

  1. Champollion は .champollion/methods/french-formal-v1/ から method.json を読み込みます
  2. プラグインの type フィールドが翻訳メソッドを設定します(例: llm-coached
  3. プラグインの coaching/ ディレクトリからコーチングデータを読み込みます
  4. config ブロックを使用して、モデル/レジスター/temperature の空白を埋めます
  5. benchmarks ブロックは champollion status の出力に表示されます
  6. provenance ブロックは champollion provenance によってライセンスフラグの確認に使用されます

スキーマ検証

プラグインマニフェストはインストール時に shared/schemas/champollion-plugin.schema.json に対して検証されます。

IDE のオートコンプリートを有効にするために、method.json でスキーマを参照してください:

{
"$schema": "./node_modules/champollion/shared/schemas/champollion-plugin.schema.json",
"name": "my-method-v1"
}

含めてはいけないもの

  • ❌ Python コードやハーネスへの依存関係
  • ❌ 生のコーパスデータや実行ログ
  • ❌ API キーや認証情報
  • ❌ ハーネスの設定
  • ❌ 内部プロンプトテンプレート(それらは champollion のメソッド実装内に存在します)

プラグインはデータのみです: 設定、コーチングコンテンツ、ベンチマーク結果。


関連情報