新しいリリースv0.11.14Aug 13, 2026

Boostの新しいバージョンをリリースしましたExpanded reporting and agent setup

$ reference

TOML フィルター

Boost は主要ツール向け Go パーサーと、それ以外向けの 宣言的 TOML フィルター で圧縮します。~/.boost/filters/ または .boost/filters/ に 1 フィルター 1 ファイルを置けば、再コンパイル不要です。

フィルターの読み込み元

Boost は複数の場所からフィルターをマージし、コマンドまたは出力で選択されたすべてのフィルターを適用します。フォルダ内のファイルは決定的な順序で読み込まれます。

  1. Boost に同梱の組み込みフィルター(maketerraformshellcheck など)
  2. ~/.boost/filters/*.toml(グローバルフォルダ、1 ファイル 1 フィルター)
  3. .boost/filters/*.toml(プロジェクト内、1 ファイル 1 フィルター)

ソースは上書きではなくマージされます。同名のプロジェクトフィルターは組み込みを置き換えません — 両方読み込まれ(name + source)、match_command または match_output_select にヒットしたすべてが読み込み順(builtin → global → project)で適用されます。置き換えるには boost filters disable して独自フィルターを置きます。


フォルダレイアウト(1 ファイル 1 フィルター)

カスタムフィルターは 1 フィルター 1 ファイルです。各ファイルに [filters.<name>] ブロックと [[tests.<name>]] 例があります。

~/.boost/filters/
  git-status.toml      # [filters.git-status] + [[tests.git-status]]
  my-deploy.toml       # [filters.my-deploy] + [[tests.my-deploy]]

~/.boost/filters/ のフィルターは次の boost プロセスで リビルドなし で読み込まれます。


セレクターとよく使うフィールド

フィルターには少なくとも 1 つのセレクターが必要です。以下はほぼすべての例に出るフィールドです。完全な一覧はページ末尾にあります。

フィールド目的
match_commandSelect by command line (capture path)
match_output_selectSelect by piped output signature (hook path); use (?m) for line anchors
strip_ansiRemove terminal color codes first
strip_lines_matchingDrop lines matching any pattern
keep_lines_matchingKeep only matching lines
on_emptyMessage when filtering removes everything

正規表現の種類

パターンはすべて Go の regexp(RE2 構文)で、PCRE ではありません。後方参照や lookbehind はありません。出力全体に対する複数行の ^/$ には (?m) が必要です。regexp/syntax を参照。


例: カスタム deploy スクリプト

チームが ./scripts/deploy.sh を Boost 経由で実行します。フックは出力だけを送るため、match_command に加えて match_output_select が必要です。

.boost/filters/deploy.toml

schema_version = 1

[filters.deploy]
description = "Keep failures from deploy.sh"
version = "1"
match_command = '(?:^|[;&|]\s*)(?:bash\s+)?(?:\S*/)?deploy\.sh\b'
# The hook pipes output to boost, so select by a distinctive output signature.
# (?m) makes ^ and $ match each line, not only the full output boundaries.
match_output_select = [
  '(?m)^Starting deployment$\n^Environment: ',
]
strip_ansi = true
keep_lines_matching = [
  '^Starting deployment$',
  '^Environment: ',
  '^\[(WARN|ERROR)\]',
  '^ERROR DETAILS:$',
  'failed readiness probe',
  '^File:$',
  '^deploy/check_health\.go:\d+$',
  '^Reason:$',
  '^connection refused',
  '^Rollback started\.\.\.$',
  '^Deployment FAILED$',
]

[[tests.deploy]]
name = "keeps failures, drops info chatter"
input = """
Starting deployment
Environment: staging
[INFO] Waiting for rollout
[WARN] High memory usage detected
[ERROR] Deployment validation failed
ERROR DETAILS:
service payment-service failed readiness probe
File:
deploy/check_health.go:142
Reason:
connection refused to database
Rollback started...
Deployment FAILED
Environment: staging
"""
expected = """
Starting deployment
Environment: staging
[WARN] High memory usage detected
[ERROR] Deployment validation failed
ERROR DETAILS:
service payment-service failed readiness probe
File:
deploy/check_health.go:142
Reason:
connection refused to database
Rollback started...
Deployment FAILED
Environment: staging
"""
Before (raw)
Starting deployment
Environment: staging
[INFO] Waiting for rollout
[WARN] High memory usage detected
[ERROR] Deployment validation failed
ERROR DETAILS:
service payment-service failed readiness probe
File:
deploy/check_health.go:142
Reason:
connection refused to database
Rollback started...
Deployment FAILED
Environment: staging
After Boost filter
Starting deployment
Environment: staging
[WARN] High memory usage detected
[ERROR] Deployment validation failed
ERROR DETAILS:
service payment-service failed readiness probe
File:
deploy/check_health.go:142
Reason:
connection refused to database
Rollback started...
Deployment FAILED
Environment: staging

