check-pua
Skill240 starsChanged 4 days agoMITView on GitHub
PUA テーブル / fixture / config の整合性を 1 コマンドで検査。pua.json を編集したり ɔɪ/œ̃/ɐ̃ のような multi-codepoint 音素を扱う前後に呼ぶ。docs/spec/pua-contract.toml の 4 不変条件を全部チェック。
In this repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bump-depsSkill
- check-cross-runtimeSkill
- check-loanwordSkill
- check-new-runtime-assetSkill
- check-pr-readySkill
- check-review-backlogSkill
- check-runtime-paritySkill
- commitSkill
- create-prSkill
- precheckSkill
- prepare-releaseSkill
- publish-modelSkill
- release-prepSkill
- reply-reviewSkill
- run-testsSkill
- skill-healthSkill
- sync-docsSkill
- watch-ci-patternsSkill
- watch-prSkill
The file
Files
PUA Consistency Check
PUA (Private Use Area) 関連の不変条件を一括検査します。pua.json を編集する PR や、新しい多コードポイント音素 (例: 韓国語の濃音、追加母音等) を追加する作業で必ず呼んでください。
何をチェックするか
docs/spec/pua-contract.toml の 4 不変条件:
- Cross-runtime consistency —
pua.jsonと checker が列挙する全 runtime source (Python runtime/G2P、Rust、Go、JS/WASM、C#、Swift) のテーブルが一致 - Inventory coverage —
id_maps.pyの language inventory に出てくる multi-codepoint token は全てpua.jsonに登録済み - Generated id_map keys —
phoneme_id_mapの全 key が単一コードポイント (C++ runtime の制約) - PUA_COMPAT_VERSION sync — 全ランタイムの compat version が
pua.jsonの version 値と一致
加えて:
- Fixture drift —
tests/fixtures/g2p/phoneme_test_cases.jsonのpua_map/pua_map_countがpua.jsonと一致 (PR #389 で踏んだバグ class)
実行ステップ
1. Cross-runtime consistency
python scripts/check_pua_consistency.py --verbose --check-version期待: All runtimes are consistent with pua.json. で終了。
2. Inventory + fail-fast invariants (Python)
cd src/python/g2p
uv sync --extra all --extra dev
uv run pytest tests/test_pua_invariants.py -v期待: 全 PASS。
3. Pre-flight config validator
cd src/python
uv sync --extra test
uv run pytest tests/test_update_model_config.py -v期待: 全 PASS。
4. Fixture drift detection
python scripts/regenerate_test_fixture.py --check期待: OK: tests/fixtures/g2p/phoneme_test_cases.json already in sync with pua.json。
drift があれば python scripts/regenerate_test_fixture.py を引数なしで再実行して fixture を更新、commit。
5. (任意) ランタイム別 PUA テーブルテスト
時間がある時のみ:
# Rust
cd src/rust && cargo test -p piper-plus-g2p --lib -- token_map
# Go
cd src/go && go test ./phonemize/... -run "TestFixedPUA"
# JS
cd src/wasm/g2p && node --test test/test-pua-map.js失敗時の典型的な対応
| 失敗内容 | 対応 |
| Cross-runtime mismatch | 該当ランタイムの PUA テーブル (token_map.rs / pua.go / pua-map.js / OpenJTalkToPiperMapping.cs / phoneme_parser.cpp) を pua.json と一致させる |
| Inventory coverage fail | 失敗した token を src/python/g2p/piper_plus_g2p/data/pua.json の entries に追加 (codepoint range は docs/spec/pua-contract.toml の [ranges] セクション参照) |
| Fixture drift | python scripts/regenerate_test_fixture.py で fixture を更新 |
| compat version mismatch | pua.json の version を bump したら、src/python/g2p/piper_plus_g2p/encode/pua.py の PUA_COMPAT_VERSION と src/wasm/g2p/src/pua-map.js の PUA_COMPAT_VERSION と src/rust/piper-plus-g2p/src/token_map.rs の PUA_COMPAT_VERSION を全部同じ値に揃える |
関連リソース
- ルール定義:
docs/spec/pua-contract.toml - 新音素追加手順:
docs/guides/development/adding-pua-codepoint.md - CI gate:
.github/workflows/pua-consistency.yml - 配布前検証:
scripts/upload_model_to_hf.py(config) /scripts/check_onnx_inputs.py(onnx)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

