Phase 2 prototype — template-dict compressor for structured_log v0.1 (gzip 40.4% 削減、 brotli 30.5% 削減、 lossless ✓、 13/13 test PASS)
STEP 1863 で v0.3 signature が α=0.05 統計的 有意 (p=0.020) 達成 → Phase 2 「進行可能」 に upgrade → structured_log domain (Dw=0.717 余裕最大 + field dictionary 客観) で schema-aware template-dictionary compressor v0.1 実装。 実測: template-dict 94,210 byte (1.079 bpc) vs gzip-9 158,005 (1.810 bpc) vs brotli-q11 135,493 (1.552 bpc) = gzip 40.4% 削減、 brotli 30.5% 削減、 round-trip lossless ✓、 13/13 test PASS。
1. Compression 比較 (structured_log 8000 line 698,392 byte)
| compressor | bytes | ratio | bpc | vs template-dict |
|---|---|---|---|---|
| original | 698,392 | 1.0000 | 8.0000 | +641% |
| gzip -9 | 158,005 | 0.2262 | 1.8099 | +67.7% |
| brotli -q11 | 135,493 | 0.1940 | 1.5521 | +43.8% |
| template-dict v01 ★ | 94,210 | 0.1349 | 1.0792 | — |
Success criterion (beat gzip + brotli): MET ✓ (zstd -19 は 環境 PATH 依存 spawn skip、 gzip + brotli two-baseline 全勝)
2. Schema (corpus 学習)
date: 2026-09-07 (fixed、 header 1 回)levels(4): DEBUG / ERROR / INFO / WARN → 2 bitmodules(6): api / auth / cache / db / sched / worker → 3 bitmessages(10): cache hit / cache miss / circuit breaker open / connection closed / connection opened / query executed / request received / response sent / retry / timeout → 4 bittime-of-day: HH:MM:SS.mmm → 27 bit (0-86,399,999 ms)req_id: 12 hex char → 48 bit (6 byte)latency_ms: 0-499 実測 → 10 bit (0-1023 buffer)
Per-line: 93 bit = 11.625 byte。 8000 line × 93 = 93,000 byte + header ~250 = ~93 KB target、 実測 94,210 byte target 内。
3. Round-trip lossless verification
- Full corpus (8000 line): encode → decode → 完全一致 ✓
- Head 5 line: round-trip ✓
- Tail 5 line (no trailing newline): round-trip ✓
- Single-line minimal corpus: round-trip ✓
- 13/13 test assertion PASS
4. Honest scope
- Schema-aware compressor (structured_log 専用)、 汎用化 は 別 STEP
- Round-trip lossless 保証 = original byte identity
- Dictionary は corpus 学習 (2 pass、 in-memory)、 online adaptation は 別 STEP
- 単一 date 前提 (v0.1)、 複数日 対応 は format upgrade 必要
- Comparison 対象 は gzip (Node built-in) + brotli (Node built-in)、 zstd は 環境 PATH 依存 spawn skip
- novelty 主張 なし: schema-aware compressor は 古典的 approach (Apache Avro / Protobuf / Cap'n Proto の 変形)、 本 STEP は 「Voynich signature v0.3 の 予測」 の 圧縮 定量差 evidence 収集
5. Voynich signature v0.3 implication 実測 の 意味
signature の 主張:
- 「template-heavy domain (v0.3 YES) は 汎用 圧縮 を schema-aware で 大きく 上回る」 予測
- 本 STEP で: gzip 比 40.4% 改善 + brotli 比 30.5% 改善 = 予測 と 一致
統計 test (STEP 1863 p=0.020) と 独立 な predictive validity evidence layer: 「signature valid」 の 別 経路 support。 逆方向 (「圧縮 改善 なし → signature invalid」) は v0.4 negative evidence として 別 domain (english/dna/protein) で 検証必要 (v0.4 送り 7 追加)。
6. Phase 2 判断 update
- STEP 1863 で 「進行可能」 に update した Phase 2 の 第 1 domain prototype 完成
- 残 Phase 2 候補: voynich prototype (未解読、 char-level bigram 別 STEP)、 markdown prototype (別 STEP)、 esperanto prototype (別 STEP)
7. v0.4 送り update
| item | 状態 |
|---|---|
| (1) positive class 拡張 | ✅ 完了 (STEP 1863 n=5) |
| (2-6) held-out CV / continuous score / domain 追加 / cmix / english anchor | ⏸ 送り |
| (7) implication 逆 domain 実測 (v0.3 no で 圧縮 改善 なし 予測 反証、 本 STEP で 追加) | ⏸ 送り |
8. STEP 1848 pattern 7 段階目 candidate
| STEP | イベント |
|---|---|
| 1848 | Cowork side data-found bug |
| 1849 | sibling bug 独立発見 |
| 1860 | 藤本さん CSV review 5 指摘 (数学的欠陥) |
| 1861 | permutation 定量 決着 (v0.2 完全崩壊) |
| 1862 | threshold 再定義 (方向反転 +3.54σ、 p=0.125 未達) |
| 1863 | anchor 拡張 (n=5) で p=0.020 統計的 validated |
| 1867 | implication 実測 で predictive validity 確認 |
9. 関連 STEP
10. 詳細参照
- 実装:
scripts/domain-family/template-dict-compressor.ts(~310 行) - Test:
test/step1867-template-dict-compressor-test.ts(13/13 PASS) - Report: template-compression-v01-report.json
- Binary:
data/domain-family/results/template-compressed-structured-log.bin(94,210 byte) - Source:
data/domain-family/samples-combined/structured_log.txt(8000 line 698,392 byte) - Notepad: 2026-09-07T03-15 STEP 1867
- Fragment: notes/steps/STEP_1867.md
- ← Tools index に 戻る