$ ./scripts/deploy.sh staging # the installed Boost hook pipes output automatically

インラインテスト

[[tests.<name>]] ブロックは回帰フィクスチャです: nameinputexpected。任意の expect_match_outputmatch_output_select の選択を検証できます。

実行方法

まだ boost filters test はありません。カスタムフィルターはサンプル出力を boost にパイプして確認します。組み込みフィクスチャは go test で走ります:

# Spot-check a custom filter: pipe sample output through boost
printf '%s\n' 'Starting deployment' 'Environment: staging' '[INFO] noise' | boost

# Built-in [[tests.*]] fixtures run in the Boost repo / CI:
go test ./internal/tomlfilter/ -run TestInlineTestDefs

例: make の冗長出力を削除

組み込みフィルターも同じスキーマです。同梱の make フィルターを反映: ディレクトリ入退場行と空行を削除。

schema_version = 1

[filters.make]
match_command = "^make\\b"
match_output_select = [
  "^make\\[\\d+\\]:",
  "^gcc ",
]
strip_lines_matching = [
  "^make\\[\\d+\\]:",
  "^\\s*$",
  "^Nothing to be done",
]
on_empty = "make: ok"
Before
make[1]: Entering directory '/home/user/app'
gcc -O2 -c src/main.c
gcc -O2 -o app src/main.o

make[1]: Leaving directory '/home/user/app'
After
gcc -O2 -c src/main.c
gcc -O2 -o app src/main.o

例: クリーンな lint で短絡

match_output で、ツールが静かに成功したとき 1 行サマリーを返します。

schema_version = 1

[filters.eslint-quiet]
match_command = "^eslint\\b"
match_output_select = [
  "problems",
]
match_output = [
  { pattern = "0 problems", message = "eslint: ok" },
]

フィルターを無効化

CLI を推奨:

boost filters show                 # inventory with enabled/disabled status
boost filters show --enabled       # enabled filters only
boost filters disable git-status   # bare name or toml:builtin:git-status
boost filters enable git-status

または ~/.boost/config.toml を直接編集し、[filters] disabled に名前を列挙します。retrieve_disable_threshold 回の retrieve(デフォルト 3)後、boost retrieve がロールバック名を自動追加します。0 で自動無効化をオフにできます。

[filters]
disabled = ["git-status", "make"]
retrieve_disable_threshold = 3

フィルターフィールド

フィールド目的
schema_versionintFile-level schema marker (recommended 1; reserved for future validation)
descriptionstringHuman-readable note (not used at filter runtime)
versionstringCapability version for retrieve / telemetry (e.g. "1")
match_commandstringCommand-path selector: regex against the full command line
match_output_selectstring[]Pipe-path selector: regexes against the complete piped output; use (?m) for line anchors
strip_ansiboolRemove terminal color codes first (before other stages)
replacearrayLine-level regex replacements: { pattern, replacement }
match_outputarrayIf output matches pattern, return message instead (optional unless)
strip_lines_matchingstring[]Drop lines matching any pattern
keep_lines_matchingstring[]Keep only matching lines
dedupe_lines_matchingstring[]Keep the first exact copy of each matching line; drop later identical copies
collapse_lines_matchingarrayReplace matching lines with one summary: { pattern, template }{count} = number of matches
head_lines / tail_linesintKeep first or last N lines
on_emptystringMessage when filtering removes everything

各ファイル先頭に schema_version = 1 を推奨。ステージ順: strip ANSI → replace → match_output → strip/keep → dedupe → collapse → head/tail → on_empty。完全なリファレンスは docs/TOML_FILTERS.md